From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ilvokhin.com (mail.ilvokhin.com [178.62.254.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F06B1378818 for ; Mon, 18 May 2026 15:21:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.62.254.231 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779117718; cv=none; b=uJuOVu5O9bCNlUOhMgc7MkHt6tq97qY9ad4L0+KbrkdseQZg8GCVwCIAZ7khclxRsUPlXQuHcubjuMAzMAWhdAUvFKFWBLA0w+SItpo0SIE3TKT8D/LrnAoR2AX5s1XlO4C1c8hU6Rb9QsvqJKObNVmg7Zi13bfKw4wilX+zW30= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779117718; c=relaxed/simple; bh=rDf3nABXNo8vMeXp5HldaYDR5skbzeT8SXMZO6GsOxo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GtbXohN2w1YEWYJryxPoOMoiq5q4EG6UU9DsOg9U6OXxCnQuUVdQmI0bp6bdWuIguB8UNbf3tkwbo7b5gD/5wUFvL8e+F73pD2k4xmgz/yoBsqTMpkqDUH6VXMIpJWwVP9mPjLM3rFh6JL1qnaNqEdyOz4vIAvVe6Q6oXrfgAaI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ilvokhin.com; spf=pass smtp.mailfrom=ilvokhin.com; dkim=pass (1024-bit key) header.d=ilvokhin.com header.i=@ilvokhin.com header.b=FoPfZBRK; arc=none smtp.client-ip=178.62.254.231 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ilvokhin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ilvokhin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ilvokhin.com header.i=@ilvokhin.com header.b="FoPfZBRK" Received: from localhost.localdomain (shell.ilvokhin.com [138.68.190.75]) (Authenticated sender: d@ilvokhin.com) by mail.ilvokhin.com (Postfix) with ESMTPSA id 594EAD0741; Mon, 18 May 2026 15:21:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilvokhin.com; s=mail; t=1779117709; bh=lDIPRhu4eC69IHX//CJMd4ihavt8RgvIqQIf1iXGap8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FoPfZBRKk/Xz6V2KhS51m8PYmgYq3qDvs9vficc4yQIspPA0e0U7tT1/2OmDpkxI4 pkcxEeDdybg+5nIzUt1Hi9g9qW0BfPg1IsGMUxnB6PAiNHQQXYqnLlwqBI9/Hyfpg0 D8IosIIvyZzxJJs78s2F/el3VNxnwtsjo43I0MM4= From: Dmitry Ilvokhin To: Peter Zijlstra , Dan Williams , Vishal Verma , Dave Jiang , Ira Weiny , Miguel Ojeda , Thomas Gleixner , Christian Brauner , Marco Elver , "H. Peter Anvin" , Andrew Morton Cc: nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel-team@meta.com, Dmitry Ilvokhin Subject: [PATCH v3 2/4] genirq: Move NULL check into irqdesc_lock guard unlock expression Date: Mon, 18 May 2026 15:21:28 +0000 Message-ID: <7509b85e0f75cf4388d2fd89b6e7fc8ff5e1b01f.1779116497.git.d@ilvokhin.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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