---- Fri, 25 Jul 2025 18:12:14 +0530 को [email protected] ने लिखा ----

> - Clarity to readers that the pointer is guaranteed to be non-null,


Assumption isn't a guarantee.


> and that a check is redundant (because performance critical context,
> etc.)


Compiler optimises it away usually.

> - Future patches that decide to use this macro can be a signal to
> reviewers to actually check correctness that a pointer is indeed
> invariably non-null


That can pretty easily change in future.


> - Make static analysis more useful by documenting when a certain false
> positive is actually false


Is your case really a false positive?


There is an explicit check for NULL in some other using the
get_node function, most visibly in the macro below.


If we know NULL won't be there, we should add an
assert in code instead of a silent assumption.


Thanks,
Siddh
_______________________________________________
Kernelnewbies mailing list
[email protected]
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to