target-ppc: Add missing 'static' and 'const' attributes
This fixes warnings from the static code analysis (smatch). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
4c8821d134
commit
cfd54a0409
|
@ -164,7 +164,7 @@ static void ppc64_write_elf64_speregset(Note *note, PowerPCCPU *cpu)
|
||||||
speregset->spe_fscr = cpu_to_be32(cpu->env.spe_fscr);
|
speregset->spe_fscr = cpu_to_be32(cpu->env.spe_fscr);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct NoteFuncDescStruct {
|
static const struct NoteFuncDescStruct {
|
||||||
int contents_size;
|
int contents_size;
|
||||||
void (*note_contents_func)(Note *note, PowerPCCPU *cpu);
|
void (*note_contents_func)(Note *note, PowerPCCPU *cpu);
|
||||||
} note_func[] = {
|
} note_func[] = {
|
||||||
|
@ -196,7 +196,7 @@ ssize_t cpu_get_note_size(int class, int machine, int nr_cpus)
|
||||||
int name_size = 8; /* "CORE" or "QEMU" rounded */
|
int name_size = 8; /* "CORE" or "QEMU" rounded */
|
||||||
size_t elf_note_size = 0;
|
size_t elf_note_size = 0;
|
||||||
int note_head_size;
|
int note_head_size;
|
||||||
NoteFuncDesc *nf;
|
const NoteFuncDesc *nf;
|
||||||
|
|
||||||
if (class != ELFCLASS64) {
|
if (class != ELFCLASS64) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -221,7 +221,7 @@ static int ppc64_write_all_elf64_notes(const char *note_name,
|
||||||
Note note;
|
Note note;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
int note_size;
|
int note_size;
|
||||||
NoteFuncDesc *nf;
|
const NoteFuncDesc *nf;
|
||||||
|
|
||||||
for (nf = note_func; nf->note_contents_func; nf++) {
|
for (nf = note_func; nf->note_contents_func; nf++) {
|
||||||
note.hdr.n_namesz = cpu_to_be32(sizeof(note.name));
|
note.hdr.n_namesz = cpu_to_be32(sizeof(note.name));
|
||||||
|
|
|
@ -1075,7 +1075,7 @@ void helper_vbpermq(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
|
||||||
#undef VBPERMQ_INDEX
|
#undef VBPERMQ_INDEX
|
||||||
#undef VBPERMQ_DW
|
#undef VBPERMQ_DW
|
||||||
|
|
||||||
uint64_t VGBBD_MASKS[256] = {
|
static const uint64_t VGBBD_MASKS[256] = {
|
||||||
0x0000000000000000ull, /* 00 */
|
0x0000000000000000ull, /* 00 */
|
||||||
0x0000000000000080ull, /* 01 */
|
0x0000000000000080ull, /* 01 */
|
||||||
0x0000000000008000ull, /* 02 */
|
0x0000000000008000ull, /* 02 */
|
||||||
|
|
|
@ -114,7 +114,7 @@ static void put_avr(QEMUFile *f, void *pv, size_t size)
|
||||||
qemu_put_be64(f, v->u64[1]);
|
qemu_put_be64(f, v->u64[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const VMStateInfo vmstate_info_avr = {
|
static const VMStateInfo vmstate_info_avr = {
|
||||||
.name = "avr",
|
.name = "avr",
|
||||||
.get = get_avr,
|
.get = get_avr,
|
||||||
.put = put_avr,
|
.put = put_avr,
|
||||||
|
@ -288,7 +288,7 @@ static void put_slbe(QEMUFile *f, void *pv, size_t size)
|
||||||
qemu_put_be64(f, v->vsid);
|
qemu_put_be64(f, v->vsid);
|
||||||
}
|
}
|
||||||
|
|
||||||
const VMStateInfo vmstate_info_slbe = {
|
static const VMStateInfo vmstate_info_slbe = {
|
||||||
.name = "slbe",
|
.name = "slbe",
|
||||||
.get = get_slbe,
|
.get = get_slbe,
|
||||||
.put = put_slbe,
|
.put = put_slbe,
|
||||||
|
|
Loading…
Reference in New Issue