Re: [PATCH] scsi: leapraid: avoid -Wformat-security warning

From: Damien Le Moal

Date: Tue Sep 15 2026 - 22:04:46 EST


On 2026/09/16 3:20, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> When extra warnings are enabled, the alloc_ordered_workqueue() function
> cannot be called with a variable name for the format string:
>
> drivers/scsi/leapraid/leapraid_os.c: In function 'leapraid_probe':
> drivers/scsi/leapraid/leapraid_os.c:2062:58: error: format not a string literal and no format arguments [-Werror=format-security]
> 2062 | alloc_ordered_workqueue(adapter->fw_evt_s.fw_evt_name, 0);
> | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
>
> As the string is only assembled before the call and not used anywhere
> else, just fold the earlier snprintf() into the alloc_ordered_workqueue()
> call.
>
> Fixes: 5597088c9e79 ("scsi: leapraid: Add new SCSI driver")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>

Reviewed-by: Damien Le Moal <dlemoal@xxxxxxxxxx>

--
Damien Le Moal
Western Digital Research