diff options
author | Ladinu Chandrasinghe <ladinu.pub@gmail.com> | 2009-09-22 19:43:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:28 -0400 |
commit | b7ed698cc9d556306a4088c238e2ea9311ea2cb3 (patch) | |
tree | b0aadfcf2d2c1c1454bdf8f194f7ff94e5d21c46 /Documentation/vm/slabinfo.c | |
parent | 912e837aef72a3dd263dafc3717d92bbc1211a53 (diff) |
Documentation/: fix warnings from -Wmissing-prototypes in HOSTCFLAGS
Fix up -Wmissing-prototypes in compileable userspace code, mainly under
Documentation/.
Signed-off-by: Ladinu Chandrasinghe <ladinu.pub@gmail.com>
Signed-off-by: Trevor Keith <tsrk@tsrk.net>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/vm/slabinfo.c')
-rw-r--r-- | Documentation/vm/slabinfo.c | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/Documentation/vm/slabinfo.c b/Documentation/vm/slabinfo.c index df3227605d59..92e729f4b676 100644 --- a/Documentation/vm/slabinfo.c +++ b/Documentation/vm/slabinfo.c | |||
@@ -87,7 +87,7 @@ int page_size; | |||
87 | 87 | ||
88 | regex_t pattern; | 88 | regex_t pattern; |
89 | 89 | ||
90 | void fatal(const char *x, ...) | 90 | static void fatal(const char *x, ...) |
91 | { | 91 | { |
92 | va_list ap; | 92 | va_list ap; |
93 | 93 | ||
@@ -97,7 +97,7 @@ void fatal(const char *x, ...) | |||
97 | exit(EXIT_FAILURE); | 97 | exit(EXIT_FAILURE); |
98 | } | 98 | } |
99 | 99 | ||
100 | void usage(void) | 100 | static void usage(void) |
101 | { | 101 | { |
102 | printf("slabinfo 5/7/2007. (c) 2007 sgi.\n\n" | 102 | printf("slabinfo 5/7/2007. (c) 2007 sgi.\n\n" |
103 | "slabinfo [-ahnpvtsz] [-d debugopts] [slab-regexp]\n" | 103 | "slabinfo [-ahnpvtsz] [-d debugopts] [slab-regexp]\n" |
@@ -131,7 +131,7 @@ void usage(void) | |||
131 | ); | 131 | ); |
132 | } | 132 | } |
133 | 133 | ||
134 | unsigned long read_obj(const char *name) | 134 | static unsigned long read_obj(const char *name) |
135 | { | 135 | { |
136 | FILE *f = fopen(name, "r"); | 136 | FILE *f = fopen(name, "r"); |
137 | 137 | ||
@@ -151,7 +151,7 @@ unsigned long read_obj(const char *name) | |||
151 | /* | 151 | /* |
152 | * Get the contents of an attribute | 152 | * Get the contents of an attribute |
153 | */ | 153 | */ |
154 | unsigned long get_obj(const char *name) | 154 | static unsigned long get_obj(const char *name) |
155 | { | 155 | { |
156 | if (!read_obj(name)) | 156 | if (!read_obj(name)) |
157 | return 0; | 157 | return 0; |
@@ -159,7 +159,7 @@ unsigned long get_obj(const char *name) | |||
159 | return atol(buffer); | 159 | return atol(buffer); |
160 | } | 160 | } |
161 | 161 | ||
162 | unsigned long get_obj_and_str(const char *name, char **x) | 162 | static unsigned long get_obj_and_str(const char *name, char **x) |
163 | { | 163 | { |
164 | unsigned long result = 0; | 164 | unsigned long result = 0; |
165 | char *p; | 165 | char *p; |
@@ -178,7 +178,7 @@ unsigned long get_obj_and_str(const char *name, char **x) | |||
178 | return result; | 178 | return result; |
179 | } | 179 | } |
180 | 180 | ||
181 | void set_obj(struct slabinfo *s, const char *name, int n) | 181 | static void set_obj(struct slabinfo *s, const char *name, int n) |
182 | { | 182 | { |
183 | char x[100]; | 183 | char x[100]; |
184 | FILE *f; | 184 | FILE *f; |
@@ -192,7 +192,7 @@ void set_obj(struct slabinfo *s, const char *name, int n) | |||
192 | fclose(f); | 192 | fclose(f); |
193 | } | 193 | } |
194 | 194 | ||
195 | unsigned long read_slab_obj(struct slabinfo *s, const char *name) | 195 | static unsigned long read_slab_obj(struct slabinfo *s, const char *name) |
196 | { | 196 | { |
197 | char x[100]; | 197 | char x[100]; |
198 | FILE *f; | 198 | FILE *f; |
@@ -215,7 +215,7 @@ unsigned long read_slab_obj(struct slabinfo *s, const char *name) | |||
215 | /* | 215 | /* |
216 | * Put a size string together | 216 | * Put a size string together |
217 | */ | 217 | */ |
218 | int store_size(char *buffer, unsigned long value) | 218 | static int store_size(char *buffer, unsigned long value) |
219 | { | 219 | { |
220 | unsigned long divisor = 1; | 220 | unsigned long divisor = 1; |
221 | char trailer = 0; | 221 | char trailer = 0; |
@@ -247,7 +247,7 @@ int store_size(char *buffer, unsigned long value) | |||
247 | return n; | 247 | return n; |
248 | } | 248 | } |
249 | 249 | ||
250 | void decode_numa_list(int *numa, char *t) | 250 | static void decode_numa_list(int *numa, char *t) |
251 | { | 251 | { |
252 | int node; | 252 | int node; |
253 | int nr; | 253 | int nr; |
@@ -272,7 +272,7 @@ void decode_numa_list(int *numa, char *t) | |||
272 | } | 272 | } |
273 | } | 273 | } |
274 | 274 | ||
275 | void slab_validate(struct slabinfo *s) | 275 | static void slab_validate(struct slabinfo *s) |
276 | { | 276 | { |
277 | if (strcmp(s->name, "*") == 0) | 277 | if (strcmp(s->name, "*") == 0) |
278 | return; | 278 | return; |
@@ -280,7 +280,7 @@ void slab_validate(struct slabinfo *s) | |||
280 | set_obj(s, "validate", 1); | 280 | set_obj(s, "validate", 1); |
281 | } | 281 | } |
282 | 282 | ||
283 | void slab_shrink(struct slabinfo *s) | 283 | static void slab_shrink(struct slabinfo *s) |
284 | { | 284 | { |
285 | if (strcmp(s->name, "*") == 0) | 285 | if (strcmp(s->name, "*") == 0) |
286 | return; | 286 | return; |
@@ -290,7 +290,7 @@ void slab_shrink(struct slabinfo *s) | |||
290 | 290 | ||
291 | int line = 0; | 291 | int line = 0; |
292 | 292 | ||
293 | void first_line(void) | 293 | static void first_line(void) |
294 | { | 294 | { |
295 | if (show_activity) | 295 | if (show_activity) |
296 | printf("Name Objects Alloc Free %%Fast Fallb O\n"); | 296 | printf("Name Objects Alloc Free %%Fast Fallb O\n"); |
@@ -302,7 +302,7 @@ void first_line(void) | |||
302 | /* | 302 | /* |
303 | * Find the shortest alias of a slab | 303 | * Find the shortest alias of a slab |
304 | */ | 304 | */ |
305 | struct aliasinfo *find_one_alias(struct slabinfo *find) | 305 | static struct aliasinfo *find_one_alias(struct slabinfo *find) |
306 | { | 306 | { |
307 | struct aliasinfo *a; | 307 | struct aliasinfo *a; |
308 | struct aliasinfo *best = NULL; | 308 | struct aliasinfo *best = NULL; |
@@ -318,18 +318,18 @@ struct aliasinfo *find_one_alias(struct slabinfo *find) | |||
318 | return best; | 318 | return best; |
319 | } | 319 | } |
320 | 320 | ||
321 | unsigned long slab_size(struct slabinfo *s) | 321 | static unsigned long slab_size(struct slabinfo *s) |
322 | { | 322 | { |
323 | return s->slabs * (page_size << s->order); | 323 | return s->slabs * (page_size << s->order); |
324 | } | 324 | } |
325 | 325 | ||
326 | unsigned long slab_activity(struct slabinfo *s) | 326 | static unsigned long slab_activity(struct slabinfo *s) |
327 | { | 327 | { |
328 | return s->alloc_fastpath + s->free_fastpath + | 328 | return s->alloc_fastpath + s->free_fastpath + |
329 | s->alloc_slowpath + s->free_slowpath; | 329 | s->alloc_slowpath + s->free_slowpath; |
330 | } | 330 | } |
331 | 331 | ||
332 | void slab_numa(struct slabinfo *s, int mode) | 332 | static void slab_numa(struct slabinfo *s, int mode) |
333 | { | 333 | { |
334 | int node; | 334 | int node; |
335 | 335 | ||
@@ -374,7 +374,7 @@ void slab_numa(struct slabinfo *s, int mode) | |||
374 | line++; | 374 | line++; |
375 | } | 375 | } |
376 | 376 | ||
377 | void show_tracking(struct slabinfo *s) | 377 | static void show_tracking(struct slabinfo *s) |
378 | { | 378 | { |
379 | printf("\n%s: Kernel object allocation\n", s->name); | 379 | printf("\n%s: Kernel object allocation\n", s->name); |
380 | printf("-----------------------------------------------------------------------\n"); | 380 | printf("-----------------------------------------------------------------------\n"); |
@@ -392,7 +392,7 @@ void show_tracking(struct slabinfo *s) | |||
392 | 392 | ||
393 | } | 393 | } |
394 | 394 | ||
395 | void ops(struct slabinfo *s) | 395 | static void ops(struct slabinfo *s) |
396 | { | 396 | { |
397 | if (strcmp(s->name, "*") == 0) | 397 | if (strcmp(s->name, "*") == 0) |
398 | return; | 398 | return; |
@@ -405,14 +405,14 @@ void ops(struct slabinfo *s) | |||
405 | printf("\n%s has no kmem_cache operations\n", s->name); | 405 | printf("\n%s has no kmem_cache operations\n", s->name); |
406 | } | 406 | } |
407 | 407 | ||
408 | const char *onoff(int x) | 408 | static const char *onoff(int x) |
409 | { | 409 | { |
410 | if (x) | 410 | if (x) |
411 | return "On "; | 411 | return "On "; |
412 | return "Off"; | 412 | return "Off"; |
413 | } | 413 | } |
414 | 414 | ||
415 | void slab_stats(struct slabinfo *s) | 415 | static void slab_stats(struct slabinfo *s) |
416 | { | 416 | { |
417 | unsigned long total_alloc; | 417 | unsigned long total_alloc; |
418 | unsigned long total_free; | 418 | unsigned long total_free; |
@@ -477,7 +477,7 @@ void slab_stats(struct slabinfo *s) | |||
477 | s->deactivate_to_tail, (s->deactivate_to_tail * 100) / total); | 477 | s->deactivate_to_tail, (s->deactivate_to_tail * 100) / total); |
478 | } | 478 | } |
479 | 479 | ||
480 | void report(struct slabinfo *s) | 480 | static void report(struct slabinfo *s) |
481 | { | 481 | { |
482 | if (strcmp(s->name, "*") == 0) | 482 | if (strcmp(s->name, "*") == 0) |
483 | return; | 483 | return; |
@@ -518,7 +518,7 @@ void report(struct slabinfo *s) | |||
518 | slab_stats(s); | 518 | slab_stats(s); |
519 | } | 519 | } |
520 | 520 | ||
521 | void slabcache(struct slabinfo *s) | 521 | static void slabcache(struct slabinfo *s) |
522 | { | 522 | { |
523 | char size_str[20]; | 523 | char size_str[20]; |
524 | char dist_str[40]; | 524 | char dist_str[40]; |
@@ -593,7 +593,7 @@ void slabcache(struct slabinfo *s) | |||
593 | /* | 593 | /* |
594 | * Analyze debug options. Return false if something is amiss. | 594 | * Analyze debug options. Return false if something is amiss. |
595 | */ | 595 | */ |
596 | int debug_opt_scan(char *opt) | 596 | static int debug_opt_scan(char *opt) |
597 | { | 597 | { |
598 | if (!opt || !opt[0] || strcmp(opt, "-") == 0) | 598 | if (!opt || !opt[0] || strcmp(opt, "-") == 0) |
599 | return 1; | 599 | return 1; |
@@ -642,7 +642,7 @@ int debug_opt_scan(char *opt) | |||
642 | return 1; | 642 | return 1; |
643 | } | 643 | } |
644 | 644 | ||
645 | int slab_empty(struct slabinfo *s) | 645 | static int slab_empty(struct slabinfo *s) |
646 | { | 646 | { |
647 | if (s->objects > 0) | 647 | if (s->objects > 0) |
648 | return 0; | 648 | return 0; |
@@ -657,7 +657,7 @@ int slab_empty(struct slabinfo *s) | |||
657 | return 1; | 657 | return 1; |
658 | } | 658 | } |
659 | 659 | ||
660 | void slab_debug(struct slabinfo *s) | 660 | static void slab_debug(struct slabinfo *s) |
661 | { | 661 | { |
662 | if (strcmp(s->name, "*") == 0) | 662 | if (strcmp(s->name, "*") == 0) |
663 | return; | 663 | return; |
@@ -717,7 +717,7 @@ void slab_debug(struct slabinfo *s) | |||
717 | set_obj(s, "trace", 1); | 717 | set_obj(s, "trace", 1); |
718 | } | 718 | } |
719 | 719 | ||
720 | void totals(void) | 720 | static void totals(void) |
721 | { | 721 | { |
722 | struct slabinfo *s; | 722 | struct slabinfo *s; |
723 | 723 | ||
@@ -976,7 +976,7 @@ void totals(void) | |||
976 | b1, b2, b3); | 976 | b1, b2, b3); |
977 | } | 977 | } |
978 | 978 | ||
979 | void sort_slabs(void) | 979 | static void sort_slabs(void) |
980 | { | 980 | { |
981 | struct slabinfo *s1,*s2; | 981 | struct slabinfo *s1,*s2; |
982 | 982 | ||
@@ -1005,7 +1005,7 @@ void sort_slabs(void) | |||
1005 | } | 1005 | } |
1006 | } | 1006 | } |
1007 | 1007 | ||
1008 | void sort_aliases(void) | 1008 | static void sort_aliases(void) |
1009 | { | 1009 | { |
1010 | struct aliasinfo *a1,*a2; | 1010 | struct aliasinfo *a1,*a2; |
1011 | 1011 | ||
@@ -1030,7 +1030,7 @@ void sort_aliases(void) | |||
1030 | } | 1030 | } |
1031 | } | 1031 | } |
1032 | 1032 | ||
1033 | void link_slabs(void) | 1033 | static void link_slabs(void) |
1034 | { | 1034 | { |
1035 | struct aliasinfo *a; | 1035 | struct aliasinfo *a; |
1036 | struct slabinfo *s; | 1036 | struct slabinfo *s; |
@@ -1048,7 +1048,7 @@ void link_slabs(void) | |||
1048 | } | 1048 | } |
1049 | } | 1049 | } |
1050 | 1050 | ||
1051 | void alias(void) | 1051 | static void alias(void) |
1052 | { | 1052 | { |
1053 | struct aliasinfo *a; | 1053 | struct aliasinfo *a; |
1054 | char *active = NULL; | 1054 | char *active = NULL; |
@@ -1079,7 +1079,7 @@ void alias(void) | |||
1079 | } | 1079 | } |
1080 | 1080 | ||
1081 | 1081 | ||
1082 | void rename_slabs(void) | 1082 | static void rename_slabs(void) |
1083 | { | 1083 | { |
1084 | struct slabinfo *s; | 1084 | struct slabinfo *s; |
1085 | struct aliasinfo *a; | 1085 | struct aliasinfo *a; |
@@ -1102,12 +1102,12 @@ void rename_slabs(void) | |||
1102 | } | 1102 | } |
1103 | } | 1103 | } |
1104 | 1104 | ||
1105 | int slab_mismatch(char *slab) | 1105 | static int slab_mismatch(char *slab) |
1106 | { | 1106 | { |
1107 | return regexec(&pattern, slab, 0, NULL, 0); | 1107 | return regexec(&pattern, slab, 0, NULL, 0); |
1108 | } | 1108 | } |
1109 | 1109 | ||
1110 | void read_slab_dir(void) | 1110 | static void read_slab_dir(void) |
1111 | { | 1111 | { |
1112 | DIR *dir; | 1112 | DIR *dir; |
1113 | struct dirent *de; | 1113 | struct dirent *de; |
@@ -1209,7 +1209,7 @@ void read_slab_dir(void) | |||
1209 | fatal("Too many aliases\n"); | 1209 | fatal("Too many aliases\n"); |
1210 | } | 1210 | } |
1211 | 1211 | ||
1212 | void output_slabs(void) | 1212 | static void output_slabs(void) |
1213 | { | 1213 | { |
1214 | struct slabinfo *slab; | 1214 | struct slabinfo *slab; |
1215 | 1215 | ||