Skip to content

Commit

Permalink
init: remove permanent string buffer from do_one_initcall()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
rostedt authored and torvalds committed Jul 3, 2013
1 parent 351b2a1 commit ff1c8fa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit ff1c8fa

Please sign in to comment.