Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Trevor Keith and committed by
Sam Ravnborg
4356f489 66a57062

+43 -43
+17 -17
scripts/basic/docproc.c
··· 71 71 72 72 static char *srctree, *kernsrctree; 73 73 74 - void usage (void) 74 + static void usage (void) 75 75 { 76 76 fprintf(stderr, "Usage: docproc {doc|depend} file\n"); 77 77 fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n"); ··· 84 84 /* 85 85 * Execute kernel-doc with parameters given in svec 86 86 */ 87 - void exec_kernel_doc(char **svec) 87 + static void exec_kernel_doc(char **svec) 88 88 { 89 89 pid_t pid; 90 90 int ret; ··· 129 129 struct symfile symfilelist[MAXFILES]; 130 130 int symfilecnt = 0; 131 131 132 - void add_new_symbol(struct symfile *sym, char * symname) 132 + static void add_new_symbol(struct symfile *sym, char * symname) 133 133 { 134 134 sym->symbollist = 135 135 realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *)); ··· 137 137 } 138 138 139 139 /* Add a filename to the list */ 140 - struct symfile * add_new_file(char * filename) 140 + static struct symfile * add_new_file(char * filename) 141 141 { 142 142 symfilelist[symfilecnt++].filename = strdup(filename); 143 143 return &symfilelist[symfilecnt - 1]; 144 144 } 145 145 146 146 /* Check if file already are present in the list */ 147 - struct symfile * filename_exist(char * filename) 147 + static struct symfile * filename_exist(char * filename) 148 148 { 149 149 int i; 150 150 for (i=0; i < symfilecnt; i++) ··· 157 157 * List all files referenced within the template file. 158 158 * Files are separated by tabs. 159 159 */ 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; } 164 164 165 165 /* Echo the line without further action */ 166 - void printline(char * line) { printf("%s", line); } 166 + static void printline(char * line) { printf("%s", line); } 167 167 168 168 /* 169 169 * Find all symbols in filename that are exported with EXPORT_SYMBOL & 170 170 * EXPORT_SYMBOL_GPL (& EXPORT_SYMBOL_GPL_FUTURE implicitly). 171 171 * All symbols located are stored in symfilelist. 172 172 */ 173 - void find_export_symbols(char * filename) 173 + static void find_export_symbols(char * filename) 174 174 { 175 175 FILE * fp; 176 176 struct symfile *sym; ··· 227 227 * intfunc uses -nofunction 228 228 * extfunc uses -function 229 229 */ 230 - void docfunctions(char * filename, char * type) 230 + static void docfunctions(char * filename, char * type) 231 231 { 232 232 int i,j; 233 233 int symcnt = 0; ··· 258 258 fflush(stdout); 259 259 free(vec); 260 260 } 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); } 263 263 264 264 /* 265 265 * Document specific function(s) in a file. 266 266 * Call kernel-doc with the following parameters: 267 267 * kernel-doc -docbook -function function1 [-function function2] 268 268 */ 269 - void singfunc(char * filename, char * line) 269 + static void singfunc(char * filename, char * line) 270 270 { 271 271 char *vec[200]; /* Enough for specific functions */ 272 272 int i, idx = 0; ··· 297 297 * Call kernel-doc with the following parameters: 298 298 * kernel-doc -docbook -function "doc section" filename 299 299 */ 300 - void docsect(char *filename, char *line) 300 + static void docsect(char *filename, char *line) 301 301 { 302 302 char *vec[6]; /* kerneldoc -docbook -function "section" file NULL */ 303 303 char *s; ··· 324 324 * 5) Lines containing !P 325 325 * 6) Default lines - lines not matching the above 326 326 */ 327 - void parse_file(FILE *infile) 327 + static void parse_file(FILE *infile) 328 328 { 329 329 char line[MAXLINESZ]; 330 330 char * s;
+13 -13
scripts/basic/fixdep.c
··· 125 125 char *depfile; 126 126 char *cmdline; 127 127 128 - void usage(void) 128 + static void usage(void) 129 129 130 130 { 131 131 fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n"); ··· 135 135 /* 136 136 * Print out the commandline prefixed with cmd_<target filename> := 137 137 */ 138 - void print_cmdline(void) 138 + static void print_cmdline(void) 139 139 { 140 140 printf("cmd_%s := %s\n\n", target, cmdline); 141 141 } ··· 148 148 * Grow the configuration string to a desired length. 149 149 * Usually the first growth is plenty. 150 150 */ 151 - void grow_config(int len) 151 + static void grow_config(int len) 152 152 { 153 153 while (len_config + len > size_config) { 154 154 if (size_config == 0) ··· 164 164 /* 165 165 * Lookup a value in the configuration string. 166 166 */ 167 - int is_defined_config(const char * name, int len) 167 + static int is_defined_config(const char * name, int len) 168 168 { 169 169 const char * pconfig; 170 170 const char * plast = str_config + len_config - len; ··· 180 180 /* 181 181 * Add a new value to the configuration string. 182 182 */ 183 - void define_config(const char * name, int len) 183 + static void define_config(const char * name, int len) 184 184 { 185 185 grow_config(len + 1); 186 186 ··· 192 192 /* 193 193 * Clear the set of configuration strings. 194 194 */ 195 - void clear_config(void) 195 + static void clear_config(void) 196 196 { 197 197 len_config = 0; 198 198 define_config("", 0); ··· 201 201 /* 202 202 * Record the use of a CONFIG_* word. 203 203 */ 204 - void use_config(char *m, int slen) 204 + static void use_config(char *m, int slen) 205 205 { 206 206 char s[PATH_MAX]; 207 207 char *p; ··· 222 222 printf(" $(wildcard include/config/%s.h) \\\n", s); 223 223 } 224 224 225 - void parse_config_file(char *map, size_t len) 225 + static void parse_config_file(char *map, size_t len) 226 226 { 227 227 int *end = (int *) (map + len); 228 228 /* start at +1, so that p can never be < map */ ··· 256 256 } 257 257 258 258 /* test is s ends in sub */ 259 - int strrcmp(char *s, char *sub) 259 + static int strrcmp(char *s, char *sub) 260 260 { 261 261 int slen = strlen(s); 262 262 int sublen = strlen(sub); ··· 267 267 return memcmp(s + slen - sublen, sub, sublen); 268 268 } 269 269 270 - void do_config_file(char *filename) 270 + static void do_config_file(char *filename) 271 271 { 272 272 struct stat st; 273 273 int fd; ··· 298 298 close(fd); 299 299 } 300 300 301 - void parse_dep_file(void *map, size_t len) 301 + static void parse_dep_file(void *map, size_t len) 302 302 { 303 303 char *m = map; 304 304 char *end = m + len; ··· 338 338 printf("$(deps_%s):\n", target); 339 339 } 340 340 341 - void print_deps(void) 341 + static void print_deps(void) 342 342 { 343 343 struct stat st; 344 344 int fd; ··· 370 370 close(fd); 371 371 } 372 372 373 - void traps(void) 373 + static void traps(void) 374 374 { 375 375 static char test[] __attribute__((aligned(sizeof(int)))) = "CONF"; 376 376 int *p = (int *)test;
+2 -2
scripts/basic/hash.c
··· 21 21 * http://www.cse.yorku.ca/~oz/hash.html 22 22 */ 23 23 24 - unsigned int djb2_hash(char *str) 24 + static unsigned int djb2_hash(char *str) 25 25 { 26 26 unsigned long hash = 5381; 27 27 int c; ··· 34 34 return (unsigned int)(hash & ((1 << DYNAMIC_DEBUG_HASH_BITS) - 1)); 35 35 } 36 36 37 - unsigned int r5_hash(char *str) 37 + static unsigned int r5_hash(char *str) 38 38 { 39 39 unsigned long hash = 0; 40 40 int c;
+1 -1
scripts/kconfig/conf.c
··· 121 121 return 1; 122 122 } 123 123 124 - int conf_string(struct menu *menu) 124 + static int conf_string(struct menu *menu) 125 125 { 126 126 struct symbol *sym = menu->sym; 127 127 const char *def;
+1 -1
scripts/kconfig/confdata.c
··· 560 560 return 0; 561 561 } 562 562 563 - int conf_split_config(void) 563 + static int conf_split_config(void) 564 564 { 565 565 const char *name; 566 566 char path[128];
+2 -2
scripts/kconfig/expr.c
··· 348 348 /* 349 349 * e1 || e2 -> ? 350 350 */ 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) 352 352 { 353 353 struct expr *tmp; 354 354 struct symbol *sym1, *sym2; ··· 412 412 return NULL; 413 413 } 414 414 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) 416 416 { 417 417 struct expr *tmp; 418 418 struct symbol *sym1, *sym2;
+2 -2
scripts/kconfig/kxgettext.c
··· 166 166 return rc; 167 167 } 168 168 169 - void menu_build_message_list(struct menu *menu) 169 + static void menu_build_message_list(struct menu *menu) 170 170 { 171 171 struct menu *child; 172 172 ··· 211 211 "msgstr \"\"\n", self->msg); 212 212 } 213 213 214 - void menu__xgettext(void) 214 + static void menu__xgettext(void) 215 215 { 216 216 struct message *m = message__list; 217 217
+2 -2
scripts/kconfig/menu.c
··· 77 77 current_menu = current_menu->parent; 78 78 } 79 79 80 - struct expr *menu_check_dep(struct expr *e) 80 + static struct expr *menu_check_dep(struct expr *e) 81 81 { 82 82 if (!e) 83 83 return e; ··· 187 187 (sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name)); 188 188 } 189 189 190 - void sym_check_prop(struct symbol *sym) 190 + static void sym_check_prop(struct symbol *sym) 191 191 { 192 192 struct property *prop; 193 193 struct symbol *sym2;
+3 -3
scripts/kconfig/symbol.c
··· 36 36 37 37 struct expr *sym_env_list; 38 38 39 - void sym_add_default(struct symbol *sym, const char *def) 39 + static void sym_add_default(struct symbol *sym, const char *def) 40 40 { 41 41 struct property *prop = prop_alloc(P_DEFAULT, sym); 42 42 ··· 125 125 return NULL; 126 126 } 127 127 128 - struct property *sym_get_range_prop(struct symbol *sym) 128 + static struct property *sym_get_range_prop(struct symbol *sym) 129 129 { 130 130 struct property *prop; 131 131 ··· 943 943 return "unknown"; 944 944 } 945 945 946 - void prop_add_env(const char *env) 946 + static void prop_add_env(const char *env) 947 947 { 948 948 struct symbol *sym, *sym2; 949 949 struct property *prop;