tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/dev/wscons



"Hans Rosenfeld" <hans%netbsd.org@localhost> writes:

> Module Name:	src
> Committed By:	hans
> Date:		Sun Mar 23 12:19:32 UTC 2025
>
> Modified Files:
> 	src/sys/dev/wscons: wsmouse.c
>
> Log Message:
> wsmouse(4): fix bogus DIAGNOSTIC checks
>
> Similar to wskbd(4), these checks should be done always, and the only
> thing DIAGNOSTIC about them should be the printing of the message.

This doesn't sound quite right.

DIAGNOSTIC is supposed to be about checking invariants and panicing.
Because the invariants are always true (hah), this should be a no-op and
is omitted in production.

If the code is checking something that is input or somehow could be
invalid data *without a kernel bug*, then I agree it should always
happen.  But noting it (as a kernel printf or whatever) should not be
conditioned on DIAGNOSTIC.   Probably instead some WSDEBUG, like we have
USBDEBUG etc.





Home | Main Index | Thread Index | Old Index