aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorTrevor Keith <tsrk@tsrk.net>2009-09-18 15:49:23 -0400
committerSam Ravnborg <sam@ravnborg.org>2009-09-20 06:27:44 -0400
commit4356f4890792a678936c93c9196e8f7742e04535 (patch)
tree6c64cbb77de98dfc45e4330632e6f8b27f50ef04 /scripts
parent66a570623be0d96130470a41cd38bce889b7e885 (diff)
kbuild: add static to prototypes
Warnings found via gcc -Wmissing-prototypes. Signed-off-by: Trevor Keith <tsrk@tsrk.net> Acked-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/basic/docproc.c34
-rw-r--r--scripts/basic/fixdep.c26
-rw-r--r--scripts/basic/hash.c4
-rw-r--r--scripts/kconfig/conf.c2
-rw-r--r--scripts/kconfig/confdata.c2
-rw-r--r--scripts/kconfig/expr.c4
-rw-r--r--scripts/kconfig/kxgettext.c4
-rw-r--r--scripts/kconfig/menu.c4
-rw-r--r--scripts/kconfig/symbol.c6
9 files changed, 43 insertions, 43 deletions
diff --git a/scripts/basic/docproc.c b/scripts/basic/docproc.c
index 99ca7a698687..79ab973fb43a 100644
--- a/scripts/basic/docproc.c
+++ b/scripts/basic/docproc.c
@@ -71,7 +71,7 @@ FILELINE * docsection;
71 71
72static char *srctree, *kernsrctree; 72static char *srctree, *kernsrctree;
73 73
74void usage (void) 74static void usage (void)
75{ 75{
76 fprintf(stderr, "Usage: docproc {doc|depend} file\n"); 76 fprintf(stderr, "Usage: docproc {doc|depend} file\n");
77 fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n"); 77 fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n");
@@ -84,7 +84,7 @@ void usage (void)
84/* 84/*
85 * Execute kernel-doc with parameters given in svec 85 * Execute kernel-doc with parameters given in svec
86 */ 86 */
87void exec_kernel_doc(char **svec) 87static void exec_kernel_doc(char **svec)
88{ 88{
89 pid_t pid; 89 pid_t pid;
90 int ret; 90 int ret;
@@ -129,7 +129,7 @@ struct symfile
129struct symfile symfilelist[MAXFILES]; 129struct symfile symfilelist[MAXFILES];
130int symfilecnt = 0; 130int symfilecnt = 0;
131 131
132void add_new_symbol(struct symfile *sym, char * symname) 132static void add_new_symbol(struct symfile *sym, char * symname)
133{ 133{
134 sym->symbollist = 134 sym->symbollist =
135 realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *)); 135 realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *));
@@ -137,14 +137,14 @@ void add_new_symbol(struct symfile *sym, char * symname)
137} 137}
138 138
139/* Add a filename to the list */ 139/* Add a filename to the list */
140struct symfile * add_new_file(char * filename) 140static struct symfile * add_new_file(char * filename)
141{ 141{
142 symfilelist[symfilecnt++].filename = strdup(filename); 142 symfilelist[symfilecnt++].filename = strdup(filename);
143 return &symfilelist[symfilecnt - 1]; 143 return &symfilelist[symfilecnt - 1];
144} 144}
145 145
146/* Check if file already are present in the list */ 146/* Check if file already are present in the list */
147struct symfile * filename_exist(char * filename) 147static struct symfile * filename_exist(char * filename)
148{ 148{
149 int i; 149 int i;
150 for (i=0; i < symfilecnt; i++) 150 for (i=0; i < symfilecnt; i++)
@@ -157,20 +157,20 @@ struct symfile * filename_exist(char * filename)
157 * List all files referenced within the template file. 157 * List all files referenced within the template file.
158 * Files are separated by tabs. 158 * Files are separated by tabs.
159 */ 159 */
160void adddep(char * file) { printf("\t%s", file); } 160static void adddep(char * file) { printf("\t%s", file); }
161void adddep2(char * file, char * line) { line = line; adddep(file); } 161static void adddep2(char * file, char * line) { line = line; adddep(file); }
162void noaction(char * line) { line = line; } 162static void noaction(char * line) { line = line; }
163void noaction2(char * file, char * line) { file = file; line = line; } 163static void noaction2(char * file, char * line) { file = file; line = line; }
164 164
165/* Echo the line without further action */ 165/* Echo the line without further action */
166void printline(char * line) { printf("%s", line); } 166static void printline(char * line) { printf("%s", line); }
167 167
168/* 168/*
169 * Find all symbols in filename that are exported with EXPORT_SYMBOL & 169 * Find all symbols in filename that are exported with EXPORT_SYMBOL &
170 * EXPORT_SYMBOL_GPL (& EXPORT_SYMBOL_GPL_FUTURE implicitly). 170 * EXPORT_SYMBOL_GPL (& EXPORT_SYMBOL_GPL_FUTURE implicitly).
171 * All symbols located are stored in symfilelist. 171 * All symbols located are stored in symfilelist.
172 */ 172 */
173void find_export_symbols(char * filename) 173static void find_export_symbols(char * filename)
174{ 174{
175 FILE * fp; 175 FILE * fp;
176 struct symfile *sym; 176 struct symfile *sym;
@@ -227,7 +227,7 @@ void find_export_symbols(char * filename)
227 * intfunc uses -nofunction 227 * intfunc uses -nofunction
228 * extfunc uses -function 228 * extfunc uses -function
229 */ 229 */
230void docfunctions(char * filename, char * type) 230static void docfunctions(char * filename, char * type)
231{ 231{
232 int i,j; 232 int i,j;
233 int symcnt = 0; 233 int symcnt = 0;
@@ -258,15 +258,15 @@ void docfunctions(char * filename, char * type)
258 fflush(stdout); 258 fflush(stdout);
259 free(vec); 259 free(vec);
260} 260}
261void intfunc(char * filename) { docfunctions(filename, NOFUNCTION); } 261static void intfunc(char * filename) { docfunctions(filename, NOFUNCTION); }
262void extfunc(char * filename) { docfunctions(filename, FUNCTION); } 262static void extfunc(char * filename) { docfunctions(filename, FUNCTION); }
263 263
264/* 264/*
265 * Document specific function(s) in a file. 265 * Document specific function(s) in a file.
266 * Call kernel-doc with the following parameters: 266 * Call kernel-doc with the following parameters:
267 * kernel-doc -docbook -function function1 [-function function2] 267 * kernel-doc -docbook -function function1 [-function function2]
268 */ 268 */
269void singfunc(char * filename, char * line) 269static void singfunc(char * filename, char * line)
270{ 270{
271 char *vec[200]; /* Enough for specific functions */ 271 char *vec[200]; /* Enough for specific functions */
272 int i, idx = 0; 272 int i, idx = 0;
@@ -297,7 +297,7 @@ void singfunc(char * filename, char * line)
297 * Call kernel-doc with the following parameters: 297 * Call kernel-doc with the following parameters:
298 * kernel-doc -docbook -function "doc section" filename 298 * kernel-doc -docbook -function "doc section" filename
299 */ 299 */
300void docsect(char *filename, char *line) 300static void docsect(char *filename, char *line)
301{ 301{
302 char *vec[6]; /* kerneldoc -docbook -function "section" file NULL */ 302 char *vec[6]; /* kerneldoc -docbook -function "section" file NULL */
303 char *s; 303 char *s;
@@ -324,7 +324,7 @@ void docsect(char *filename, char *line)
324 * 5) Lines containing !P 324 * 5) Lines containing !P
325 * 6) Default lines - lines not matching the above 325 * 6) Default lines - lines not matching the above
326 */ 326 */
327void parse_file(FILE *infile) 327static void parse_file(FILE *infile)
328{ 328{
329 char line[MAXLINESZ]; 329 char line[MAXLINESZ];
330 char * s; 330 char * s;
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index 72c15205bb2b..d7c1b04791f7 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -125,7 +125,7 @@ char *target;
125char *depfile; 125char *depfile;
126char *cmdline; 126char *cmdline;
127 127
128void usage(void) 128static void usage(void)
129 129
130{ 130{
131 fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n"); 131 fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n");
@@ -135,7 +135,7 @@ void usage(void)
135/* 135/*
136 * Print out the commandline prefixed with cmd_<target filename> := 136 * Print out the commandline prefixed with cmd_<target filename> :=
137 */ 137 */
138void print_cmdline(void) 138static void print_cmdline(void)
139{ 139{
140 printf("cmd_%s := %s\n\n", target, cmdline); 140 printf("cmd_%s := %s\n\n", target, cmdline);
141} 141}
@@ -148,7 +148,7 @@ int len_config = 0;
148 * Grow the configuration string to a desired length. 148 * Grow the configuration string to a desired length.
149 * Usually the first growth is plenty. 149 * Usually the first growth is plenty.
150 */ 150 */
151void grow_config(int len) 151static void grow_config(int len)
152{ 152{
153 while (len_config + len > size_config) { 153 while (len_config + len > size_config) {
154 if (size_config == 0) 154 if (size_config == 0)
@@ -164,7 +164,7 @@ void grow_config(int len)
164/* 164/*
165 * Lookup a value in the configuration string. 165 * Lookup a value in the configuration string.
166 */ 166 */
167int is_defined_config(const char * name, int len) 167static int is_defined_config(const char * name, int len)
168{ 168{
169 const char * pconfig; 169 const char * pconfig;
170 const char * plast = str_config + len_config - len; 170 const char * plast = str_config + len_config - len;
@@ -180,7 +180,7 @@ int is_defined_config(const char * name, int len)
180/* 180/*
181 * Add a new value to the configuration string. 181 * Add a new value to the configuration string.
182 */ 182 */
183void define_config(const char * name, int len) 183static void define_config(const char * name, int len)
184{ 184{
185 grow_config(len + 1); 185 grow_config(len + 1);
186 186
@@ -192,7 +192,7 @@ void define_config(const char * name, int len)
192/* 192/*
193 * Clear the set of configuration strings. 193 * Clear the set of configuration strings.
194 */ 194 */
195void clear_config(void) 195static void clear_config(void)
196{ 196{
197 len_config = 0; 197 len_config = 0;
198 define_config("", 0); 198 define_config("", 0);
@@ -201,7 +201,7 @@ void clear_config(void)
201/* 201/*
202 * Record the use of a CONFIG_* word. 202 * Record the use of a CONFIG_* word.
203 */ 203 */
204void use_config(char *m, int slen) 204static void use_config(char *m, int slen)
205{ 205{
206 char s[PATH_MAX]; 206 char s[PATH_MAX];
207 char *p; 207 char *p;
@@ -222,7 +222,7 @@ void use_config(char *m, int slen)
222 printf(" $(wildcard include/config/%s.h) \\\n", s); 222 printf(" $(wildcard include/config/%s.h) \\\n", s);
223} 223}
224 224
225void parse_config_file(char *map, size_t len) 225static void parse_config_file(char *map, size_t len)
226{ 226{
227 int *end = (int *) (map + len); 227 int *end = (int *) (map + len);
228 /* start at +1, so that p can never be < map */ 228 /* start at +1, so that p can never be < map */
@@ -256,7 +256,7 @@ void parse_config_file(char *map, size_t len)
256} 256}
257 257
258/* test is s ends in sub */ 258/* test is s ends in sub */
259int strrcmp(char *s, char *sub) 259static int strrcmp(char *s, char *sub)
260{ 260{
261 int slen = strlen(s); 261 int slen = strlen(s);
262 int sublen = strlen(sub); 262 int sublen = strlen(sub);
@@ -267,7 +267,7 @@ int strrcmp(char *s, char *sub)
267 return memcmp(s + slen - sublen, sub, sublen); 267 return memcmp(s + slen - sublen, sub, sublen);
268} 268}
269 269
270void do_config_file(char *filename) 270static void do_config_file(char *filename)
271{ 271{
272 struct stat st; 272 struct stat st;
273 int fd; 273 int fd;
@@ -298,7 +298,7 @@ void do_config_file(char *filename)
298 close(fd); 298 close(fd);
299} 299}
300 300
301void parse_dep_file(void *map, size_t len) 301static void parse_dep_file(void *map, size_t len)
302{ 302{
303 char *m = map; 303 char *m = map;
304 char *end = m + len; 304 char *end = m + len;
@@ -338,7 +338,7 @@ void parse_dep_file(void *map, size_t len)
338 printf("$(deps_%s):\n", target); 338 printf("$(deps_%s):\n", target);
339} 339}
340 340
341void print_deps(void) 341static void print_deps(void)
342{ 342{
343 struct stat st; 343 struct stat st;
344 int fd; 344 int fd;
@@ -370,7 +370,7 @@ void print_deps(void)
370 close(fd); 370 close(fd);
371} 371}
372 372
373void traps(void) 373static void traps(void)
374{ 374{
375 static char test[] __attribute__((aligned(sizeof(int)))) = "CONF"; 375 static char test[] __attribute__((aligned(sizeof(int)))) = "CONF";
376 int *p = (int *)test; 376 int *p = (int *)test;
diff --git a/scripts/basic/hash.c b/scripts/basic/hash.c
index 3299ad7fc8c0..2ef5d3f666b8 100644
--- a/scripts/basic/hash.c
+++ b/scripts/basic/hash.c
@@ -21,7 +21,7 @@ static void usage(void)
21 * http://www.cse.yorku.ca/~oz/hash.html 21 * http://www.cse.yorku.ca/~oz/hash.html
22 */ 22 */
23 23
24unsigned int djb2_hash(char *str) 24static unsigned int djb2_hash(char *str)
25{ 25{
26 unsigned long hash = 5381; 26 unsigned long hash = 5381;
27 int c; 27 int c;
@@ -34,7 +34,7 @@ unsigned int djb2_hash(char *str)
34 return (unsigned int)(hash & ((1 << DYNAMIC_DEBUG_HASH_BITS) - 1)); 34 return (unsigned int)(hash & ((1 << DYNAMIC_DEBUG_HASH_BITS) - 1));
35} 35}
36 36
37unsigned int r5_hash(char *str) 37static unsigned int r5_hash(char *str)
38{ 38{
39 unsigned long hash = 0; 39 unsigned long hash = 0;
40 int c; 40 int c;
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 5de3303e65f5..9960d1c303f8 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -121,7 +121,7 @@ static int conf_askvalue(struct symbol *sym, const char *def)
121 return 1; 121 return 1;
122} 122}
123 123
124int conf_string(struct menu *menu) 124static int conf_string(struct menu *menu)
125{ 125{
126 struct symbol *sym = menu->sym; 126 struct symbol *sym = menu->sym;
127 const char *def; 127 const char *def;
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index a04da3459f0f..b55e72ff2fc6 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -560,7 +560,7 @@ int conf_write(const char *name)
560 return 0; 560 return 0;
561} 561}
562 562
563int conf_split_config(void) 563static int conf_split_config(void)
564{ 564{
565 const char *name; 565 const char *name;
566 char path[128]; 566 char path[128];
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
index cd8a2f00a97e..edd3f39a080a 100644
--- a/scripts/kconfig/expr.c
+++ b/scripts/kconfig/expr.c
@@ -348,7 +348,7 @@ struct expr *expr_trans_bool(struct expr *e)
348/* 348/*
349 * e1 || e2 -> ? 349 * e1 || e2 -> ?
350 */ 350 */
351struct expr *expr_join_or(struct expr *e1, struct expr *e2) 351static struct expr *expr_join_or(struct expr *e1, struct expr *e2)
352{ 352{
353 struct expr *tmp; 353 struct expr *tmp;
354 struct symbol *sym1, *sym2; 354 struct symbol *sym1, *sym2;
@@ -412,7 +412,7 @@ struct expr *expr_join_or(struct expr *e1, struct expr *e2)
412 return NULL; 412 return NULL;
413} 413}
414 414
415struct expr *expr_join_and(struct expr *e1, struct expr *e2) 415static struct expr *expr_join_and(struct expr *e1, struct expr *e2)
416{ 416{
417 struct expr *tmp; 417 struct expr *tmp;
418 struct symbol *sym1, *sym2; 418 struct symbol *sym1, *sym2;
diff --git a/scripts/kconfig/kxgettext.c b/scripts/kconfig/kxgettext.c
index 8d9ce22b0fc5..dcc3fcc0cc9a 100644
--- a/scripts/kconfig/kxgettext.c
+++ b/scripts/kconfig/kxgettext.c
@@ -166,7 +166,7 @@ static int message__add(const char *msg, char *option, char *file, int lineno)
166 return rc; 166 return rc;
167} 167}
168 168
169void menu_build_message_list(struct menu *menu) 169static void menu_build_message_list(struct menu *menu)
170{ 170{
171 struct menu *child; 171 struct menu *child;
172 172
@@ -211,7 +211,7 @@ static void message__print_gettext_msgid_msgstr(struct message *self)
211 "msgstr \"\"\n", self->msg); 211 "msgstr \"\"\n", self->msg);
212} 212}
213 213
214void menu__xgettext(void) 214static void menu__xgettext(void)
215{ 215{
216 struct message *m = message__list; 216 struct message *m = message__list;
217 217
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index b74f74687005..059a2465c574 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -77,7 +77,7 @@ void menu_end_menu(void)
77 current_menu = current_menu->parent; 77 current_menu = current_menu->parent;
78} 78}
79 79
80struct expr *menu_check_dep(struct expr *e) 80static struct expr *menu_check_dep(struct expr *e)
81{ 81{
82 if (!e) 82 if (!e)
83 return e; 83 return e;
@@ -187,7 +187,7 @@ static int menu_range_valid_sym(struct symbol *sym, struct symbol *sym2)
187 (sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name)); 187 (sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name));
188} 188}
189 189
190void sym_check_prop(struct symbol *sym) 190static void sym_check_prop(struct symbol *sym)
191{ 191{
192 struct property *prop; 192 struct property *prop;
193 struct symbol *sym2; 193 struct symbol *sym2;
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 18f3e5c33634..6c8fbbb66ebc 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -36,7 +36,7 @@ tristate modules_val;
36 36
37struct expr *sym_env_list; 37struct expr *sym_env_list;
38 38
39void sym_add_default(struct symbol *sym, const char *def) 39static void sym_add_default(struct symbol *sym, const char *def)
40{ 40{
41 struct property *prop = prop_alloc(P_DEFAULT, sym); 41 struct property *prop = prop_alloc(P_DEFAULT, sym);
42 42
@@ -125,7 +125,7 @@ struct property *sym_get_default_prop(struct symbol *sym)
125 return NULL; 125 return NULL;
126} 126}
127 127
128struct property *sym_get_range_prop(struct symbol *sym) 128static struct property *sym_get_range_prop(struct symbol *sym)
129{ 129{
130 struct property *prop; 130 struct property *prop;
131 131
@@ -943,7 +943,7 @@ const char *prop_get_type_name(enum prop_type type)
943 return "unknown"; 943 return "unknown";
944} 944}
945 945
946void prop_add_env(const char *env) 946static void prop_add_env(const char *env)
947{ 947{
948 struct symbol *sym, *sym2; 948 struct symbol *sym, *sym2;
949 struct property *prop; 949 struct property *prop;