From: Arnd Bergmann <arnd@xxxxxxxx> Using a string variable as a format causes a -Wformat-security warning. Since the only use of the temporary module_string[] is to hold the sprintf() output, just pass the format string and argument directly to request_module(). Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx> --- drivers/staging/gpib/common/gpib_os.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index e93a45132a40..6b12404efe7d 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -599,11 +599,9 @@ int ibopen(struct inode *inode, struct file *filep) GPIB_DPRINTK("pid %i, gpib: opening minor %d\n", current->pid, minor); if (board->use_count == 0) { - char module_string[32]; int retval; - snprintf(module_string, sizeof(module_string), "gpib%i", minor); - retval = request_module(module_string); + retval = request_module("gpib%i", minor); if (retval) { GPIB_DPRINTK("pid %i, gpib: request module returned %i\n", current->pid, retval); -- 2.39.5