aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2015-12-01 09:54:01 -0500
committerJiri Kosina <jkosina@suse.cz>2015-12-08 09:15:32 -0500
commitbcf4299e6215a475259c3ac329d43e776cfe9c0c (patch)
tree6473cc8b75667791244a9a58a5a1c23c31e96b77
parent8e3911178e0d406bc3e84e7dcd8b556edc47b9d7 (diff)
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: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/block/floppy.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 331363e7de0f..9e251201dd48 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -3585,7 +3585,7 @@ static void __init config_types(void)
3585 unsigned int type = UDP->cmos; 3585 unsigned int type = UDP->cmos;
3586 struct floppy_drive_params *params; 3586 struct floppy_drive_params *params;
3587 const char *name = NULL; 3587 const char *name = NULL;
3588 static char temparea[32]; 3588 char temparea[32];
3589 3589
3590 if (type < ARRAY_SIZE(default_drive_params)) { 3590 if (type < ARRAY_SIZE(default_drive_params)) {
3591 params = &default_drive_params[type].params; 3591 params = &default_drive_params[type].params;
@@ -3596,7 +3596,8 @@ static void __init config_types(void)
3596 allowed_drive_mask &= ~(1 << drive); 3596 allowed_drive_mask &= ~(1 << drive);
3597 } else { 3597 } else {
3598 params = &default_drive_params[0].params; 3598 params = &default_drive_params[0].params;
3599 sprintf(temparea, "unknown type %d (usb?)", type); 3599 snprintf(temparea, sizeof(temparea),
3600 "unknown type %d (usb?)", type);
3600 name = temparea; 3601 name = temparea;
3601 } 3602 }
3602 if (name) { 3603 if (name) {