Remove an unused function, mark a bunch of other functions and variables
as static. Mostly found by sparse.main
parent
41916138dd
commit
230f253e9b
18
data.c
18
data.c
|
@ -101,21 +101,7 @@ struct data data_copy_mem(char *mem, int len)
|
|||
return d;
|
||||
}
|
||||
|
||||
char hexval(char c)
|
||||
{
|
||||
switch (c) {
|
||||
case '0' ... '9':
|
||||
return c - '0';
|
||||
case 'a' ... 'f':
|
||||
return c - 'a';
|
||||
case 'A' ... 'F':
|
||||
return c - 'A';
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
|
||||
char get_oct_char(char *s, int *i)
|
||||
static char get_oct_char(char *s, int *i)
|
||||
{
|
||||
char x[4];
|
||||
char *endx;
|
||||
|
@ -137,7 +123,7 @@ char get_oct_char(char *s, int *i)
|
|||
return val;
|
||||
}
|
||||
|
||||
char get_hex_char(char *s, int *i)
|
||||
static char get_hex_char(char *s, int *i)
|
||||
{
|
||||
char x[3];
|
||||
char *endx;
|
||||
|
|
14
flattree.c
14
flattree.c
|
@ -27,7 +27,7 @@
|
|||
#define FTF_BOOTCPUID 0x8
|
||||
#define FTF_STRTABSIZE 0x10
|
||||
|
||||
struct version_info {
|
||||
static struct version_info {
|
||||
int version;
|
||||
int last_comp_version;
|
||||
int hdr_size;
|
||||
|
@ -100,7 +100,7 @@ static void bin_emit_property(void *e, char *label)
|
|||
bin_emit_cell(e, OF_DT_PROP);
|
||||
}
|
||||
|
||||
struct emitter bin_emitter = {
|
||||
static struct emitter bin_emitter = {
|
||||
.cell = bin_emit_cell,
|
||||
.string = bin_emit_string,
|
||||
.align = bin_emit_align,
|
||||
|
@ -110,7 +110,7 @@ struct emitter bin_emitter = {
|
|||
.property = bin_emit_property,
|
||||
};
|
||||
|
||||
void emit_label(FILE *f, char *prefix, char *label)
|
||||
static void emit_label(FILE *f, char *prefix, char *label)
|
||||
{
|
||||
fprintf(f, "\t.globl\t%s_%s\n", prefix, label);
|
||||
fprintf(f, "%s_%s:\n", prefix, label);
|
||||
|
@ -207,7 +207,7 @@ static void asm_emit_property(void *e, char *label)
|
|||
fprintf(f, "\t.long\tOF_DT_PROP\n");
|
||||
}
|
||||
|
||||
struct emitter asm_emitter = {
|
||||
static struct emitter asm_emitter = {
|
||||
.cell = asm_emit_cell,
|
||||
.string = asm_emit_string,
|
||||
.align = asm_emit_align,
|
||||
|
@ -369,7 +369,7 @@ void write_dt_blob(FILE *f, struct boot_info *bi, int version)
|
|||
data_free(strbuf);
|
||||
}
|
||||
|
||||
void dump_stringtable_asm(FILE *f, struct data strbuf)
|
||||
static void dump_stringtable_asm(FILE *f, struct data strbuf)
|
||||
{
|
||||
char *p;
|
||||
int len;
|
||||
|
@ -561,8 +561,8 @@ static char *flat_read_stringtable(struct inbuf *inb, int offset)
|
|||
return strdup(inb->base + offset);
|
||||
}
|
||||
|
||||
struct property *flat_read_property(struct inbuf *dtbuf, struct inbuf *strbuf,
|
||||
int flags)
|
||||
static struct property *flat_read_property(struct inbuf *dtbuf,
|
||||
struct inbuf *strbuf, int flags)
|
||||
{
|
||||
u32 proplen, stroff;
|
||||
char *name;
|
||||
|
|
|
@ -97,7 +97,7 @@ void add_child(struct node *parent, struct node *child)
|
|||
* Tree accessor functions
|
||||
*/
|
||||
|
||||
char *get_unitname(struct node *node)
|
||||
static char *get_unitname(struct node *node)
|
||||
{
|
||||
if (node->name[node->basenamelen] == '\0')
|
||||
return "";
|
||||
|
@ -105,7 +105,7 @@ char *get_unitname(struct node *node)
|
|||
return node->name + node->basenamelen + 1;
|
||||
}
|
||||
|
||||
struct property *get_property(struct node *node, char *propname)
|
||||
static struct property *get_property(struct node *node, char *propname)
|
||||
{
|
||||
struct property *prop;
|
||||
|
||||
|
@ -226,7 +226,7 @@ static int name_prop_check(struct property *prop, struct node *node)
|
|||
return 1;
|
||||
}
|
||||
|
||||
struct {
|
||||
static struct {
|
||||
char *propname;
|
||||
int (*check_fn)(struct property *prop, struct node *node);
|
||||
} prop_checker_table[] = {
|
||||
|
|
|
@ -91,7 +91,7 @@ static enum proptype guess_type(struct property *prop)
|
|||
}
|
||||
|
||||
|
||||
void write_tree_source_node(FILE *f, struct node *tree, int level)
|
||||
static void write_tree_source_node(FILE *f, struct node *tree, int level)
|
||||
{
|
||||
struct property *prop;
|
||||
struct node *child;
|
||||
|
|
Loading…
Reference in New Issue