Skip to content

Commit

Permalink
Documentation/: fix warnings from -Wmissing-prototypes in HOSTCFLAGS
Browse files Browse the repository at this point in the history
Fix up -Wmissing-prototypes in compileable userspace code, mainly under
Documentation/.

Signed-off-by: Ladinu Chandrasinghe <[email protected]>
Signed-off-by: Trevor Keith <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Ladinu Chandrasinghe authored and torvalds committed Sep 23, 2009
1 parent 912e837 commit b7ed698
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 90 deletions.
12 changes: 6 additions & 6 deletions Documentation/accounting/getdelays.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static int create_nl_socket(int protocol)
}


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,
void *nla_data, int nla_len)
{
Expand Down Expand Up @@ -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
* for the TASKSTATS family
*/
int get_family_id(int sd)
static int get_family_id(int sd)
{
struct {
struct nlmsghdr n;
Expand Down Expand Up @@ -190,7 +190,7 @@ int get_family_id(int sd)
return id;
}

void print_delayacct(struct taskstats *t)
static void print_delayacct(struct taskstats *t)
{
printf("\n\nCPU %15s%15s%15s%15s\n"
" %15llu%15llu%15llu%15llu\n"
Expand All @@ -216,15 +216,15 @@ void print_delayacct(struct taskstats *t)
(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"
" %15llu%15llu\n",
"voluntary", "nonvoluntary",
(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, "
"uninterruptible %llu\n", (unsigned long long)c->nr_sleeping,
Expand All @@ -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",
t->ac_comm,
Expand Down
22 changes: 11 additions & 11 deletions Documentation/auxdisplay/cfag12864b-example.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ unsigned char cfag12864b_buffer[CFAG12864B_SIZE];
* Unable to open: return = -1
* Unable to mmap: return = -2
*/
int cfag12864b_init(char *path)
static int cfag12864b_init(char *path)
{
cfag12864b_fd = open(path, O_RDWR);
if (cfag12864b_fd == -1)
Expand All @@ -81,7 +81,7 @@ int cfag12864b_init(char *path)
/*
* exit a cfag12864b framebuffer device
*/
void cfag12864b_exit(void)
static void cfag12864b_exit(void)
{
munmap(cfag12864b_mem, CFAG12864B_SIZE);
close(cfag12864b_fd);
Expand All @@ -90,7 +90,7 @@ void cfag12864b_exit(void)
/*
* 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))
cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] |=
Expand All @@ -100,7 +100,7 @@ void cfag12864b_set(unsigned char x, unsigned char y)
/*
* 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))
cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] &=
Expand All @@ -113,7 +113,7 @@ void cfag12864b_unset(unsigned char x, unsigned char y)
* Pixel off: return = 0
* 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_buffer[CFAG12864B_ADDRESS(x, y)] &
Expand All @@ -126,7 +126,7 @@ unsigned char cfag12864b_isset(unsigned char x, unsigned char y)
/*
* 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))
cfag12864b_unset(x, y);
Expand All @@ -137,7 +137,7 @@ void cfag12864b_not(unsigned char x, unsigned char y)
/*
* fill (set all pixels)
*/
void cfag12864b_fill(void)
static void cfag12864b_fill(void)
{
unsigned short i;

Expand All @@ -148,7 +148,7 @@ void cfag12864b_fill(void)
/*
* clear (unset all pixels)
*/
void cfag12864b_clear(void)
static void cfag12864b_clear(void)
{
unsigned short i;

Expand All @@ -162,7 +162,7 @@ void cfag12864b_clear(void)
* Pixel off: 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;

Expand All @@ -182,7 +182,7 @@ void cfag12864b_format(unsigned char * matrix)
/*
* blit buffer to lcd
*/
void cfag12864b_blit(void)
static void cfag12864b_blit(void)
{
memcpy(cfag12864b_mem, cfag12864b_buffer, CFAG12864B_SIZE);
}
Expand All @@ -198,7 +198,7 @@ void cfag12864b_blit(void)

#define EXAMPLES 6

void example(unsigned char n)
static void example(unsigned char n)
{
unsigned short i, j;
unsigned char matrix[CFAG12864B_WIDTH * CFAG12864B_HEIGHT];
Expand Down
8 changes: 4 additions & 4 deletions Documentation/ia64/aliasing-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

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;
void *addr;
Expand Down Expand Up @@ -62,7 +62,7 @@ int map_mem(char *path, off_t offset, size_t length, int touch)
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;
char *name, *path2;
Expand Down Expand Up @@ -119,7 +119,7 @@ int scan_tree(char *path, char *file, off_t offset, size_t length, int touch)

char buf[1024];

int read_rom(char *path)
static int read_rom(char *path)
{
int fd, rc;
size_t size = 0;
Expand All @@ -146,7 +146,7 @@ int read_rom(char *path)
return size;
}

int scan_rom(char *path, char *file)
static int scan_rom(char *path, char *file)
{
struct dirent **namelist;
char *name, *path2;
Expand Down
2 changes: 1 addition & 1 deletion Documentation/pcmcia/crc32hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <ctype.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;
unsigned int crc = 0;
Expand Down
4 changes: 2 additions & 2 deletions Documentation/spi/spidev_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static void transfer(int fd)
puts("");
}

void print_usage(const char *prog)
static void print_usage(const char *prog)
{
printf("Usage: %s [-DsbdlHOLC3]\n", prog);
puts(" -D --device device to use (default /dev/spidev1.1)\n"
Expand All @@ -85,7 +85,7 @@ void print_usage(const char *prog)
exit(1);
}

void parse_opts(int argc, char *argv[])
static void parse_opts(int argc, char *argv[])
{
while (1) {
static const struct option lopts[] = {
Expand Down
2 changes: 1 addition & 1 deletion Documentation/video4linux/v4lgrab.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
for (i=0;i<size*3;i++)
tot += image[i];
Expand Down
Loading

0 comments on commit b7ed698

Please sign in to comment.