Skip to contentSkip to conversation

mtd: refactor call to request_module

PATCH RESEND Applied Kees Cook 4 participants 4 messages Jul 8, 2013 – Aug 2, 2013 Memory technology devices (MTD)

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH RESEND 1/1 mtd: refactor call to request_module

This reduces the size of the stack frame when calling request_module(). Performing the sprintf before the call is not needed.

---
 drivers/mtd/chips/gen_probe.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mtd/chips/gen_probe.c +1 -3
index 74dbb6b..ffb36ba 100644
@@ -211,9 +211,7 @@ static inline struct mtd_info *cfi_cmdset_unknown(struct map_info *map,
 
 	probe_function = __symbol_get(probename);
 	if (!probe_function) {
-		char modname[sizeof("cfi_cmdset_%4.4X")];
-		sprintf(modname, "cfi_cmdset_%4.4X", type);
-		request_module(modname);
+		request_module("cfi_cmdset_%4.4X", type);
 		probe_function = __symbol_get(probename);
 	}
 
Signature · 6 lines
1.7.9.5


-- 
Kees Cook
Chrome OS Security
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Kees Cook

This reduces the size of the stack frame when calling request_module(). Performing the sprintf before the call is not needed.

Thanks,
Rusty.

Quoted 31 lines
---
 drivers/mtd/chips/gen_probe.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mtd/chips/gen_probe.c +1 -3
index 74dbb6b..ffb36ba 100644
@@ -211,9 +211,7 @@ static inline struct mtd_info *cfi_cmdset_unknown(struct map_info *map,
 
 	probe_function = __symbol_get(probename);
 	if (!probe_function) {
-		char modname[sizeof("cfi_cmdset_%4.4X")];
-		sprintf(modname, "cfi_cmdset_%4.4X", type);
-		request_module(modname);
+		request_module("cfi_cmdset_%4.4X", type);
 		probe_function = __symbol_get(probename);
 	}
 
Signature · 11 lines
1.7.9.5


-- 
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/