On Tue, Oct 19, 2010 at 10:03:32PM +0200, Miod Vallat wrote:
> > Index: pms.c
> > ===================================================================
> > RCS file: /cvs/src/sys/dev/pckbc/pms.c,v
> > retrieving revision 1.10
> > diff -u -p -r1.10 pms.c
> > --- pms.c 17 Oct 2010 10:32:00 -0000 1.10
> > +++ pms.c 17 Oct 2010 11:30:24 -0000
> > @@ -134,21 +134,10 @@ pmsprobe(struct device *parent, void *ma
> > /* reset the device */
> > cmd[0] = PMS_RESET;
> > res = pckbc_poll_cmd(pa->pa_tag, pa->pa_slot, cmd, 1, 2, resp, 1);
> > - if (res) {
> > + if (res || resp[0] != PMS_RSTDONE || resp[1] != 0) {
> > #ifdef DEBUG
> > - printf("pmsprobe: reset error %d\n", res);
> > -#endif
> > - return (0);
> > - }
> > - if (resp[0] != PMS_RSTDONE) {
> > - printf("pmsprobe: reset response 0x%x\n", resp[0]);
> > - return (0);
> > - }
> > -
> > - /* get type number (0 = mouse) */
> > - if (resp[1] != 0) {
> > -#ifdef DEBUG
> > - printf("pmsprobe: type 0x%x\n", resp[1]);
> > + printf("pms: reset error %d (response 0x%02x, type 0x%02x)\n",
> > + res, resp[0], resp[1]);
> > #endif
> > return (0);
> > }
>
> I disagree with this change (yes, I know it has been commited). Either
> you do not use option DEBUG, and your diff causes no change in the
> generated code, or you do, and your diff makes the error message less
> readable. I do not see any benefit in this.
>
> Miod
I prefer the new error message and find the newer code easier to
read, but obviously a matter of taste. If you have really strong
feelings we can revert since it doesn't make functional changes.
.... Ken