Re: [PATCH] nvme: work around all -Wformat-security warnings
From: Keith Busch
Date: Thu Sep 17 2026 - 16:46:27 EST
On Thu, Sep 17, 2026 at 08:04:03AM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> The sysfs code passes two string variables into sysfs_emit(), which is safe
> in this instance but causes the compiler to warn when -Wformat-security
> is enabled:
>
> host/sysfs.c: In function `cntrltype_show´:
> host/sysfs.c:682:9: error: format not a string literal and no format arguments [-Werror=format-security]
> 682 | return sysfs_emit(buf, type[ctrl->cntrltype]);
>
> Print these using a "%s" format like all other instances in the same file.
Thanks, applied to nvme-7.3.