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>
This commit is contained in:
Ladinu Chandrasinghe 2009-09-22 16:43:42 -07:00 коммит произвёл Linus Torvalds
Родитель 912e837aef
Коммит b7ed698cc9
11 изменённых файлов: 90 добавлений и 90 удалений

Просмотреть файл

@ -116,7 +116,7 @@ error:
} }
int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid, static int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid,
__u8 genl_cmd, __u16 nla_type, __u8 genl_cmd, __u16 nla_type,
void *nla_data, int nla_len) void *nla_data, int nla_len)
{ {
@ -160,7 +160,7 @@ int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid,
* Probe the controller in genetlink to find the family id * Probe the controller in genetlink to find the family id
* for the TASKSTATS family * for the TASKSTATS family
*/ */
int get_family_id(int sd) static int get_family_id(int sd)
{ {
struct { struct {
struct nlmsghdr n; struct nlmsghdr n;
@ -190,7 +190,7 @@ int get_family_id(int sd)
return id; return id;
} }
void print_delayacct(struct taskstats *t) static void print_delayacct(struct taskstats *t)
{ {
printf("\n\nCPU %15s%15s%15s%15s\n" printf("\n\nCPU %15s%15s%15s%15s\n"
" %15llu%15llu%15llu%15llu\n" " %15llu%15llu%15llu%15llu\n"
@ -216,7 +216,7 @@ void print_delayacct(struct taskstats *t)
(unsigned long long)t->freepages_delay_total); (unsigned long long)t->freepages_delay_total);
} }
void task_context_switch_counts(struct taskstats *t) static void task_context_switch_counts(struct taskstats *t)
{ {
printf("\n\nTask %15s%15s\n" printf("\n\nTask %15s%15s\n"
" %15llu%15llu\n", " %15llu%15llu\n",
@ -224,7 +224,7 @@ void task_context_switch_counts(struct taskstats *t)
(unsigned long long)t->nvcsw, (unsigned long long)t->nivcsw); (unsigned long long)t->nvcsw, (unsigned long long)t->nivcsw);
} }
void print_cgroupstats(struct cgroupstats *c) static void print_cgroupstats(struct cgroupstats *c)
{ {
printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, " printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, "
"uninterruptible %llu\n", (unsigned long long)c->nr_sleeping, "uninterruptible %llu\n", (unsigned long long)c->nr_sleeping,
@ -235,7 +235,7 @@ void print_cgroupstats(struct cgroupstats *c)
} }
void print_ioacct(struct taskstats *t) static void print_ioacct(struct taskstats *t)
{ {
printf("%s: read=%llu, write=%llu, cancelled_write=%llu\n", printf("%s: read=%llu, write=%llu, cancelled_write=%llu\n",
t->ac_comm, t->ac_comm,

Просмотреть файл

@ -62,7 +62,7 @@ unsigned char cfag12864b_buffer[CFAG12864B_SIZE];
* Unable to open: return = -1 * Unable to open: return = -1
* Unable to mmap: return = -2 * Unable to mmap: return = -2
*/ */
int cfag12864b_init(char *path) static int cfag12864b_init(char *path)
{ {
cfag12864b_fd = open(path, O_RDWR); cfag12864b_fd = open(path, O_RDWR);
if (cfag12864b_fd == -1) if (cfag12864b_fd == -1)
@ -81,7 +81,7 @@ int cfag12864b_init(char *path)
/* /*
* exit a cfag12864b framebuffer device * exit a cfag12864b framebuffer device
*/ */
void cfag12864b_exit(void) static void cfag12864b_exit(void)
{ {
munmap(cfag12864b_mem, CFAG12864B_SIZE); munmap(cfag12864b_mem, CFAG12864B_SIZE);
close(cfag12864b_fd); close(cfag12864b_fd);
@ -90,7 +90,7 @@ void cfag12864b_exit(void)
/* /*
* set (x, y) pixel * set (x, y) pixel
*/ */
void cfag12864b_set(unsigned char x, unsigned char y) static void cfag12864b_set(unsigned char x, unsigned char y)
{ {
if (CFAG12864B_CHECK(x, y)) if (CFAG12864B_CHECK(x, y))
cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] |= cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] |=
@ -100,7 +100,7 @@ void cfag12864b_set(unsigned char x, unsigned char y)
/* /*
* unset (x, y) pixel * unset (x, y) pixel
*/ */
void cfag12864b_unset(unsigned char x, unsigned char y) static void cfag12864b_unset(unsigned char x, unsigned char y)
{ {
if (CFAG12864B_CHECK(x, y)) if (CFAG12864B_CHECK(x, y))
cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] &= cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] &=
@ -113,7 +113,7 @@ void cfag12864b_unset(unsigned char x, unsigned char y)
* Pixel off: return = 0 * Pixel off: return = 0
* Pixel on: return = 1 * Pixel on: return = 1
*/ */
unsigned char cfag12864b_isset(unsigned char x, unsigned char y) static unsigned char cfag12864b_isset(unsigned char x, unsigned char y)
{ {
if (CFAG12864B_CHECK(x, y)) if (CFAG12864B_CHECK(x, y))
if (cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] & if (cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] &
@ -126,7 +126,7 @@ unsigned char cfag12864b_isset(unsigned char x, unsigned char y)
/* /*
* not (x, y) pixel * not (x, y) pixel
*/ */
void cfag12864b_not(unsigned char x, unsigned char y) static void cfag12864b_not(unsigned char x, unsigned char y)
{ {
if (cfag12864b_isset(x, y)) if (cfag12864b_isset(x, y))
cfag12864b_unset(x, y); cfag12864b_unset(x, y);
@ -137,7 +137,7 @@ void cfag12864b_not(unsigned char x, unsigned char y)
/* /*
* fill (set all pixels) * fill (set all pixels)
*/ */
void cfag12864b_fill(void) static void cfag12864b_fill(void)
{ {
unsigned short i; unsigned short i;
@ -148,7 +148,7 @@ void cfag12864b_fill(void)
/* /*
* clear (unset all pixels) * clear (unset all pixels)
*/ */
void cfag12864b_clear(void) static void cfag12864b_clear(void)
{ {
unsigned short i; unsigned short i;
@ -162,7 +162,7 @@ void cfag12864b_clear(void)
* Pixel off: src[i] = 0 * Pixel off: src[i] = 0
* Pixel on: src[i] > 0 * Pixel on: src[i] > 0
*/ */
void cfag12864b_format(unsigned char * matrix) static void cfag12864b_format(unsigned char * matrix)
{ {
unsigned char i, j, n; unsigned char i, j, n;
@ -182,7 +182,7 @@ void cfag12864b_format(unsigned char * matrix)
/* /*
* blit buffer to lcd * blit buffer to lcd
*/ */
void cfag12864b_blit(void) static void cfag12864b_blit(void)
{ {
memcpy(cfag12864b_mem, cfag12864b_buffer, CFAG12864B_SIZE); memcpy(cfag12864b_mem, cfag12864b_buffer, CFAG12864B_SIZE);
} }
@ -198,7 +198,7 @@ void cfag12864b_blit(void)
#define EXAMPLES 6 #define EXAMPLES 6
void example(unsigned char n) static void example(unsigned char n)
{ {
unsigned short i, j; unsigned short i, j;
unsigned char matrix[CFAG12864B_WIDTH * CFAG12864B_HEIGHT]; unsigned char matrix[CFAG12864B_WIDTH * CFAG12864B_HEIGHT];

Просмотреть файл

@ -24,7 +24,7 @@
int sum; int sum;
int map_mem(char *path, off_t offset, size_t length, int touch) static int map_mem(char *path, off_t offset, size_t length, int touch)
{ {
int fd, rc; int fd, rc;
void *addr; void *addr;
@ -62,7 +62,7 @@ int map_mem(char *path, off_t offset, size_t length, int touch)
return 0; return 0;
} }
int scan_tree(char *path, char *file, off_t offset, size_t length, int touch) static int scan_tree(char *path, char *file, off_t offset, size_t length, int touch)
{ {
struct dirent **namelist; struct dirent **namelist;
char *name, *path2; char *name, *path2;
@ -119,7 +119,7 @@ skip:
char buf[1024]; char buf[1024];
int read_rom(char *path) static int read_rom(char *path)
{ {
int fd, rc; int fd, rc;
size_t size = 0; size_t size = 0;
@ -146,7 +146,7 @@ int read_rom(char *path)
return size; return size;
} }
int scan_rom(char *path, char *file) static int scan_rom(char *path, char *file)
{ {
struct dirent **namelist; struct dirent **namelist;
char *name, *path2; char *name, *path2;

Просмотреть файл

@ -8,7 +8,7 @@ $ ./crc32hash "Dual Speed"
#include <ctype.h> #include <ctype.h>
#include <stdlib.h> #include <stdlib.h>
unsigned int crc32(unsigned char const *p, unsigned int len) static unsigned int crc32(unsigned char const *p, unsigned int len)
{ {
int i; int i;
unsigned int crc = 0; unsigned int crc = 0;

Просмотреть файл

@ -69,7 +69,7 @@ static void transfer(int fd)
puts(""); puts("");
} }
void print_usage(const char *prog) static void print_usage(const char *prog)
{ {
printf("Usage: %s [-DsbdlHOLC3]\n", prog); printf("Usage: %s [-DsbdlHOLC3]\n", prog);
puts(" -D --device device to use (default /dev/spidev1.1)\n" puts(" -D --device device to use (default /dev/spidev1.1)\n"
@ -85,7 +85,7 @@ void print_usage(const char *prog)
exit(1); exit(1);
} }
void parse_opts(int argc, char *argv[]) static void parse_opts(int argc, char *argv[])
{ {
while (1) { while (1) {
static const struct option lopts[] = { static const struct option lopts[] = {

Просмотреть файл

@ -89,7 +89,7 @@
} \ } \
} }
int get_brightness_adj(unsigned char *image, long size, int *brightness) { static int get_brightness_adj(unsigned char *image, long size, int *brightness) {
long i, tot = 0; long i, tot = 0;
for (i=0;i<size*3;i++) for (i=0;i<size*3;i++)
tot += image[i]; tot += image[i];

Просмотреть файл

@ -158,12 +158,12 @@ static uint64_t page_flags[HASH_SIZE];
type __min2 = (y); \ type __min2 = (y); \
__min1 < __min2 ? __min1 : __min2; }) __min1 < __min2 ? __min1 : __min2; })
unsigned long pages2mb(unsigned long pages) static unsigned long pages2mb(unsigned long pages)
{ {
return (pages * page_size) >> 20; return (pages * page_size) >> 20;
} }
void fatal(const char *x, ...) static void fatal(const char *x, ...)
{ {
va_list ap; va_list ap;
@ -178,7 +178,7 @@ void fatal(const char *x, ...)
* page flag names * page flag names
*/ */
char *page_flag_name(uint64_t flags) static char *page_flag_name(uint64_t flags)
{ {
static char buf[65]; static char buf[65];
int present; int present;
@ -197,7 +197,7 @@ char *page_flag_name(uint64_t flags)
return buf; return buf;
} }
char *page_flag_longname(uint64_t flags) static char *page_flag_longname(uint64_t flags)
{ {
static char buf[1024]; static char buf[1024];
int i, n; int i, n;
@ -221,7 +221,7 @@ char *page_flag_longname(uint64_t flags)
* page list and summary * page list and summary
*/ */
void show_page_range(unsigned long offset, uint64_t flags) static void show_page_range(unsigned long offset, uint64_t flags)
{ {
static uint64_t flags0; static uint64_t flags0;
static unsigned long index; static unsigned long index;
@ -241,12 +241,12 @@ void show_page_range(unsigned long offset, uint64_t flags)
count = 1; count = 1;
} }
void show_page(unsigned long offset, uint64_t flags) static void show_page(unsigned long offset, uint64_t flags)
{ {
printf("%lu\t%s\n", offset, page_flag_name(flags)); printf("%lu\t%s\n", offset, page_flag_name(flags));
} }
void show_summary(void) static void show_summary(void)
{ {
int i; int i;
@ -272,7 +272,7 @@ void show_summary(void)
* page flag filters * page flag filters
*/ */
int bit_mask_ok(uint64_t flags) static int bit_mask_ok(uint64_t flags)
{ {
int i; int i;
@ -289,7 +289,7 @@ int bit_mask_ok(uint64_t flags)
return 1; return 1;
} }
uint64_t expand_overloaded_flags(uint64_t flags) static uint64_t expand_overloaded_flags(uint64_t flags)
{ {
/* SLOB/SLUB overload several page flags */ /* SLOB/SLUB overload several page flags */
if (flags & BIT(SLAB)) { if (flags & BIT(SLAB)) {
@ -308,7 +308,7 @@ uint64_t expand_overloaded_flags(uint64_t flags)
return flags; return flags;
} }
uint64_t well_known_flags(uint64_t flags) static uint64_t well_known_flags(uint64_t flags)
{ {
/* hide flags intended only for kernel hacker */ /* hide flags intended only for kernel hacker */
flags &= ~KPF_HACKERS_BITS; flags &= ~KPF_HACKERS_BITS;
@ -325,7 +325,7 @@ uint64_t well_known_flags(uint64_t flags)
* page frame walker * page frame walker
*/ */
int hash_slot(uint64_t flags) static int hash_slot(uint64_t flags)
{ {
int k = HASH_KEY(flags); int k = HASH_KEY(flags);
int i; int i;
@ -352,7 +352,7 @@ int hash_slot(uint64_t flags)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
void add_page(unsigned long offset, uint64_t flags) static void add_page(unsigned long offset, uint64_t flags)
{ {
flags = expand_overloaded_flags(flags); flags = expand_overloaded_flags(flags);
@ -371,7 +371,7 @@ void add_page(unsigned long offset, uint64_t flags)
total_pages++; total_pages++;
} }
void walk_pfn(unsigned long index, unsigned long count) static void walk_pfn(unsigned long index, unsigned long count)
{ {
unsigned long batch; unsigned long batch;
unsigned long n; unsigned long n;
@ -404,7 +404,7 @@ void walk_pfn(unsigned long index, unsigned long count)
} }
} }
void walk_addr_ranges(void) static void walk_addr_ranges(void)
{ {
int i; int i;
@ -428,7 +428,7 @@ void walk_addr_ranges(void)
* user interface * user interface
*/ */
const char *page_flag_type(uint64_t flag) static const char *page_flag_type(uint64_t flag)
{ {
if (flag & KPF_HACKERS_BITS) if (flag & KPF_HACKERS_BITS)
return "(r)"; return "(r)";
@ -437,7 +437,7 @@ const char *page_flag_type(uint64_t flag)
return " "; return " ";
} }
void usage(void) static void usage(void)
{ {
int i, j; int i, j;
@ -482,7 +482,7 @@ void usage(void)
"(r) raw mode bits (o) overloaded bits\n"); "(r) raw mode bits (o) overloaded bits\n");
} }
unsigned long long parse_number(const char *str) static unsigned long long parse_number(const char *str)
{ {
unsigned long long n; unsigned long long n;
@ -494,16 +494,16 @@ unsigned long long parse_number(const char *str)
return n; return n;
} }
void parse_pid(const char *str) static void parse_pid(const char *str)
{ {
opt_pid = parse_number(str); opt_pid = parse_number(str);
} }
void parse_file(const char *name) static void parse_file(const char *name)
{ {
} }
void add_addr_range(unsigned long offset, unsigned long size) static void add_addr_range(unsigned long offset, unsigned long size)
{ {
if (nr_addr_ranges >= MAX_ADDR_RANGES) if (nr_addr_ranges >= MAX_ADDR_RANGES)
fatal("too much addr ranges\n"); fatal("too much addr ranges\n");
@ -513,7 +513,7 @@ void add_addr_range(unsigned long offset, unsigned long size)
nr_addr_ranges++; nr_addr_ranges++;
} }
void parse_addr_range(const char *optarg) static void parse_addr_range(const char *optarg)
{ {
unsigned long offset; unsigned long offset;
unsigned long size; unsigned long size;
@ -547,7 +547,7 @@ void parse_addr_range(const char *optarg)
add_addr_range(offset, size); add_addr_range(offset, size);
} }
void add_bits_filter(uint64_t mask, uint64_t bits) static void add_bits_filter(uint64_t mask, uint64_t bits)
{ {
if (nr_bit_filters >= MAX_BIT_FILTERS) if (nr_bit_filters >= MAX_BIT_FILTERS)
fatal("too much bit filters\n"); fatal("too much bit filters\n");
@ -557,7 +557,7 @@ void add_bits_filter(uint64_t mask, uint64_t bits)
nr_bit_filters++; nr_bit_filters++;
} }
uint64_t parse_flag_name(const char *str, int len) static uint64_t parse_flag_name(const char *str, int len)
{ {
int i; int i;
@ -577,7 +577,7 @@ uint64_t parse_flag_name(const char *str, int len)
return parse_number(str); return parse_number(str);
} }
uint64_t parse_flag_names(const char *str, int all) static uint64_t parse_flag_names(const char *str, int all)
{ {
const char *p = str; const char *p = str;
uint64_t flags = 0; uint64_t flags = 0;
@ -596,7 +596,7 @@ uint64_t parse_flag_names(const char *str, int all)
return flags; return flags;
} }
void parse_bits_mask(const char *optarg) static void parse_bits_mask(const char *optarg)
{ {
uint64_t mask; uint64_t mask;
uint64_t bits; uint64_t bits;
@ -621,7 +621,7 @@ void parse_bits_mask(const char *optarg)
} }
struct option opts[] = { static struct option opts[] = {
{ "raw" , 0, NULL, 'r' }, { "raw" , 0, NULL, 'r' },
{ "pid" , 1, NULL, 'p' }, { "pid" , 1, NULL, 'p' },
{ "file" , 1, NULL, 'f' }, { "file" , 1, NULL, 'f' },

Просмотреть файл

@ -87,7 +87,7 @@ int page_size;
regex_t pattern; regex_t pattern;
void fatal(const char *x, ...) static void fatal(const char *x, ...)
{ {
va_list ap; va_list ap;
@ -97,7 +97,7 @@ void fatal(const char *x, ...)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
void usage(void) static void usage(void)
{ {
printf("slabinfo 5/7/2007. (c) 2007 sgi.\n\n" printf("slabinfo 5/7/2007. (c) 2007 sgi.\n\n"
"slabinfo [-ahnpvtsz] [-d debugopts] [slab-regexp]\n" "slabinfo [-ahnpvtsz] [-d debugopts] [slab-regexp]\n"
@ -131,7 +131,7 @@ void usage(void)
); );
} }
unsigned long read_obj(const char *name) static unsigned long read_obj(const char *name)
{ {
FILE *f = fopen(name, "r"); FILE *f = fopen(name, "r");
@ -151,7 +151,7 @@ unsigned long read_obj(const char *name)
/* /*
* Get the contents of an attribute * Get the contents of an attribute
*/ */
unsigned long get_obj(const char *name) static unsigned long get_obj(const char *name)
{ {
if (!read_obj(name)) if (!read_obj(name))
return 0; return 0;
@ -159,7 +159,7 @@ unsigned long get_obj(const char *name)
return atol(buffer); return atol(buffer);
} }
unsigned long get_obj_and_str(const char *name, char **x) static unsigned long get_obj_and_str(const char *name, char **x)
{ {
unsigned long result = 0; unsigned long result = 0;
char *p; char *p;
@ -178,7 +178,7 @@ unsigned long get_obj_and_str(const char *name, char **x)
return result; return result;
} }
void set_obj(struct slabinfo *s, const char *name, int n) static void set_obj(struct slabinfo *s, const char *name, int n)
{ {
char x[100]; char x[100];
FILE *f; FILE *f;
@ -192,7 +192,7 @@ void set_obj(struct slabinfo *s, const char *name, int n)
fclose(f); fclose(f);
} }
unsigned long read_slab_obj(struct slabinfo *s, const char *name) static unsigned long read_slab_obj(struct slabinfo *s, const char *name)
{ {
char x[100]; char x[100];
FILE *f; FILE *f;
@ -215,7 +215,7 @@ unsigned long read_slab_obj(struct slabinfo *s, const char *name)
/* /*
* Put a size string together * Put a size string together
*/ */
int store_size(char *buffer, unsigned long value) static int store_size(char *buffer, unsigned long value)
{ {
unsigned long divisor = 1; unsigned long divisor = 1;
char trailer = 0; char trailer = 0;
@ -247,7 +247,7 @@ int store_size(char *buffer, unsigned long value)
return n; return n;
} }
void decode_numa_list(int *numa, char *t) static void decode_numa_list(int *numa, char *t)
{ {
int node; int node;
int nr; int nr;
@ -272,7 +272,7 @@ void decode_numa_list(int *numa, char *t)
} }
} }
void slab_validate(struct slabinfo *s) static void slab_validate(struct slabinfo *s)
{ {
if (strcmp(s->name, "*") == 0) if (strcmp(s->name, "*") == 0)
return; return;
@ -280,7 +280,7 @@ void slab_validate(struct slabinfo *s)
set_obj(s, "validate", 1); set_obj(s, "validate", 1);
} }
void slab_shrink(struct slabinfo *s) static void slab_shrink(struct slabinfo *s)
{ {
if (strcmp(s->name, "*") == 0) if (strcmp(s->name, "*") == 0)
return; return;
@ -290,7 +290,7 @@ void slab_shrink(struct slabinfo *s)
int line = 0; int line = 0;
void first_line(void) static void first_line(void)
{ {
if (show_activity) if (show_activity)
printf("Name Objects Alloc Free %%Fast Fallb O\n"); printf("Name Objects Alloc Free %%Fast Fallb O\n");
@ -302,7 +302,7 @@ void first_line(void)
/* /*
* Find the shortest alias of a slab * Find the shortest alias of a slab
*/ */
struct aliasinfo *find_one_alias(struct slabinfo *find) static struct aliasinfo *find_one_alias(struct slabinfo *find)
{ {
struct aliasinfo *a; struct aliasinfo *a;
struct aliasinfo *best = NULL; struct aliasinfo *best = NULL;
@ -318,18 +318,18 @@ struct aliasinfo *find_one_alias(struct slabinfo *find)
return best; return best;
} }
unsigned long slab_size(struct slabinfo *s) static unsigned long slab_size(struct slabinfo *s)
{ {
return s->slabs * (page_size << s->order); return s->slabs * (page_size << s->order);
} }
unsigned long slab_activity(struct slabinfo *s) static unsigned long slab_activity(struct slabinfo *s)
{ {
return s->alloc_fastpath + s->free_fastpath + return s->alloc_fastpath + s->free_fastpath +
s->alloc_slowpath + s->free_slowpath; s->alloc_slowpath + s->free_slowpath;
} }
void slab_numa(struct slabinfo *s, int mode) static void slab_numa(struct slabinfo *s, int mode)
{ {
int node; int node;
@ -374,7 +374,7 @@ void slab_numa(struct slabinfo *s, int mode)
line++; line++;
} }
void show_tracking(struct slabinfo *s) static void show_tracking(struct slabinfo *s)
{ {
printf("\n%s: Kernel object allocation\n", s->name); printf("\n%s: Kernel object allocation\n", s->name);
printf("-----------------------------------------------------------------------\n"); printf("-----------------------------------------------------------------------\n");
@ -392,7 +392,7 @@ void show_tracking(struct slabinfo *s)
} }
void ops(struct slabinfo *s) static void ops(struct slabinfo *s)
{ {
if (strcmp(s->name, "*") == 0) if (strcmp(s->name, "*") == 0)
return; return;
@ -405,14 +405,14 @@ void ops(struct slabinfo *s)
printf("\n%s has no kmem_cache operations\n", s->name); printf("\n%s has no kmem_cache operations\n", s->name);
} }
const char *onoff(int x) static const char *onoff(int x)
{ {
if (x) if (x)
return "On "; return "On ";
return "Off"; return "Off";
} }
void slab_stats(struct slabinfo *s) static void slab_stats(struct slabinfo *s)
{ {
unsigned long total_alloc; unsigned long total_alloc;
unsigned long total_free; unsigned long total_free;
@ -477,7 +477,7 @@ void slab_stats(struct slabinfo *s)
s->deactivate_to_tail, (s->deactivate_to_tail * 100) / total); s->deactivate_to_tail, (s->deactivate_to_tail * 100) / total);
} }
void report(struct slabinfo *s) static void report(struct slabinfo *s)
{ {
if (strcmp(s->name, "*") == 0) if (strcmp(s->name, "*") == 0)
return; return;
@ -518,7 +518,7 @@ void report(struct slabinfo *s)
slab_stats(s); slab_stats(s);
} }
void slabcache(struct slabinfo *s) static void slabcache(struct slabinfo *s)
{ {
char size_str[20]; char size_str[20];
char dist_str[40]; char dist_str[40];
@ -593,7 +593,7 @@ void slabcache(struct slabinfo *s)
/* /*
* Analyze debug options. Return false if something is amiss. * Analyze debug options. Return false if something is amiss.
*/ */
int debug_opt_scan(char *opt) static int debug_opt_scan(char *opt)
{ {
if (!opt || !opt[0] || strcmp(opt, "-") == 0) if (!opt || !opt[0] || strcmp(opt, "-") == 0)
return 1; return 1;
@ -642,7 +642,7 @@ int debug_opt_scan(char *opt)
return 1; return 1;
} }
int slab_empty(struct slabinfo *s) static int slab_empty(struct slabinfo *s)
{ {
if (s->objects > 0) if (s->objects > 0)
return 0; return 0;
@ -657,7 +657,7 @@ int slab_empty(struct slabinfo *s)
return 1; return 1;
} }
void slab_debug(struct slabinfo *s) static void slab_debug(struct slabinfo *s)
{ {
if (strcmp(s->name, "*") == 0) if (strcmp(s->name, "*") == 0)
return; return;
@ -717,7 +717,7 @@ void slab_debug(struct slabinfo *s)
set_obj(s, "trace", 1); set_obj(s, "trace", 1);
} }
void totals(void) static void totals(void)
{ {
struct slabinfo *s; struct slabinfo *s;
@ -976,7 +976,7 @@ void totals(void)
b1, b2, b3); b1, b2, b3);
} }
void sort_slabs(void) static void sort_slabs(void)
{ {
struct slabinfo *s1,*s2; struct slabinfo *s1,*s2;
@ -1005,7 +1005,7 @@ void sort_slabs(void)
} }
} }
void sort_aliases(void) static void sort_aliases(void)
{ {
struct aliasinfo *a1,*a2; struct aliasinfo *a1,*a2;
@ -1030,7 +1030,7 @@ void sort_aliases(void)
} }
} }
void link_slabs(void) static void link_slabs(void)
{ {
struct aliasinfo *a; struct aliasinfo *a;
struct slabinfo *s; struct slabinfo *s;
@ -1048,7 +1048,7 @@ void link_slabs(void)
} }
} }
void alias(void) static void alias(void)
{ {
struct aliasinfo *a; struct aliasinfo *a;
char *active = NULL; char *active = NULL;
@ -1079,7 +1079,7 @@ void alias(void)
} }
void rename_slabs(void) static void rename_slabs(void)
{ {
struct slabinfo *s; struct slabinfo *s;
struct aliasinfo *a; struct aliasinfo *a;
@ -1102,12 +1102,12 @@ void rename_slabs(void)
} }
} }
int slab_mismatch(char *slab) static int slab_mismatch(char *slab)
{ {
return regexec(&pattern, slab, 0, NULL, 0); return regexec(&pattern, slab, 0, NULL, 0);
} }
void read_slab_dir(void) static void read_slab_dir(void)
{ {
DIR *dir; DIR *dir;
struct dirent *de; struct dirent *de;
@ -1209,7 +1209,7 @@ void read_slab_dir(void)
fatal("Too many aliases\n"); fatal("Too many aliases\n");
} }
void output_slabs(void) static void output_slabs(void)
{ {
struct slabinfo *slab; struct slabinfo *slab;

Просмотреть файл

@ -18,7 +18,7 @@ int fd;
* the PC Watchdog card to reset its internal timer so it doesn't trigger * the PC Watchdog card to reset its internal timer so it doesn't trigger
* a computer reset. * a computer reset.
*/ */
void keep_alive(void) static void keep_alive(void)
{ {
int dummy; int dummy;

Просмотреть файл

@ -56,7 +56,7 @@ static int output_records(int outfd);
static int sort_records = 0; static int sort_records = 0;
static int wide_records = 0; static int wide_records = 0;
int usage(void) static int usage(void)
{ {
fprintf(stderr, "ihex2fw: Convert ihex files into binary " fprintf(stderr, "ihex2fw: Convert ihex files into binary "
"representation for use by Linux kernel\n"); "representation for use by Linux kernel\n");

Просмотреть файл

@ -176,7 +176,7 @@ static int is_unknown_symbol(struct symbol *sym)
strcmp(defn->string, "{") == 0); strcmp(defn->string, "{") == 0);
} }
struct symbol *__add_symbol(const char *name, enum symbol_type type, static struct symbol *__add_symbol(const char *name, enum symbol_type type,
struct string_list *defn, int is_extern, struct string_list *defn, int is_extern,
int is_reference) int is_reference)
{ {
@ -265,7 +265,7 @@ struct symbol *add_symbol(const char *name, enum symbol_type type,
return __add_symbol(name, type, defn, is_extern, 0); return __add_symbol(name, type, defn, is_extern, 0);
} }
struct symbol *add_reference_symbol(const char *name, enum symbol_type type, static struct symbol *add_reference_symbol(const char *name, enum symbol_type type,
struct string_list *defn, int is_extern) struct string_list *defn, int is_extern)
{ {
return __add_symbol(name, type, defn, is_extern, 1); return __add_symbol(name, type, defn, is_extern, 1);
@ -313,7 +313,7 @@ static int equal_list(struct string_list *a, struct string_list *b)
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
struct string_list *read_node(FILE *f) static struct string_list *read_node(FILE *f)
{ {
char buffer[256]; char buffer[256];
struct string_list node = { struct string_list node = {