Skip to content

Commit

Permalink
Merge branch 'hostprogs-wmissing-prototypes' of git://git.kernel.org/…
Browse files Browse the repository at this point in the history
…pub/scm/linux/kernel/git/josh/linux-misc

* 'hostprogs-wmissing-prototypes' of git://git.kernel.org/pub/scm/linux/kernel/git/josh/linux-misc:
  Makefile: Add -Wmising-prototypes to HOSTCFLAGS
  oss: Mark loadhex static in hex2hex.c
  dtc: Mark various internal functions static
  dtc: Set "noinput" in the lexer to avoid an unused function
  drm: radeon: Mark several functions static in mkregtable
  arch/sparc/boot/*.c: Mark various internal functions static
  arch/powerpc/boot/addRamDisk.c: Mark several internal functions static
  arch/alpha/boot/tools/objstrip.c: Mark "usage" static
  Documentation/vm/page-types.c: Declare checked_open static
  genksyms: Mark is_reserved_word static
  kconfig: Mark various internal functions static
  kconfig: Make zconf.y work with current bison
  • Loading branch information
torvalds committed Nov 17, 2009
2 parents a08e37f + 25583d4 commit cb20c28
Show file tree
Hide file tree
Showing 22 changed files with 338 additions and 309 deletions.
2 changes: 1 addition & 1 deletion Documentation/vm/page-types.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static void fatal(const char *x, ...)
exit(EXIT_FAILURE);
}

int checked_open(const char *pathname, int flags)
static int checked_open(const char *pathname, int flags)
{
int fd = open(pathname, flags);

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \

HOSTCC = gcc
HOSTCXX = g++
HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
HOSTCXXFLAGS = -O2

# Decide whether to build built-in, modular, or both.
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/boot/tools/objstrip.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const char * prog_name;


void
static void
usage (void)
{
fprintf(stderr,
Expand Down
6 changes: 3 additions & 3 deletions arch/powerpc/boot/addRamDisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,20 @@ static int check_elf64(void *p, int size, struct addr_range *r)

return 64;
}
void get4k(FILE *file, char *buf )
static void get4k(FILE *file, char *buf )
{
unsigned j;
unsigned num = fread(buf, 1, 4096, file);
for ( j=num; j<4096; ++j )
buf[j] = 0;
}

void put4k(FILE *file, char *buf )
static void put4k(FILE *file, char *buf )
{
fwrite(buf, 1, 4096, file);
}

void death(const char *msg, FILE *fdesc, const char *fname)
static void death(const char *msg, FILE *fdesc, const char *fname)
{
fprintf(stderr, msg);
fclose(fdesc);
Expand Down
8 changes: 4 additions & 4 deletions arch/sparc/boot/btfixupprep.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ unsigned long lastfoffset = -1;
unsigned long lastfrelno;
btfixup *lastf;

void fatal(void) __attribute__((noreturn));
void fatal(void)
static void fatal(void) __attribute__((noreturn));
static void fatal(void)
{
fprintf(stderr, "Malformed output from objdump\n%s\n", buffer);
exit(1);
}

btfixup *find(int type, char *name)
static btfixup *find(int type, char *name)
{
int i;
for (i = 0; i < last; i++) {
Expand All @@ -88,7 +88,7 @@ btfixup *find(int type, char *name)
return array + last - 1;
}

void set_mode (char *buffer)
static void set_mode (char *buffer)
{
for (mode = 0;; mode++)
if (buffer[mode] < '0' || buffer[mode] > '9')
Expand Down
10 changes: 5 additions & 5 deletions arch/sparc/boot/piggyback_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,33 @@
* as PROM looks for a.out image only.
*/

unsigned short ld2(char *p)
static unsigned short ld2(char *p)
{
return (p[0] << 8) | p[1];
}

unsigned int ld4(char *p)
static unsigned int ld4(char *p)
{
return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
}

void st4(char *p, unsigned int x)
static void st4(char *p, unsigned int x)
{
p[0] = x >> 24;
p[1] = x >> 16;
p[2] = x >> 8;
p[3] = x;
}

void usage(void)
static void usage(void)
{
/* fs_img.gz is an image of initial ramdisk. */
fprintf(stderr, "Usage: piggyback vmlinux.aout System.map fs_img.gz\n");
fprintf(stderr, "\tKernel image will be modified in place.\n");
exit(1);
}

void die(char *str)
static void die(char *str)
{
perror (str);
exit(1);
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/boot/piggyback_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/* Note: run this on an a.out kernel (use elftoaout for it), as PROM looks for a.out image onlly
usage: piggyback vmlinux System.map tail, where tail is gzipped fs of the initial ramdisk */

void die(char *str)
static void die(char *str)
{
perror (str);
exit(1);
Expand Down
12 changes: 6 additions & 6 deletions drivers/gpu/drm/radeon/mkregtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ struct table {
char *gpu_prefix;
};

struct offset *offset_new(unsigned o)
static struct offset *offset_new(unsigned o)
{
struct offset *offset;

Expand All @@ -573,20 +573,20 @@ struct offset *offset_new(unsigned o)
return offset;
}

void table_offset_add(struct table *t, struct offset *offset)
static void table_offset_add(struct table *t, struct offset *offset)
{
list_add_tail(&offset->list, &t->offsets);
}

void table_init(struct table *t)
static void table_init(struct table *t)
{
INIT_LIST_HEAD(&t->offsets);
t->offset_max = 0;
t->nentry = 0;
t->table = NULL;
}

void table_print(struct table *t)
static void table_print(struct table *t)
{
unsigned nlloop, i, j, n, c, id;

Expand All @@ -611,7 +611,7 @@ void table_print(struct table *t)
printf("};\n");
}

int table_build(struct table *t)
static int table_build(struct table *t)
{
struct offset *offset;
unsigned i, m;
Expand All @@ -631,7 +631,7 @@ int table_build(struct table *t)
}

static char gpu_name[10];
int parser_auth(struct table *t, const char *filename)
static int parser_auth(struct table *t, const char *filename)
{
FILE *file;
regex_t mask_rex;
Expand Down
2 changes: 1 addition & 1 deletion scripts/dtc/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ struct data data_insert_at_marker(struct data d, struct marker *m,
return d;
}

struct data data_append_markers(struct data d, struct marker *m)
static struct data data_append_markers(struct data d, struct marker *m)
{
struct marker **mp = &d.markers;

Expand Down
2 changes: 1 addition & 1 deletion scripts/dtc/dtc-lexer.l
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* USA
*/

%option noyywrap nounput yylineno
%option noyywrap noinput nounput yylineno

%x INCLUDE
%x BYTESTRING
Expand Down
69 changes: 53 additions & 16 deletions scripts/dtc/dtc-lexer.lex.c_shipped
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 34
#define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
Expand Down Expand Up @@ -54,7 +54,6 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */

/* Limits of integral types. */
#ifndef INT8_MIN
Expand Down Expand Up @@ -85,6 +84,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif

#endif /* ! C99 */

#endif /* ! FLEXINT_H */

#ifdef __cplusplus
Expand Down Expand Up @@ -141,7 +142,15 @@ typedef unsigned int flex_uint32_t;

/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif

/* The state buf must be large enough to hold one state per character in the main buffer.
Expand Down Expand Up @@ -192,13 +201,6 @@ extern FILE *yyin, *yyout;

#define unput(c) yyunput( c, (yytext_ptr) )

/* The following is because we cannot portably get our hands on size_t
* (without autoconf's help, which isn't available because we want
* flex-generated scanners to compile on their own).
* Given that the standard has decreed that size_t exists since 1989,
* I guess we can afford to depend on it. Manoj.
*/

#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
Expand Down Expand Up @@ -604,6 +606,7 @@ char *yytext;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
#define YY_NO_INPUT 1



Expand Down Expand Up @@ -634,7 +637,7 @@ static int dts_version; /* = 0 */

static void push_input_file(const char *filename);
static int pop_input_file(void);
#line 638 "dtc-lexer.lex.c"
#line 641 "dtc-lexer.lex.c"

#define INITIAL 0
#define INCLUDE 1
Expand All @@ -656,6 +659,35 @@ static int pop_input_file(void);

static int yy_init_globals (void );

/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */

int yylex_destroy (void );

int yyget_debug (void );

void yyset_debug (int debug_flag );

YY_EXTRA_TYPE yyget_extra (void );

void yyset_extra (YY_EXTRA_TYPE user_defined );

FILE *yyget_in (void );

void yyset_in (FILE * in_str );

FILE *yyget_out (void );

void yyset_out (FILE * out_str );

int yyget_leng (void );

char *yyget_text (void );

int yyget_lineno (void );

void yyset_lineno (int line_number );

/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
Expand Down Expand Up @@ -688,15 +720,20 @@ static int input (void );

/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif

/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
#define ECHO fwrite( yytext, yyleng, 1, yyout )
#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
#endif

/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
Expand All @@ -707,7 +744,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
int n; \
size_t n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
Expand Down Expand Up @@ -791,7 +828,7 @@ YY_DECL

#line 64 "dtc-lexer.l"

#line 795 "dtc-lexer.lex.c"
#line 832 "dtc-lexer.lex.c"

if ( !(yy_init) )
{
Expand Down Expand Up @@ -1116,7 +1153,7 @@ YY_RULE_SETUP
#line 222 "dtc-lexer.l"
ECHO;
YY_BREAK
#line 1120 "dtc-lexer.lex.c"
#line 1157 "dtc-lexer.lex.c"

case YY_END_OF_BUFFER:
{
Expand Down Expand Up @@ -1840,8 +1877,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )

/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
* scan from a @e copy of @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
Expand Down
2 changes: 1 addition & 1 deletion scripts/dtc/libfdt/fdt_ro.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)
&phandle, sizeof(phandle));
}

int _stringlist_contains(const char *strlist, int listlen, const char *str)
static int _stringlist_contains(const char *strlist, int listlen, const char *str)
{
int len = strlen(str);
const char *p;
Expand Down
2 changes: 1 addition & 1 deletion scripts/dtc/treesource.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static void write_prefix(FILE *f, int level)
fputc('\t', f);
}

int isstring(char c)
static int isstring(char c)
{
return (isprint(c)
|| (c == '\0')
Expand Down
Loading

0 comments on commit cb20c28

Please sign in to comment.