Skip to content

Commit 4356f48

Browse files
Trevor Keithsravnborg
authored andcommitted
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>
1 parent 66a5706 commit 4356f48

File tree

9 files changed

+43
-43
lines changed

9 files changed

+43
-43
lines changed

scripts/basic/docproc.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ FILELINE * docsection;
7171

7272
static char *srctree, *kernsrctree;
7373

74-
void usage (void)
74+
static void usage (void)
7575
{
7676
fprintf(stderr, "Usage: docproc {doc|depend} file\n");
7777
fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n");
@@ -84,7 +84,7 @@ void usage (void)
8484
/*
8585
* Execute kernel-doc with parameters given in svec
8686
*/
87-
void exec_kernel_doc(char **svec)
87+
static void exec_kernel_doc(char **svec)
8888
{
8989
pid_t pid;
9090
int ret;
@@ -129,22 +129,22 @@ struct symfile
129129
struct symfile symfilelist[MAXFILES];
130130
int symfilecnt = 0;
131131

132-
void add_new_symbol(struct symfile *sym, char * symname)
132+
static void add_new_symbol(struct symfile *sym, char * symname)
133133
{
134134
sym->symbollist =
135135
realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *));
136136
sym->symbollist[sym->symbolcnt++].name = strdup(symname);
137137
}
138138

139139
/* Add a filename to the list */
140-
struct symfile * add_new_file(char * filename)
140+
static struct symfile * add_new_file(char * filename)
141141
{
142142
symfilelist[symfilecnt++].filename = strdup(filename);
143143
return &symfilelist[symfilecnt - 1];
144144
}
145145

146146
/* Check if file already are present in the list */
147-
struct symfile * filename_exist(char * filename)
147+
static struct symfile * filename_exist(char * filename)
148148
{
149149
int i;
150150
for (i=0; i < symfilecnt; i++)
@@ -157,20 +157,20 @@ struct symfile * filename_exist(char * filename)
157157
* List all files referenced within the template file.
158158
* Files are separated by tabs.
159159
*/
160-
void adddep(char * file) { printf("\t%s", file); }
161-
void adddep2(char * file, char * line) { line = line; adddep(file); }
162-
void noaction(char * line) { line = line; }
163-
void noaction2(char * file, char * line) { file = file; line = line; }
160+
static void adddep(char * file) { printf("\t%s", file); }
161+
static void adddep2(char * file, char * line) { line = line; adddep(file); }
162+
static void noaction(char * line) { line = line; }
163+
static void noaction2(char * file, char * line) { file = file; line = line; }
164164

165165
/* Echo the line without further action */
166-
void printline(char * line) { printf("%s", line); }
166+
static void printline(char * line) { printf("%s", line); }
167167

168168
/*
169169
* Find all symbols in filename that are exported with EXPORT_SYMBOL &
170170
* EXPORT_SYMBOL_GPL (& EXPORT_SYMBOL_GPL_FUTURE implicitly).
171171
* All symbols located are stored in symfilelist.
172172
*/
173-
void find_export_symbols(char * filename)
173+
static void find_export_symbols(char * filename)
174174
{
175175
FILE * fp;
176176
struct symfile *sym;
@@ -227,7 +227,7 @@ void find_export_symbols(char * filename)
227227
* intfunc uses -nofunction
228228
* extfunc uses -function
229229
*/
230-
void docfunctions(char * filename, char * type)
230+
static void docfunctions(char * filename, char * type)
231231
{
232232
int i,j;
233233
int symcnt = 0;
@@ -258,15 +258,15 @@ void docfunctions(char * filename, char * type)
258258
fflush(stdout);
259259
free(vec);
260260
}
261-
void intfunc(char * filename) { docfunctions(filename, NOFUNCTION); }
262-
void extfunc(char * filename) { docfunctions(filename, FUNCTION); }
261+
static void intfunc(char * filename) { docfunctions(filename, NOFUNCTION); }
262+
static void extfunc(char * filename) { docfunctions(filename, FUNCTION); }
263263

264264
/*
265265
* Document specific function(s) in a file.
266266
* Call kernel-doc with the following parameters:
267267
* kernel-doc -docbook -function function1 [-function function2]
268268
*/
269-
void singfunc(char * filename, char * line)
269+
static void singfunc(char * filename, char * line)
270270
{
271271
char *vec[200]; /* Enough for specific functions */
272272
int i, idx = 0;
@@ -297,7 +297,7 @@ void singfunc(char * filename, char * line)
297297
* Call kernel-doc with the following parameters:
298298
* kernel-doc -docbook -function "doc section" filename
299299
*/
300-
void docsect(char *filename, char *line)
300+
static void docsect(char *filename, char *line)
301301
{
302302
char *vec[6]; /* kerneldoc -docbook -function "section" file NULL */
303303
char *s;
@@ -324,7 +324,7 @@ void docsect(char *filename, char *line)
324324
* 5) Lines containing !P
325325
* 6) Default lines - lines not matching the above
326326
*/
327-
void parse_file(FILE *infile)
327+
static void parse_file(FILE *infile)
328328
{
329329
char line[MAXLINESZ];
330330
char * s;

scripts/basic/fixdep.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ char *target;
125125
char *depfile;
126126
char *cmdline;
127127

128-
void usage(void)
128+
static void usage(void)
129129

130130
{
131131
fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n");
@@ -135,7 +135,7 @@ void usage(void)
135135
/*
136136
* Print out the commandline prefixed with cmd_<target filename> :=
137137
*/
138-
void print_cmdline(void)
138+
static void print_cmdline(void)
139139
{
140140
printf("cmd_%s := %s\n\n", target, cmdline);
141141
}
@@ -148,7 +148,7 @@ int len_config = 0;
148148
* Grow the configuration string to a desired length.
149149
* Usually the first growth is plenty.
150150
*/
151-
void grow_config(int len)
151+
static void grow_config(int len)
152152
{
153153
while (len_config + len > size_config) {
154154
if (size_config == 0)
@@ -164,7 +164,7 @@ void grow_config(int len)
164164
/*
165165
* Lookup a value in the configuration string.
166166
*/
167-
int is_defined_config(const char * name, int len)
167+
static int is_defined_config(const char * name, int len)
168168
{
169169
const char * pconfig;
170170
const char * plast = str_config + len_config - len;
@@ -180,7 +180,7 @@ int is_defined_config(const char * name, int len)
180180
/*
181181
* Add a new value to the configuration string.
182182
*/
183-
void define_config(const char * name, int len)
183+
static void define_config(const char * name, int len)
184184
{
185185
grow_config(len + 1);
186186

@@ -192,7 +192,7 @@ void define_config(const char * name, int len)
192192
/*
193193
* Clear the set of configuration strings.
194194
*/
195-
void clear_config(void)
195+
static void clear_config(void)
196196
{
197197
len_config = 0;
198198
define_config("", 0);
@@ -201,7 +201,7 @@ void clear_config(void)
201201
/*
202202
* Record the use of a CONFIG_* word.
203203
*/
204-
void use_config(char *m, int slen)
204+
static void use_config(char *m, int slen)
205205
{
206206
char s[PATH_MAX];
207207
char *p;
@@ -222,7 +222,7 @@ void use_config(char *m, int slen)
222222
printf(" $(wildcard include/config/%s.h) \\\n", s);
223223
}
224224

225-
void parse_config_file(char *map, size_t len)
225+
static void parse_config_file(char *map, size_t len)
226226
{
227227
int *end = (int *) (map + len);
228228
/* start at +1, so that p can never be < map */
@@ -256,7 +256,7 @@ void parse_config_file(char *map, size_t len)
256256
}
257257

258258
/* test is s ends in sub */
259-
int strrcmp(char *s, char *sub)
259+
static int strrcmp(char *s, char *sub)
260260
{
261261
int slen = strlen(s);
262262
int sublen = strlen(sub);
@@ -267,7 +267,7 @@ int strrcmp(char *s, char *sub)
267267
return memcmp(s + slen - sublen, sub, sublen);
268268
}
269269

270-
void do_config_file(char *filename)
270+
static void do_config_file(char *filename)
271271
{
272272
struct stat st;
273273
int fd;
@@ -298,7 +298,7 @@ void do_config_file(char *filename)
298298
close(fd);
299299
}
300300

301-
void parse_dep_file(void *map, size_t len)
301+
static void parse_dep_file(void *map, size_t len)
302302
{
303303
char *m = map;
304304
char *end = m + len;
@@ -338,7 +338,7 @@ void parse_dep_file(void *map, size_t len)
338338
printf("$(deps_%s):\n", target);
339339
}
340340

341-
void print_deps(void)
341+
static void print_deps(void)
342342
{
343343
struct stat st;
344344
int fd;
@@ -370,7 +370,7 @@ void print_deps(void)
370370
close(fd);
371371
}
372372

373-
void traps(void)
373+
static void traps(void)
374374
{
375375
static char test[] __attribute__((aligned(sizeof(int)))) = "CONF";
376376
int *p = (int *)test;

scripts/basic/hash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static void usage(void)
2121
* http://www.cse.yorku.ca/~oz/hash.html
2222
*/
2323

24-
unsigned int djb2_hash(char *str)
24+
static unsigned int djb2_hash(char *str)
2525
{
2626
unsigned long hash = 5381;
2727
int c;
@@ -34,7 +34,7 @@ unsigned int djb2_hash(char *str)
3434
return (unsigned int)(hash & ((1 << DYNAMIC_DEBUG_HASH_BITS) - 1));
3535
}
3636

37-
unsigned int r5_hash(char *str)
37+
static unsigned int r5_hash(char *str)
3838
{
3939
unsigned long hash = 0;
4040
int c;

scripts/kconfig/conf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static int conf_askvalue(struct symbol *sym, const char *def)
121121
return 1;
122122
}
123123

124-
int conf_string(struct menu *menu)
124+
static int conf_string(struct menu *menu)
125125
{
126126
struct symbol *sym = menu->sym;
127127
const char *def;

scripts/kconfig/confdata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ int conf_write(const char *name)
560560
return 0;
561561
}
562562

563-
int conf_split_config(void)
563+
static int conf_split_config(void)
564564
{
565565
const char *name;
566566
char path[128];

scripts/kconfig/expr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ struct expr *expr_trans_bool(struct expr *e)
348348
/*
349349
* e1 || e2 -> ?
350350
*/
351-
struct expr *expr_join_or(struct expr *e1, struct expr *e2)
351+
static struct expr *expr_join_or(struct expr *e1, struct expr *e2)
352352
{
353353
struct expr *tmp;
354354
struct symbol *sym1, *sym2;
@@ -412,7 +412,7 @@ struct expr *expr_join_or(struct expr *e1, struct expr *e2)
412412
return NULL;
413413
}
414414

415-
struct expr *expr_join_and(struct expr *e1, struct expr *e2)
415+
static struct expr *expr_join_and(struct expr *e1, struct expr *e2)
416416
{
417417
struct expr *tmp;
418418
struct symbol *sym1, *sym2;

scripts/kconfig/kxgettext.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static int message__add(const char *msg, char *option, char *file, int lineno)
166166
return rc;
167167
}
168168

169-
void menu_build_message_list(struct menu *menu)
169+
static void menu_build_message_list(struct menu *menu)
170170
{
171171
struct menu *child;
172172

@@ -211,7 +211,7 @@ static void message__print_gettext_msgid_msgstr(struct message *self)
211211
"msgstr \"\"\n", self->msg);
212212
}
213213

214-
void menu__xgettext(void)
214+
static void menu__xgettext(void)
215215
{
216216
struct message *m = message__list;
217217

scripts/kconfig/menu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void menu_end_menu(void)
7777
current_menu = current_menu->parent;
7878
}
7979

80-
struct expr *menu_check_dep(struct expr *e)
80+
static struct expr *menu_check_dep(struct expr *e)
8181
{
8282
if (!e)
8383
return e;
@@ -187,7 +187,7 @@ static int menu_range_valid_sym(struct symbol *sym, struct symbol *sym2)
187187
(sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name));
188188
}
189189

190-
void sym_check_prop(struct symbol *sym)
190+
static void sym_check_prop(struct symbol *sym)
191191
{
192192
struct property *prop;
193193
struct symbol *sym2;

scripts/kconfig/symbol.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ tristate modules_val;
3636

3737
struct expr *sym_env_list;
3838

39-
void sym_add_default(struct symbol *sym, const char *def)
39+
static void sym_add_default(struct symbol *sym, const char *def)
4040
{
4141
struct property *prop = prop_alloc(P_DEFAULT, sym);
4242

@@ -125,7 +125,7 @@ struct property *sym_get_default_prop(struct symbol *sym)
125125
return NULL;
126126
}
127127

128-
struct property *sym_get_range_prop(struct symbol *sym)
128+
static struct property *sym_get_range_prop(struct symbol *sym)
129129
{
130130
struct property *prop;
131131

@@ -943,7 +943,7 @@ const char *prop_get_type_name(enum prop_type type)
943943
return "unknown";
944944
}
945945

946-
void prop_add_env(const char *env)
946+
static void prop_add_env(const char *env)
947947
{
948948
struct symbol *sym, *sym2;
949949
struct property *prop;

0 commit comments

Comments
 (0)