[PATCH] nvme: work around all -Wformat-security warnings

Keith Busch kbusch at kernel.org
Thu Sep 17 12:53:16 PDT 2026


On Thu, Sep 17, 2026 at 08:04:03AM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd at arndb.de>
> 
> 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.



More information about the Linux-nvme mailing list