Commit 4356f489 authored by Trevor Keith's avatar Trevor Keith Committed by Sam Ravnborg

kbuild: add static to prototypes

Warnings found via gcc -Wmissing-prototypes.
Signed-off-by: default avatarTrevor Keith <tsrk@tsrk.net>
Acked-by: default avatarWANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent 66a57062
...@@ -71,7 +71,7 @@ FILELINE * docsection; ...@@ -71,7 +71,7 @@ FILELINE * docsection;
static char *srctree, *kernsrctree; static char *srctree, *kernsrctree;
void usage (void) static void usage (void)
{ {
fprintf(stderr, "Usage: docproc {doc|depend} file\n"); fprintf(stderr, "Usage: docproc {doc|depend} file\n");
fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n"); fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n");
...@@ -84,7 +84,7 @@ void usage (void) ...@@ -84,7 +84,7 @@ void usage (void)
/* /*
* Execute kernel-doc with parameters given in svec * Execute kernel-doc with parameters given in svec
*/ */
void exec_kernel_doc(char **svec) static void exec_kernel_doc(char **svec)
{ {
pid_t pid; pid_t pid;
int ret; int ret;
...@@ -129,7 +129,7 @@ struct symfile ...@@ -129,7 +129,7 @@ struct symfile
struct symfile symfilelist[MAXFILES]; struct symfile symfilelist[MAXFILES];
int symfilecnt = 0; int symfilecnt = 0;
void add_new_symbol(struct symfile *sym, char * symname) static void add_new_symbol(struct symfile *sym, char * symname)
{ {
sym->symbollist = sym->symbollist =
realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *)); realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *));
...@@ -137,14 +137,14 @@ void add_new_symbol(struct symfile *sym, char * symname) ...@@ -137,14 +137,14 @@ void add_new_symbol(struct symfile *sym, char * symname)
} }
/* Add a filename to the list */ /* Add a filename to the list */
struct symfile * add_new_file(char * filename) static struct symfile * add_new_file(char * filename)
{ {
symfilelist[symfilecnt++].filename = strdup(filename); symfilelist[symfilecnt++].filename = strdup(filename);
return &symfilelist[symfilecnt - 1]; return &symfilelist[symfilecnt - 1];
} }
/* Check if file already are present in the list */ /* Check if file already are present in the list */
struct symfile * filename_exist(char * filename) static struct symfile * filename_exist(char * filename)
{ {
int i; int i;
for (i=0; i < symfilecnt; i++) for (i=0; i < symfilecnt; i++)
...@@ -157,20 +157,20 @@ struct symfile * filename_exist(char * filename) ...@@ -157,20 +157,20 @@ struct symfile * filename_exist(char * filename)
* List all files referenced within the template file. * List all files referenced within the template file.
* Files are separated by tabs. * Files are separated by tabs.
*/ */
void adddep(char * file) { printf("\t%s", file); } static void adddep(char * file) { printf("\t%s", file); }
void adddep2(char * file, char * line) { line = line; adddep(file); } static void adddep2(char * file, char * line) { line = line; adddep(file); }
void noaction(char * line) { line = line; } static void noaction(char * line) { line = line; }
void noaction2(char * file, char * line) { file = file; line = line; } static void noaction2(char * file, char * line) { file = file; line = line; }
/* Echo the line without further action */ /* Echo the line without further action */
void printline(char * line) { printf("%s", line); } static void printline(char * line) { printf("%s", line); }
/* /*
* Find all symbols in filename that are exported with EXPORT_SYMBOL & * Find all symbols in filename that are exported with EXPORT_SYMBOL &
* EXPORT_SYMBOL_GPL (& EXPORT_SYMBOL_GPL_FUTURE implicitly). * EXPORT_SYMBOL_GPL (& EXPORT_SYMBOL_GPL_FUTURE implicitly).
* All symbols located are stored in symfilelist. * All symbols located are stored in symfilelist.
*/ */
void find_export_symbols(char * filename) static void find_export_symbols(char * filename)
{ {
FILE * fp; FILE * fp;
struct symfile *sym; struct symfile *sym;
...@@ -227,7 +227,7 @@ void find_export_symbols(char * filename) ...@@ -227,7 +227,7 @@ void find_export_symbols(char * filename)
* intfunc uses -nofunction * intfunc uses -nofunction
* extfunc uses -function * extfunc uses -function
*/ */
void docfunctions(char * filename, char * type) static void docfunctions(char * filename, char * type)
{ {
int i,j; int i,j;
int symcnt = 0; int symcnt = 0;
...@@ -258,15 +258,15 @@ void docfunctions(char * filename, char * type) ...@@ -258,15 +258,15 @@ void docfunctions(char * filename, char * type)
fflush(stdout); fflush(stdout);
free(vec); free(vec);
} }
void intfunc(char * filename) { docfunctions(filename, NOFUNCTION); } static void intfunc(char * filename) { docfunctions(filename, NOFUNCTION); }
void extfunc(char * filename) { docfunctions(filename, FUNCTION); } static void extfunc(char * filename) { docfunctions(filename, FUNCTION); }
/* /*
* Document specific function(s) in a file. * Document specific function(s) in a file.
* Call kernel-doc with the following parameters: * Call kernel-doc with the following parameters:
* kernel-doc -docbook -function function1 [-function function2] * kernel-doc -docbook -function function1 [-function function2]
*/ */
void singfunc(char * filename, char * line) static void singfunc(char * filename, char * line)
{ {
char *vec[200]; /* Enough for specific functions */ char *vec[200]; /* Enough for specific functions */
int i, idx = 0; int i, idx = 0;
...@@ -297,7 +297,7 @@ void singfunc(char * filename, char * line) ...@@ -297,7 +297,7 @@ void singfunc(char * filename, char * line)
* Call kernel-doc with the following parameters: * Call kernel-doc with the following parameters:
* kernel-doc -docbook -function "doc section" filename * kernel-doc -docbook -function "doc section" filename
*/ */
void docsect(char *filename, char *line) static void docsect(char *filename, char *line)
{ {
char *vec[6]; /* kerneldoc -docbook -function "section" file NULL */ char *vec[6]; /* kerneldoc -docbook -function "section" file NULL */
char *s; char *s;
...@@ -324,7 +324,7 @@ void docsect(char *filename, char *line) ...@@ -324,7 +324,7 @@ void docsect(char *filename, char *line)
* 5) Lines containing !P * 5) Lines containing !P
* 6) Default lines - lines not matching the above * 6) Default lines - lines not matching the above
*/ */
void parse_file(FILE *infile) static void parse_file(FILE *infile)
{ {
char line[MAXLINESZ]; char line[MAXLINESZ];
char * s; char * s;
......
...@@ -125,7 +125,7 @@ char *target; ...@@ -125,7 +125,7 @@ char *target;
char *depfile; char *depfile;
char *cmdline; char *cmdline;
void usage(void) static void usage(void)
{ {
fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n"); fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n");
...@@ -135,7 +135,7 @@ void usage(void) ...@@ -135,7 +135,7 @@ void usage(void)
/* /*
* Print out the commandline prefixed with cmd_<target filename> := * Print out the commandline prefixed with cmd_<target filename> :=
*/ */
void print_cmdline(void) static void print_cmdline(void)
{ {
printf("cmd_%s := %s\n\n", target, cmdline); printf("cmd_%s := %s\n\n", target, cmdline);
} }
...@@ -148,7 +148,7 @@ int len_config = 0; ...@@ -148,7 +148,7 @@ int len_config = 0;
* Grow the configuration string to a desired length. * Grow the configuration string to a desired length.
* Usually the first growth is plenty. * Usually the first growth is plenty.
*/ */
void grow_config(int len) static void grow_config(int len)
{ {
while (len_config + len > size_config) { while (len_config + len > size_config) {
if (size_config == 0) if (size_config == 0)
...@@ -164,7 +164,7 @@ void grow_config(int len) ...@@ -164,7 +164,7 @@ void grow_config(int len)
/* /*
* Lookup a value in the configuration string. * Lookup a value in the configuration string.
*/ */
int is_defined_config(const char * name, int len) static int is_defined_config(const char * name, int len)
{ {
const char * pconfig; const char * pconfig;
const char * plast = str_config + len_config - len; const char * plast = str_config + len_config - len;
...@@ -180,7 +180,7 @@ int is_defined_config(const char * name, int len) ...@@ -180,7 +180,7 @@ int is_defined_config(const char * name, int len)
/* /*
* Add a new value to the configuration string. * Add a new value to the configuration string.
*/ */
void define_config(const char * name, int len) static void define_config(const char * name, int len)
{ {
grow_config(len + 1); grow_config(len + 1);
...@@ -192,7 +192,7 @@ void define_config(const char * name, int len) ...@@ -192,7 +192,7 @@ void define_config(const char * name, int len)
/* /*
* Clear the set of configuration strings. * Clear the set of configuration strings.
*/ */
void clear_config(void) static void clear_config(void)
{ {
len_config = 0; len_config = 0;
define_config("", 0); define_config("", 0);
...@@ -201,7 +201,7 @@ void clear_config(void) ...@@ -201,7 +201,7 @@ void clear_config(void)
/* /*
* Record the use of a CONFIG_* word. * Record the use of a CONFIG_* word.
*/ */
void use_config(char *m, int slen) static void use_config(char *m, int slen)
{ {
char s[PATH_MAX]; char s[PATH_MAX];
char *p; char *p;
...@@ -222,7 +222,7 @@ void use_config(char *m, int slen) ...@@ -222,7 +222,7 @@ void use_config(char *m, int slen)
printf(" $(wildcard include/config/%s.h) \\\n", s); printf(" $(wildcard include/config/%s.h) \\\n", s);
} }
void parse_config_file(char *map, size_t len) static void parse_config_file(char *map, size_t len)
{ {
int *end = (int *) (map + len); int *end = (int *) (map + len);
/* start at +1, so that p can never be < map */ /* start at +1, so that p can never be < map */
...@@ -256,7 +256,7 @@ void parse_config_file(char *map, size_t len) ...@@ -256,7 +256,7 @@ void parse_config_file(char *map, size_t len)
} }
/* test is s ends in sub */ /* test is s ends in sub */
int strrcmp(char *s, char *sub) static int strrcmp(char *s, char *sub)
{ {
int slen = strlen(s); int slen = strlen(s);
int sublen = strlen(sub); int sublen = strlen(sub);
...@@ -267,7 +267,7 @@ int strrcmp(char *s, char *sub) ...@@ -267,7 +267,7 @@ int strrcmp(char *s, char *sub)
return memcmp(s + slen - sublen, sub, sublen); return memcmp(s + slen - sublen, sub, sublen);
} }
void do_config_file(char *filename) static void do_config_file(char *filename)
{ {
struct stat st; struct stat st;
int fd; int fd;
...@@ -298,7 +298,7 @@ void do_config_file(char *filename) ...@@ -298,7 +298,7 @@ void do_config_file(char *filename)
close(fd); close(fd);
} }
void parse_dep_file(void *map, size_t len) static void parse_dep_file(void *map, size_t len)
{ {
char *m = map; char *m = map;
char *end = m + len; char *end = m + len;
...@@ -338,7 +338,7 @@ void parse_dep_file(void *map, size_t len) ...@@ -338,7 +338,7 @@ void parse_dep_file(void *map, size_t len)
printf("$(deps_%s):\n", target); printf("$(deps_%s):\n", target);
} }
void print_deps(void) static void print_deps(void)
{ {
struct stat st; struct stat st;
int fd; int fd;
...@@ -370,7 +370,7 @@ void print_deps(void) ...@@ -370,7 +370,7 @@ void print_deps(void)
close(fd); close(fd);
} }
void traps(void) static void traps(void)
{ {
static char test[] __attribute__((aligned(sizeof(int)))) = "CONF"; static char test[] __attribute__((aligned(sizeof(int)))) = "CONF";
int *p = (int *)test; int *p = (int *)test;
......
...@@ -21,7 +21,7 @@ static void usage(void) ...@@ -21,7 +21,7 @@ static void usage(void)
* http://www.cse.yorku.ca/~oz/hash.html * http://www.cse.yorku.ca/~oz/hash.html
*/ */
unsigned int djb2_hash(char *str) static unsigned int djb2_hash(char *str)
{ {
unsigned long hash = 5381; unsigned long hash = 5381;
int c; int c;
...@@ -34,7 +34,7 @@ unsigned int djb2_hash(char *str) ...@@ -34,7 +34,7 @@ unsigned int djb2_hash(char *str)
return (unsigned int)(hash & ((1 << DYNAMIC_DEBUG_HASH_BITS) - 1)); return (unsigned int)(hash & ((1 << DYNAMIC_DEBUG_HASH_BITS) - 1));
} }
unsigned int r5_hash(char *str) static unsigned int r5_hash(char *str)
{ {
unsigned long hash = 0; unsigned long hash = 0;
int c; int c;
......
...@@ -121,7 +121,7 @@ static int conf_askvalue(struct symbol *sym, const char *def) ...@@ -121,7 +121,7 @@ static int conf_askvalue(struct symbol *sym, const char *def)
return 1; return 1;
} }
int conf_string(struct menu *menu) static int conf_string(struct menu *menu)
{ {
struct symbol *sym = menu->sym; struct symbol *sym = menu->sym;
const char *def; const char *def;
......
...@@ -560,7 +560,7 @@ int conf_write(const char *name) ...@@ -560,7 +560,7 @@ int conf_write(const char *name)
return 0; return 0;
} }
int conf_split_config(void) static int conf_split_config(void)
{ {
const char *name; const char *name;
char path[128]; char path[128];
......
...@@ -348,7 +348,7 @@ struct expr *expr_trans_bool(struct expr *e) ...@@ -348,7 +348,7 @@ struct expr *expr_trans_bool(struct expr *e)
/* /*
* e1 || e2 -> ? * e1 || e2 -> ?
*/ */
struct expr *expr_join_or(struct expr *e1, struct expr *e2) static struct expr *expr_join_or(struct expr *e1, struct expr *e2)
{ {
struct expr *tmp; struct expr *tmp;
struct symbol *sym1, *sym2; struct symbol *sym1, *sym2;
...@@ -412,7 +412,7 @@ struct expr *expr_join_or(struct expr *e1, struct expr *e2) ...@@ -412,7 +412,7 @@ struct expr *expr_join_or(struct expr *e1, struct expr *e2)
return NULL; return NULL;
} }
struct expr *expr_join_and(struct expr *e1, struct expr *e2) static struct expr *expr_join_and(struct expr *e1, struct expr *e2)
{ {
struct expr *tmp; struct expr *tmp;
struct symbol *sym1, *sym2; struct symbol *sym1, *sym2;
......
...@@ -166,7 +166,7 @@ static int message__add(const char *msg, char *option, char *file, int lineno) ...@@ -166,7 +166,7 @@ static int message__add(const char *msg, char *option, char *file, int lineno)
return rc; return rc;
} }
void menu_build_message_list(struct menu *menu) static void menu_build_message_list(struct menu *menu)
{ {
struct menu *child; struct menu *child;
...@@ -211,7 +211,7 @@ static void message__print_gettext_msgid_msgstr(struct message *self) ...@@ -211,7 +211,7 @@ static void message__print_gettext_msgid_msgstr(struct message *self)
"msgstr \"\"\n", self->msg); "msgstr \"\"\n", self->msg);
} }
void menu__xgettext(void) static void menu__xgettext(void)
{ {
struct message *m = message__list; struct message *m = message__list;
......
...@@ -77,7 +77,7 @@ void menu_end_menu(void) ...@@ -77,7 +77,7 @@ void menu_end_menu(void)
current_menu = current_menu->parent; current_menu = current_menu->parent;
} }
struct expr *menu_check_dep(struct expr *e) static struct expr *menu_check_dep(struct expr *e)
{ {
if (!e) if (!e)
return e; return e;
...@@ -187,7 +187,7 @@ static int menu_range_valid_sym(struct symbol *sym, struct symbol *sym2) ...@@ -187,7 +187,7 @@ static int menu_range_valid_sym(struct symbol *sym, struct symbol *sym2)
(sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name)); (sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name));
} }
void sym_check_prop(struct symbol *sym) static void sym_check_prop(struct symbol *sym)
{ {
struct property *prop; struct property *prop;
struct symbol *sym2; struct symbol *sym2;
......
...@@ -36,7 +36,7 @@ tristate modules_val; ...@@ -36,7 +36,7 @@ tristate modules_val;
struct expr *sym_env_list; struct expr *sym_env_list;
void sym_add_default(struct symbol *sym, const char *def) static void sym_add_default(struct symbol *sym, const char *def)
{ {
struct property *prop = prop_alloc(P_DEFAULT, sym); struct property *prop = prop_alloc(P_DEFAULT, sym);
...@@ -125,7 +125,7 @@ struct property *sym_get_default_prop(struct symbol *sym) ...@@ -125,7 +125,7 @@ struct property *sym_get_default_prop(struct symbol *sym)
return NULL; return NULL;
} }
struct property *sym_get_range_prop(struct symbol *sym) static struct property *sym_get_range_prop(struct symbol *sym)
{ {
struct property *prop; struct property *prop;
...@@ -943,7 +943,7 @@ const char *prop_get_type_name(enum prop_type type) ...@@ -943,7 +943,7 @@ const char *prop_get_type_name(enum prop_type type)
return "unknown"; return "unknown";
} }
void prop_add_env(const char *env) static void prop_add_env(const char *env)
{ {
struct symbol *sym, *sym2; struct symbol *sym, *sym2;
struct property *prop; struct property *prop;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment