From nobody Mon Jun 8 08:30:33 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 40FCC48BD59; Wed, 3 Jun 2026 14:25:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780496715; cv=none; b=b3oPR3Z6Cxaq8B65x52hXsThnOvfImIcbPNuDUhKM3A9ANQ2YJJ2GMU4Ti8ZRxfJtJWH/L7gKqsB2Bx8n5Hh2WTRsfTBVbCuumCPK6qsp+dVrH0kwb2mIRYzE0uveqnQTGCyuOfj1O3UjPpDdbz1yd11h32kn9zp1eYZOzaeOB8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780496715; c=relaxed/simple; bh=RDbyFkHe4SIHgeOXR5uwQUocnbU0Oyfk0Cf7Dmsmcew=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=q6csXIu8w40Lp42YLX5sAYLVgbhDk87ZCR3Ze0QhPkPIEJPVyEd/ZanGJmlaWei4XpLGtxQLHSrcyyJD/slAHIyqhNl+O8Ns2EX91HDcqYkjrtQ0vA6V1W2I9LNmVoGDG9izc5yQ32eYE9XD1ws2DccZrIJAuBmYYOsPsSXdQ8c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=oMaatr5z; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=1eEK6zwO; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="oMaatr5z"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="1eEK6zwO" Date: Wed, 03 Jun 2026 14:25:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1780496713; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3GL2R/y2dcbqYUCgbEv30IZyDBuzlVWFb8C/XltqWLg=; b=oMaatr5zx+gIRWTAaKjbLwy/LppNYbyc5loNgnDikZ3VzSX9RO2JDfm92mM8OBTaz+z0eo 3VRpldCVAXeQZVebmAmgGwf5Y54qg6OEOe9jDrp8Ue73wQiHV/UIxJ56f3gogjp6Vdd1bq C5eSjX25onRPYFCho0i+ovLocCXFNkzA7467LnXfQEu00uMRhnFTRBexsDmLX5WmSlEGN4 o5FNRlhzj3dVB9k7z9TBEyYgeSkMP7sFWvpUN8096hO8NDDXTPu/eWnbJB2c1gZqnRxxFH I+x6FK5ZQLwkfLPsPNEzme0A5ARidT0F8ZA1VwGkEVRVN2BGej+aFDqRvYMvnw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1780496713; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3GL2R/y2dcbqYUCgbEv30IZyDBuzlVWFb8C/XltqWLg=; b=1eEK6zwOElC5mfO5Hng4vhMgExXHJYhJcuz69Jyc3plROIrGvm+UMqJG8U2xBP3aZigBMq btCQj8R3T3iQSTBw== From: "tip-bot2 for Dmitry Ilvokhin" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] nvdimm: Convert nvdimm_bus guard to class Cc: Dmitry Ilvokhin , "Peter Zijlstra (Intel)" , Dave Jiang , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <8c0417904d280896ecf2e9923ffa9f20076f59b8.1780064327.git.d@ilvokhin.com> References: <8c0417904d280896ecf2e9923ffa9f20076f59b8.1780064327.git.d@ilvokhin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178049671157.710.18361358982802138347.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the locking/core branch of tip: Commit-ID: 813e5598e5b551a1fb82b516428ce2f135921122 Gitweb: https://git.kernel.org/tip/813e5598e5b551a1fb82b516428ce2f13= 5921122 Author: Dmitry Ilvokhin AuthorDate: Tue, 02 Jun 2026 07:12:50=20 Committer: Peter Zijlstra CommitterDate: Wed, 03 Jun 2026 11:38:47 +02:00 nvdimm: Convert nvdimm_bus guard to class The nvdimm_bus guard accepts NULL and skips locking when NULL is passed. Convert from DEFINE_GUARD() to DEFINE_CLASS() + DEFINE_CLASS_IS_GUARD(). This is a preparatory change for making DEFINE_GUARD() constructors __nonnull_args(). nvdimm_bus legitimately passes NULL, so it must be adjusted to avoid a compile error. No functional change. Signed-off-by: Dmitry Ilvokhin Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dave Jiang Link: https://patch.msgid.link/8c0417904d280896ecf2e9923ffa9f20076f59b8.178= 0064327.git.d@ilvokhin.com --- drivers/nvdimm/nd.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/nvdimm/nd.h b/drivers/nvdimm/nd.h index b199eea..18b6455 100644 --- a/drivers/nvdimm/nd.h +++ b/drivers/nvdimm/nd.h @@ -632,8 +632,11 @@ u64 nd_region_interleave_set_cookie(struct nd_region *= nd_region, u64 nd_region_interleave_set_altcookie(struct nd_region *nd_region); void nvdimm_bus_lock(struct device *dev); void nvdimm_bus_unlock(struct device *dev); -DEFINE_GUARD(nvdimm_bus, struct device *, - if (_T) nvdimm_bus_lock(_T), if (_T) nvdimm_bus_unlock(_T)); +DEFINE_CLASS(nvdimm_bus, struct device *, + if (_T) nvdimm_bus_unlock(_T), + ({ if (_T) nvdimm_bus_lock(_T); _T; }), + struct device *_T); +DEFINE_CLASS_IS_GUARD(nvdimm_bus); =20 bool is_nvdimm_bus_locked(struct device *dev); void nvdimm_check_and_set_ro(struct gendisk *disk);