mtd: refactor call to request_module

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Aug 5 16:59:06 EDT 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=f9827dde2f6a1b64f8241de18ccf5027a636d8f4
Commit:     f9827dde2f6a1b64f8241de18ccf5027a636d8f4
Parent:     2e294972f0c3616df160f95604d1a75056b75a8a
Author:     Kees Cook <keescook at chromium.org>
AuthorDate: Mon Jul 8 06:05:12 2013 -0700
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Aug 5 21:01:42 2013 +0100

    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.
    
    Signed-off-by: Kees Cook <keescook at chromium.org>
    Acked-by: Rusty Russell <rusty at rustcorp.com.au>
    Reviewed-by: James Hogan <james.hogan at imgtec.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 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);
 	}
 



More information about the linux-mtd-cvs mailing list