From: Dmitry Ilvokhin <d@ilvokhin.com>
To: Peter Zijlstra <peterz@infradead.org>,
Dan Williams <djbw@kernel.org>,
Vishal Verma <vishal.l.verma@intel.com>,
Dave Jiang <dave.jiang@intel.com>,
Ira Weiny <ira.weiny@intel.com>, Miguel Ojeda <ojeda@kernel.org>,
Thomas Gleixner <tglx@kernel.org>,
Christian Brauner <brauner@kernel.org>,
Marco Elver <elver@google.com>, "H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, kernel-team@meta.com,
Dmitry Ilvokhin <d@ilvokhin.com>
Subject: [PATCH v3 2/4] genirq: Move NULL check into irqdesc_lock guard unlock expression
Date: Mon, 18 May 2026 15:21:28 +0000 [thread overview]
Message-ID: <7509b85e0f75cf4388d2fd89b6e7fc8ff5e1b01f.1779116497.git.d@ilvokhin.com> (raw)
In-Reply-To: <cover.1779116497.git.d@ilvokhin.com>
irqdesc_lock uses __DEFINE_UNLOCK_GUARD() directly with a custom
constructor that can set .lock to NULL.
In preparation for removing the NULL check from __DEFINE_UNLOCK_GUARD(),
move the NULL check into the irqdesc_lock unlock expression, making the
NULL handling explicit at the call site.
No functional change.
Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com>
---
kernel/irq/internals.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h
index 9412e57056f5..347cb333b9fe 100644
--- a/kernel/irq/internals.h
+++ b/kernel/irq/internals.h
@@ -171,7 +171,7 @@ void __irq_put_desc_unlock(struct irq_desc *desc, unsigned long flags, bool bus)
__DEFINE_CLASS_IS_CONDITIONAL(irqdesc_lock, true);
__DEFINE_UNLOCK_GUARD(irqdesc_lock, struct irq_desc,
- __irq_put_desc_unlock(_T->lock, _T->flags, _T->bus),
+ if (_T->lock) __irq_put_desc_unlock(_T->lock, _T->flags, _T->bus),
unsigned long flags; bool bus);
static inline class_irqdesc_lock_t class_irqdesc_lock_constructor(unsigned int irq, bool bus,
--
2.53.0-Meta
next prev parent reply other threads:[~2026-05-18 15:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 15:21 [PATCH v3 0/4] cleanup: Remove NULL check from unconditional guards Dmitry Ilvokhin
2026-05-18 15:21 ` [PATCH v3 1/4] nvdimm: Convert nvdimm_bus guard to class Dmitry Ilvokhin
2026-05-18 15:45 ` Dave Jiang
2026-05-18 15:21 ` Dmitry Ilvokhin [this message]
2026-05-18 15:21 ` [PATCH v3 3/4] cleanup: Annotate guard constructors with __nonnull() Dmitry Ilvokhin
2026-05-18 18:19 ` Miguel Ojeda
2026-05-19 11:54 ` Dmitry Ilvokhin
2026-05-19 12:45 ` Miguel Ojeda
2026-05-18 15:21 ` [PATCH v3 4/4] cleanup: Remove NULL check from unconditional guards 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=7509b85e0f75cf4388d2fd89b6e7fc8ff5e1b01f.1779116497.git.d@ilvokhin.com \
--to=d@ilvokhin.com \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=dave.jiang@intel.com \
--cc=djbw@kernel.org \
--cc=elver@google.com \
--cc=hpa@zytor.com \
--cc=ira.weiny@intel.com \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nvdimm@lists.linux.dev \
--cc=ojeda@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@kernel.org \
--cc=vishal.l.verma@intel.com \
/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®