]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
init: remove permanent string buffer from do_one_initcall()
authorSteven Rostedt <rostedt@goodmis.org>
Fri, 7 Jun 2013 00:08:45 +0000 (10:08 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 7 Jun 2013 05:42:44 +0000 (15:42 +1000)
do_one_initcall() uses a 64 byte string buffer to save a message. This
buffer is declared static and is only used at boot up and when a module
is loaded. As 64 bytes is very small, and this function has very limited
scope, there's no reason to waste permanent memory with this string and
not just simply put it on the stack.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
init/main.c

index 9484f4ba88d05aa589bb737d96836a1a01db55ce..1b9e7f1b8008f81741f53abe205ebf0fab7fed4d 100644 (file)
@@ -655,8 +655,6 @@ static void __init do_ctors(void)
 bool initcall_debug;
 core_param(initcall_debug, initcall_debug, bool, 0644);
 
-static char msgbuf[64];
-
 static int __init_or_module do_one_initcall_debug(initcall_t fn)
 {
        ktime_t calltime, delta, rettime;
@@ -679,6 +677,7 @@ int __init_or_module do_one_initcall(initcall_t fn)
 {
        int count = preempt_count();
        int ret;
+       char msgbuf[64];
 
        if (initcall_debug)
                ret = do_one_initcall_debug(fn);