From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1C6381AF0AF; Mon, 9 Feb 2026 14:33:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770647621; cv=none; b=hfWTj6aezAbvdyQlmdHbMPIHjRNNmkGDkmK8bt/qwK6Jw2qIFXQyu/JUdZiKOVuW/Ht5mj052YIi4V7Kj7OI6IrIQgCf5Qy1kXIHiPHcWkzf1wG0ufgLlARyNE0meKbCAVujr9jo0jbvIlhUMh9wHwo8xg6yhRw3j7Vj9T1Akhk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770647621; c=relaxed/simple; bh=MOko2+4LJAuudJWkhMjv4QILg4cNuix0e8zJLiCbsHI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZffXik1vFMMSr9AjTME3r7FOt4rX1E8B1afv9b+m8pFnbbcldSGa/j1AasSrh6XsYq5V3mpd0E7R1Tc6DOA8q1ZLZKJXcOWtoqnwRu6fYcdITqDGhph9emiZz6vEDjvoon2FUM7ONXGVK7A6IpHOv1s7k4VV8X15IXbBRisk9pY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SJw+E7eS; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="SJw+E7eS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86E06C116C6; Mon, 9 Feb 2026 14:33:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770647621; bh=MOko2+4LJAuudJWkhMjv4QILg4cNuix0e8zJLiCbsHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SJw+E7eS215ondBONNEqv6FnNilsuy3mro73OS4CUZ3Hj4hgZUeunGxl7TYEw5JsI mAB9cfvbnLP+oETe/2rsux+ioo0V+TCYK4iQ5VHf3izQBORliqxI5SFjN4E4C6Vu9X ygOhxs0o7po2rYH/ZGXS35xNLDNmGsf5whfry+E8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Arnd Bergmann , Guenter Roeck , Sasha Levin Subject: [PATCH 6.18 153/175] hwmon: (occ) Mark occ_init_attribute() as __printf Date: Mon, 9 Feb 2026 15:23:46 +0100 Message-ID: <20260209142326.001857396@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260209142320.474120190@linuxfoundation.org> References: <20260209142320.474120190@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann [ Upstream commit 831a2b27914cc880130ffe8fb8d1e65a5324d07f ] This is a printf-style function, which gcc -Werror=suggest-attribute=format correctly points out: drivers/hwmon/occ/common.c: In function 'occ_init_attribute': drivers/hwmon/occ/common.c:761:9: error: function 'occ_init_attribute' might be a candidate for 'gnu_printf' format attribute [-Werror=suggest-attribute=format] Add the attribute to avoid this warning and ensure any incorrect format strings are detected here. Fixes: 744c2fe950e9 ("hwmon: (occ) Rework attribute registration for stack usage") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20260203163440.2674340-1-arnd@kernel.org Signed-off-by: Guenter Roeck Signed-off-by: Sasha Levin --- drivers/hwmon/occ/common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hwmon/occ/common.c b/drivers/hwmon/occ/common.c index b3694a4209b97..89928d38831b6 100644 --- a/drivers/hwmon/occ/common.c +++ b/drivers/hwmon/occ/common.c @@ -749,6 +749,7 @@ static ssize_t occ_show_extended(struct device *dev, * are dynamically allocated, we cannot use the existing kernel macros which * stringify the name argument. */ +__printf(7, 8) static void occ_init_attribute(struct occ_attribute *attr, int mode, ssize_t (*show)(struct device *dev, struct device_attribute *attr, char *buf), ssize_t (*store)(struct device *dev, struct device_attribute *attr, -- 2.51.0