On Fri, Feb 03, 2023 at 06:08:09PM +0000, Miod Vallat wrote:
> Yes and no. You are right that KASSERT is a nop on non-DIAGNOSTIC
> kernels, but there are sometimes good reasons to keep a single KASSERT
> (or a set of KASSERTs) wrapped within #ifdef DIAGNOSTIC.

...

> In this case, I would keep the #ifdef because this field only exists
> #ifdef DIAGNOSTIC, so all the code operating on it should have such
> guards for consistency.

Ah, OK.  I did wonder if some of it was intentional, but since there are only
a few instances of KASSERT within #ifdef DIAGNOSTIC in the whole tree I
assumed that we weren't doing this elsewhere.

Reply via email to