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

From: Nilay Shroff

Date: Thu Sep 17 2026 - 04:19:19 EST


On 9/17/26 11:34 AM, 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.

Signed-off-by: Arnd Bergmann<arnd@xxxxxxxx>

Looks good to me.
Reviewed-by: Nilay Shroff <nilay@xxxxxxxxxxxxx>