uml: don't use a too long string literal

uml uses a concatenated string literal to store the contents of .config,
but .config file content is varaible, it can be very long.

Use an array of string literals instead.

Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
WANG Cong
2009-03-31 15:23:40 -07:00
committed by Linus Torvalds
parent 792dd4fc31
commit dc71768742
2 changed files with 9 additions and 5 deletions

View File

@ -7,11 +7,15 @@
#include <stdlib.h>
#include "init.h"
static __initdata char *config = "CONFIG";
static __initdata const char *config[] = {
"CONFIG"
};
static int __init print_config(char *line, int *add)
{
printf("%s", config);
int i;
for (i = 0; i < sizeof(config)/sizeof(config[0]); i++)
printf("%s", config[i]);
exit(0);
}