Skip to content

Commit b7ed698

Browse files
Ladinu Chandrasinghetorvalds
authored andcommitted
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>
1 parent 912e837 commit b7ed698

11 files changed

Lines changed: 90 additions & 90 deletions

File tree

‎Documentation/accounting/getdelays.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static int create_nl_socket(int protocol)
116116
}
117117

118118

119-
int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid,
119+
static int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid,
120120
__u8 genl_cmd, __u16 nla_type,
121121
void *nla_data, int nla_len)
122122
{
@@ -160,7 +160,7 @@ int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid,
160160
* Probe the controller in genetlink to find the family id
161161
* for the TASKSTATS family
162162
*/
163-
int get_family_id(int sd)
163+
static int get_family_id(int sd)
164164
{
165165
struct {
166166
struct nlmsghdr n;
@@ -190,7 +190,7 @@ int get_family_id(int sd)
190190
return id;
191191
}
192192

193-
void print_delayacct(struct taskstats *t)
193+
static void print_delayacct(struct taskstats *t)
194194
{
195195
printf("\n\nCPU %15s%15s%15s%15s\n"
196196
" %15llu%15llu%15llu%15llu\n"
@@ -216,15 +216,15 @@ void print_delayacct(struct taskstats *t)
216216
(unsigned long long)t->freepages_delay_total);
217217
}
218218

219-
void task_context_switch_counts(struct taskstats *t)
219+
static void task_context_switch_counts(struct taskstats *t)
220220
{
221221
printf("\n\nTask %15s%15s\n"
222222
" %15llu%15llu\n",
223223
"voluntary", "nonvoluntary",
224224
(unsigned long long)t->nvcsw, (unsigned long long)t->nivcsw);
225225
}
226226

227-
void print_cgroupstats(struct cgroupstats *c)
227+
static void print_cgroupstats(struct cgroupstats *c)
228228
{
229229
printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, "
230230
"uninterruptible %llu\n", (unsigned long long)c->nr_sleeping,
@@ -235,7 +235,7 @@ void print_cgroupstats(struct cgroupstats *c)
235235
}
236236

237237

238-
void print_ioacct(struct taskstats *t)
238+
static void print_ioacct(struct taskstats *t)
239239
{
240240
printf("%s: read=%llu, write=%llu, cancelled_write=%llu\n",
241241
t->ac_comm,

‎Documentation/auxdisplay/cfag12864b-example.c‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ unsigned char cfag12864b_buffer[CFAG12864B_SIZE];
6262
* Unable to open: return = -1
6363
* Unable to mmap: return = -2
6464
*/
65-
int cfag12864b_init(char *path)
65+
static int cfag12864b_init(char *path)
6666
{
6767
cfag12864b_fd = open(path, O_RDWR);
6868
if (cfag12864b_fd == -1)
@@ -81,7 +81,7 @@ int cfag12864b_init(char *path)
8181
/*
8282
* exit a cfag12864b framebuffer device
8383
*/
84-
void cfag12864b_exit(void)
84+
static void cfag12864b_exit(void)
8585
{
8686
munmap(cfag12864b_mem, CFAG12864B_SIZE);
8787
close(cfag12864b_fd);
@@ -90,7 +90,7 @@ void cfag12864b_exit(void)
9090
/*
9191
* set (x, y) pixel
9292
*/
93-
void cfag12864b_set(unsigned char x, unsigned char y)
93+
static void cfag12864b_set(unsigned char x, unsigned char y)
9494
{
9595
if (CFAG12864B_CHECK(x, y))
9696
cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] |=
@@ -100,7 +100,7 @@ void cfag12864b_set(unsigned char x, unsigned char y)
100100
/*
101101
* unset (x, y) pixel
102102
*/
103-
void cfag12864b_unset(unsigned char x, unsigned char y)
103+
static void cfag12864b_unset(unsigned char x, unsigned char y)
104104
{
105105
if (CFAG12864B_CHECK(x, y))
106106
cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] &=
@@ -113,7 +113,7 @@ void cfag12864b_unset(unsigned char x, unsigned char y)
113113
* Pixel off: return = 0
114114
* Pixel on: return = 1
115115
*/
116-
unsigned char cfag12864b_isset(unsigned char x, unsigned char y)
116+
static unsigned char cfag12864b_isset(unsigned char x, unsigned char y)
117117
{
118118
if (CFAG12864B_CHECK(x, y))
119119
if (cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] &
@@ -126,7 +126,7 @@ unsigned char cfag12864b_isset(unsigned char x, unsigned char y)
126126
/*
127127
* not (x, y) pixel
128128
*/
129-
void cfag12864b_not(unsigned char x, unsigned char y)
129+
static void cfag12864b_not(unsigned char x, unsigned char y)
130130
{
131131
if (cfag12864b_isset(x, y))
132132
cfag12864b_unset(x, y);
@@ -137,7 +137,7 @@ void cfag12864b_not(unsigned char x, unsigned char y)
137137
/*
138138
* fill (set all pixels)
139139
*/
140-
void cfag12864b_fill(void)
140+
static void cfag12864b_fill(void)
141141
{
142142
unsigned short i;
143143

@@ -148,7 +148,7 @@ void cfag12864b_fill(void)
148148
/*
149149
* clear (unset all pixels)
150150
*/
151-
void cfag12864b_clear(void)
151+
static void cfag12864b_clear(void)
152152
{
153153
unsigned short i;
154154

@@ -162,7 +162,7 @@ void cfag12864b_clear(void)
162162
* Pixel off: src[i] = 0
163163
* Pixel on: src[i] > 0
164164
*/
165-
void cfag12864b_format(unsigned char * matrix)
165+
static void cfag12864b_format(unsigned char * matrix)
166166
{
167167
unsigned char i, j, n;
168168

@@ -182,7 +182,7 @@ void cfag12864b_format(unsigned char * matrix)
182182
/*
183183
* blit buffer to lcd
184184
*/
185-
void cfag12864b_blit(void)
185+
static void cfag12864b_blit(void)
186186
{
187187
memcpy(cfag12864b_mem, cfag12864b_buffer, CFAG12864B_SIZE);
188188
}
@@ -198,7 +198,7 @@ void cfag12864b_blit(void)
198198

199199
#define EXAMPLES 6
200200

201-
void example(unsigned char n)
201+
static void example(unsigned char n)
202202
{
203203
unsigned short i, j;
204204
unsigned char matrix[CFAG12864B_WIDTH * CFAG12864B_HEIGHT];

‎Documentation/ia64/aliasing-test.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
int sum;
2626

27-
int map_mem(char *path, off_t offset, size_t length, int touch)
27+
static int map_mem(char *path, off_t offset, size_t length, int touch)
2828
{
2929
int fd, rc;
3030
void *addr;
@@ -62,7 +62,7 @@ int map_mem(char *path, off_t offset, size_t length, int touch)
6262
return 0;
6363
}
6464

65-
int scan_tree(char *path, char *file, off_t offset, size_t length, int touch)
65+
static int scan_tree(char *path, char *file, off_t offset, size_t length, int touch)
6666
{
6767
struct dirent **namelist;
6868
char *name, *path2;
@@ -119,7 +119,7 @@ int scan_tree(char *path, char *file, off_t offset, size_t length, int touch)
119119

120120
char buf[1024];
121121

122-
int read_rom(char *path)
122+
static int read_rom(char *path)
123123
{
124124
int fd, rc;
125125
size_t size = 0;
@@ -146,7 +146,7 @@ int read_rom(char *path)
146146
return size;
147147
}
148148

149-
int scan_rom(char *path, char *file)
149+
static int scan_rom(char *path, char *file)
150150
{
151151
struct dirent **namelist;
152152
char *name, *path2;

‎Documentation/pcmcia/crc32hash.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <ctype.h>
99
#include <stdlib.h>
1010

11-
unsigned int crc32(unsigned char const *p, unsigned int len)
11+
static unsigned int crc32(unsigned char const *p, unsigned int len)
1212
{
1313
int i;
1414
unsigned int crc = 0;

‎Documentation/spi/spidev_test.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static void transfer(int fd)
6969
puts("");
7070
}
7171

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

88-
void parse_opts(int argc, char *argv[])
88+
static void parse_opts(int argc, char *argv[])
8989
{
9090
while (1) {
9191
static const struct option lopts[] = {

‎Documentation/video4linux/v4lgrab.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
} \
9090
}
9191

92-
int get_brightness_adj(unsigned char *image, long size, int *brightness) {
92+
static int get_brightness_adj(unsigned char *image, long size, int *brightness) {
9393
long i, tot = 0;
9494
for (i=0;i<size*3;i++)
9595
tot += image[i];

0 commit comments

Comments
 (0)