All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND][PATCH] mtd: refactor call to request_module
@ 2013-05-22 23:51 ` Kees Cook
  0 siblings, 0 replies; 12+ messages in thread
From: Kees Cook @ 2013-05-22 23:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, David Woodhouse, James Hogan, Rusty Russell, linux-mtd

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

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/mtd/chips/gen_probe.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mtd/chips/gen_probe.c b/drivers/mtd/chips/gen_probe.c
index 74dbb6b..ffb36ba 100644
--- a/drivers/mtd/chips/gen_probe.c
+++ b/drivers/mtd/chips/gen_probe.c
@@ -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);
 	}
 
-- 
1.7.9.5


-- 
Kees Cook
Chrome OS Security

^ permalink raw reply related	[flat|nested] 12+ messages in thread
* [RESEND][PATCH] mtd: refactor call to request_module
@ 2013-07-08 13:05 ` Kees Cook
  0 siblings, 0 replies; 12+ messages in thread
From: Kees Cook @ 2013-07-08 13:05 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, David Woodhouse, James Hogan, Rusty Russell, linux-mtd

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

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/mtd/chips/gen_probe.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mtd/chips/gen_probe.c b/drivers/mtd/chips/gen_probe.c
index 74dbb6b..ffb36ba 100644
--- a/drivers/mtd/chips/gen_probe.c
+++ b/drivers/mtd/chips/gen_probe.c
@@ -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);
 	}
 
-- 
1.7.9.5


-- 
Kees Cook
Chrome OS Security

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-08-02 15:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-22 23:51 [RESEND][PATCH] mtd: refactor call to request_module Kees Cook
2013-05-22 23:51 ` Kees Cook
2013-05-23  4:15 ` Rusty Russell
2013-05-23  4:15   ` Rusty Russell
2013-07-08 13:05 Kees Cook
2013-07-08 13:05 ` Kees Cook
2013-07-10  3:10 ` Rusty Russell
2013-07-10  3:10   ` Rusty Russell
2013-07-10  8:40   ` James Hogan
2013-07-10  8:40     ` James Hogan
2013-08-02 15:53 ` Artem Bityutskiy
2013-08-02 15:53   ` Artem Bityutskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.