mirror of https://gitlab.com/qemu-project/dtc.git
Remove an unused function, mark a bunch of other functions and variables
as static. Mostly found by sparse.
This commit is contained in:
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;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
char hexval(char c)
|
static char get_oct_char(char *s, int *i)
|
||||||
{
|
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
char x[4];
|
char x[4];
|
||||||
char *endx;
|
char *endx;
|
||||||
|
@ -137,7 +123,7 @@ char get_oct_char(char *s, int *i)
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
char get_hex_char(char *s, int *i)
|
static char get_hex_char(char *s, int *i)
|
||||||
{
|
{
|
||||||
char x[3];
|
char x[3];
|
||||||
char *endx;
|
char *endx;
|
||||||
|
|
14
flattree.c
14
flattree.c
|
@ -27,7 +27,7 @@
|
||||||
#define FTF_BOOTCPUID 0x8
|
#define FTF_BOOTCPUID 0x8
|
||||||
#define FTF_STRTABSIZE 0x10
|
#define FTF_STRTABSIZE 0x10
|
||||||
|
|
||||||
struct version_info {
|
static struct version_info {
|
||||||
int version;
|
int version;
|
||||||
int last_comp_version;
|
int last_comp_version;
|
||||||
int hdr_size;
|
int hdr_size;
|
||||||
|
@ -100,7 +100,7 @@ static void bin_emit_property(void *e, char *label)
|
||||||
bin_emit_cell(e, OF_DT_PROP);
|
bin_emit_cell(e, OF_DT_PROP);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct emitter bin_emitter = {
|
static struct emitter bin_emitter = {
|
||||||
.cell = bin_emit_cell,
|
.cell = bin_emit_cell,
|
||||||
.string = bin_emit_string,
|
.string = bin_emit_string,
|
||||||
.align = bin_emit_align,
|
.align = bin_emit_align,
|
||||||
|
@ -110,7 +110,7 @@ struct emitter bin_emitter = {
|
||||||
.property = bin_emit_property,
|
.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, "\t.globl\t%s_%s\n", prefix, label);
|
||||||
fprintf(f, "%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");
|
fprintf(f, "\t.long\tOF_DT_PROP\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
struct emitter asm_emitter = {
|
static struct emitter asm_emitter = {
|
||||||
.cell = asm_emit_cell,
|
.cell = asm_emit_cell,
|
||||||
.string = asm_emit_string,
|
.string = asm_emit_string,
|
||||||
.align = asm_emit_align,
|
.align = asm_emit_align,
|
||||||
|
@ -369,7 +369,7 @@ void write_dt_blob(FILE *f, struct boot_info *bi, int version)
|
||||||
data_free(strbuf);
|
data_free(strbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dump_stringtable_asm(FILE *f, struct data strbuf)
|
static void dump_stringtable_asm(FILE *f, struct data strbuf)
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
int len;
|
int len;
|
||||||
|
@ -561,8 +561,8 @@ static char *flat_read_stringtable(struct inbuf *inb, int offset)
|
||||||
return strdup(inb->base + offset);
|
return strdup(inb->base + offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct property *flat_read_property(struct inbuf *dtbuf, struct inbuf *strbuf,
|
static struct property *flat_read_property(struct inbuf *dtbuf,
|
||||||
int flags)
|
struct inbuf *strbuf, int flags)
|
||||||
{
|
{
|
||||||
u32 proplen, stroff;
|
u32 proplen, stroff;
|
||||||
char *name;
|
char *name;
|
||||||
|
|
|
@ -97,7 +97,7 @@ void add_child(struct node *parent, struct node *child)
|
||||||
* Tree accessor functions
|
* Tree accessor functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
char *get_unitname(struct node *node)
|
static char *get_unitname(struct node *node)
|
||||||
{
|
{
|
||||||
if (node->name[node->basenamelen] == '\0')
|
if (node->name[node->basenamelen] == '\0')
|
||||||
return "";
|
return "";
|
||||||
|
@ -105,7 +105,7 @@ char *get_unitname(struct node *node)
|
||||||
return node->name + node->basenamelen + 1;
|
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;
|
struct property *prop;
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ static int name_prop_check(struct property *prop, struct node *node)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct {
|
static struct {
|
||||||
char *propname;
|
char *propname;
|
||||||
int (*check_fn)(struct property *prop, struct node *node);
|
int (*check_fn)(struct property *prop, struct node *node);
|
||||||
} prop_checker_table[] = {
|
} 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 property *prop;
|
||||||
struct node *child;
|
struct node *child;
|
||||||
|
|
Loading…
Reference in New Issue