diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2015-12-01 15:54:01 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2015-12-08 15:15:32 +0100 |
commit | bcf4299e6215a475259c3ac329d43e776cfe9c0c (patch) | |
tree | 6473cc8b75667791244a9a58a5a1c23c31e96b77 /drivers | |
parent | exynos: fixes an incorrect header guard (diff) | |
download | linux-bcf4299e6215a475259c3ac329d43e776cfe9c0c.tar.xz linux-bcf4299e6215a475259c3ac329d43e776cfe9c0c.zip |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/floppy.c | 5 |
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) unsigned int type = UDP->cmos; struct floppy_drive_params *params; const char *name = NULL; - static char temparea[32]; + char temparea[32]; if (type < ARRAY_SIZE(default_drive_params)) { params = &default_drive_params[type].params; @@ -3596,7 +3596,8 @@ static void __init config_types(void) allowed_drive_mask &= ~(1 << drive); } else { params = &default_drive_params[0].params; - sprintf(temparea, "unknown type %d (usb?)", type); + snprintf(temparea, sizeof(temparea), + "unknown type %d (usb?)", type); name = temparea; } if (name) { |