Commit bcf4299e authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Jiri Kosina

floppy: make local variable non-static

There's no reason for temparea to be static, since it's only used for
temporary sprintf output. It's not immediately obvious that the output
will always fit (in the worst case, the output including '\0' is
exactly 32 bytes), so save a future reader from worrying about that.
Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 8e391117
...@@ -3585,7 +3585,7 @@ static void __init config_types(void) ...@@ -3585,7 +3585,7 @@ static void __init config_types(void)
unsigned int type = UDP->cmos; unsigned int type = UDP->cmos;
struct floppy_drive_params *params; struct floppy_drive_params *params;
const char *name = NULL; const char *name = NULL;
static char temparea[32]; char temparea[32];
if (type < ARRAY_SIZE(default_drive_params)) { if (type < ARRAY_SIZE(default_drive_params)) {
params = &default_drive_params[type].params; params = &default_drive_params[type].params;
...@@ -3596,7 +3596,8 @@ static void __init config_types(void) ...@@ -3596,7 +3596,8 @@ static void __init config_types(void)
allowed_drive_mask &= ~(1 << drive); allowed_drive_mask &= ~(1 << drive);
} else { } else {
params = &default_drive_params[0].params; params = &default_drive_params[0].params;
sprintf(temparea, "unknown type %d (usb?)", type); snprintf(temparea, sizeof(temparea),
"unknown type %d (usb?)", type);
name = temparea; name = temparea;
} }
if (name) { if (name) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment