"Hans Rosenfeld" <h...@netbsd.org> 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.