diff options
| author | Dmitry Ilvokhin <d@ilvokhin.com> | 2026-06-02 07:12:52 +0000 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2026-06-03 11:38:48 +0200 |
| commit | 22302af28d3f7c3ca38536978c80db51d2a9e283 (patch) | |
| tree | 3f40e7143d0de27688dde8a58fcc95ef320b87d5 /rust/kernel/alloc | |
| parent | 08d4a7837f008ea6031c1292aa839ad881d7b3f1 (diff) | |
cleanup: Annotate guard constructors with nonnull
Add __nonnull_args() to unconditional guard constructors so the compiler
warns when NULL is statically known to be passed:
- DEFINE_GUARD(): re-declare the constructor with __nonnull_args().
- __DEFINE_LOCK_GUARD_1(): annotate the constructor directly.
DEFINE_LOCK_GUARD_0() needs no annotation: its constructor takes no
pointer arguments (.lock is hardcoded to (void *)1).
Define the __nonnull_args() macro in compiler_attributes.h, following
the existing convention for attribute wrappers. Deliberately not named
'__nonnull', to avoid clashing with glibc's __nonnull() when kernel and
userspace headers are combined (User Mode Linux for example).
Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/85fee12eec20abfcf711443518e8f0caec982a86.1780064327.git.d@ilvokhin.com
Diffstat (limited to 'rust/kernel/alloc')
0 files changed, 0 insertions, 0 deletions
