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

Nilay Shroff nilay at linux.ibm.com
Thu Sep 17 01:14:31 PDT 2026


On 9/17/26 11:34 AM, 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.
> 
> Signed-off-by: Arnd Bergmann<arnd at arndb.de>

Looks good to me.
Reviewed-by: Nilay Shroff <nilay at linux.ibm.com>



More information about the Linux-nvme mailing list