From: "tip-bot2 for Dmitry Ilvokhin" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Dan Carpenter <error27@gmail.com>,
Dmitry Ilvokhin <d@ilvokhin.com>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: locking/core] cleanup: Specify nonnull argument index
Date: Fri, 05 Jun 2026 13:08:09 -0000 [thread overview]
Message-ID: <178066488924.710.16327470691661981001.tip-bot2@tip-bot2> (raw)
In-Reply-To: <aiKpH3cLBEj3TF2Q@shell.ilvokhin.com>
The following commit has been merged into the locking/core branch of tip:
Commit-ID: a40e0f8eadd44d7b0f856b54c876aea1b93415f4
Gitweb: https://git.kernel.org/tip/a40e0f8eadd44d7b0f856b54c876aea1b93415f4
Author: Dmitry Ilvokhin <d@ilvokhin.com>
AuthorDate: Fri, 05 Jun 2026 03:06:22 -07:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 05 Jun 2026 14:46:51 +02:00
cleanup: Specify nonnull argument index
The guard constructors were annotated with an empty __nonnull_args(),
relying on __nonnull__() marking every pointer parameter as non-NULL.
Sparse cannot parse the empty argument list.
Both constructors take the lock pointer as their first parameter, so
specify the index explicitly: __nonnull_args(1).
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/all/aiJi0WcYE8FZt-jO@stanley.mountain/
Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/aiKpH3cLBEj3TF2Q@shell.ilvokhin.com
---
include/linux/cleanup.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/cleanup.h b/include/linux/cleanup.h
index 6541693..b1b5698 100644
--- a/include/linux/cleanup.h
+++ b/include/linux/cleanup.h
@@ -397,7 +397,7 @@ static __maybe_unused const bool class_##_name##_is_conditional = _is_cond
__DEFINE_GUARD_LOCK_PTR(_name, _T)
#define DEFINE_GUARD(_name, _type, _lock, _unlock) \
- static __always_inline __nonnull_args() _type class_##_name##_constructor(_type _T); \
+ static __always_inline __nonnull_args(1) _type class_##_name##_constructor(_type _T); \
DEFINE_CLASS(_name, _type, _unlock, ({ _lock; _T; }), _type _T); \
DEFINE_CLASS_IS_GUARD(_name)
@@ -498,7 +498,7 @@ static __always_inline void class_##_name##_destructor(class_##_name##_t *_T) \
__DEFINE_GUARD_LOCK_PTR(_name, &_T->lock)
#define __DEFINE_LOCK_GUARD_1(_name, _type, ...) \
-static __always_inline __nonnull_args() \
+static __always_inline __nonnull_args(1) \
class_##_name##_t class_##_name##_constructor(_type *l) \
__no_context_analysis \
{ \
next prev parent reply other threads:[~2026-06-05 13:08 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-02 7:12 [PATCH v5 0/4] cleanup: Remove NULL check from unconditional guards Dmitry Ilvokhin
2026-06-02 7:12 ` [PATCH v5 1/4] nvdimm: Convert nvdimm_bus guard to class Dmitry Ilvokhin
2026-06-03 14:25 ` [tip: locking/core] " tip-bot2 for Dmitry Ilvokhin
2026-06-02 7:12 ` [PATCH v5 2/4] genirq: Move NULL check into irqdesc_lock guard unlock expression Dmitry Ilvokhin
2026-06-02 20:37 ` Thomas Gleixner
2026-06-03 14:25 ` [tip: locking/core] " tip-bot2 for Dmitry Ilvokhin
2026-06-02 7:12 ` [PATCH v5 3/4] cleanup: Annotate guard constructors with nonnull Dmitry Ilvokhin
2026-06-02 7:32 ` Miguel Ojeda
2026-06-02 9:19 ` Dmitry Ilvokhin
2026-06-03 14:25 ` [tip: locking/core] " tip-bot2 for Dmitry Ilvokhin
2026-06-05 5:46 ` [PATCH v5 3/4] " Dan Carpenter
2026-06-05 10:46 ` Dmitry Ilvokhin
2026-06-05 13:08 ` tip-bot2 for Dmitry Ilvokhin [this message]
2026-06-02 7:12 ` [PATCH v5 4/4] cleanup: Remove NULL check from unconditional guards Dmitry Ilvokhin
2026-06-03 14:25 ` [tip: locking/core] " tip-bot2 for Dmitry Ilvokhin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178066488924.710.16327470691661981001.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=d@ilvokhin.com \
--cc=error27@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®