Re: [PATCH] hwmon: (occ) Mark occ_init_attribute() as __printf

Guenter Roeck
2026-02-04T22:40:53Z

On Tue, Feb 03, 2026 at 05:34:36PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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 <arnd@arndb.de>

Applied.

Thanks,
Guenter