From: Stefan Weil <sw@weilnetz.de>
To: qemu-trivial@nongnu.org
Cc: Stefan Weil <sw@weilnetz.de>,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
Alexander Graf <agraf@suse.de>
Subject: [Qemu-devel] [PATCH] target-ppc: Add missing 'static' and 'const' attributes
Date: Sun, 16 Mar 2014 14:49:54 +0100 [thread overview]
Message-ID: <1394977794-18939-1-git-send-email-sw@weilnetz.de> (raw)
This fixes warnings from the static code analysis (smatch).
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
target-ppc/arch_dump.c | 6 +++---
target-ppc/int_helper.c | 2 +-
target-ppc/machine.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/target-ppc/arch_dump.c b/target-ppc/arch_dump.c
index 17fd4c6..9dccf1a 100644
--- a/target-ppc/arch_dump.c
+++ b/target-ppc/arch_dump.c
@@ -164,7 +164,7 @@ static void ppc64_write_elf64_speregset(Note *note, PowerPCCPU *cpu)
speregset->spe_fscr = cpu_to_be32(cpu->env.spe_fscr);
}
-struct NoteFuncDescStruct {
+static const struct NoteFuncDescStruct {
int contents_size;
void (*note_contents_func)(Note *note, PowerPCCPU *cpu);
} 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 */
size_t elf_note_size = 0;
int note_head_size;
- NoteFuncDesc *nf;
+ const NoteFuncDesc *nf;
if (class != ELFCLASS64) {
return -1;
@@ -221,7 +221,7 @@ static int ppc64_write_all_elf64_notes(const char *note_name,
Note note;
int ret = -1;
int note_size;
- NoteFuncDesc *nf;
+ const NoteFuncDesc *nf;
for (nf = note_func; nf->note_contents_func; nf++) {
note.hdr.n_namesz = cpu_to_be32(sizeof(note.name));
diff --git a/target-ppc/int_helper.c b/target-ppc/int_helper.c
index 3a3b3f1..6811b03 100644
--- a/target-ppc/int_helper.c
+++ b/target-ppc/int_helper.c
@@ -1075,7 +1075,7 @@ void helper_vbpermq(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
#undef VBPERMQ_INDEX
#undef VBPERMQ_DW
-uint64_t VGBBD_MASKS[256] = {
+static const uint64_t VGBBD_MASKS[256] = {
0x0000000000000000ull, /* 00 */
0x0000000000000080ull, /* 01 */
0x0000000000008000ull, /* 02 */
diff --git a/target-ppc/machine.c b/target-ppc/machine.c
index 2d46cec..063b379 100644
--- a/target-ppc/machine.c
+++ b/target-ppc/machine.c
@@ -114,7 +114,7 @@ static void put_avr(QEMUFile *f, void *pv, size_t size)
qemu_put_be64(f, v->u64[1]);
}
-const VMStateInfo vmstate_info_avr = {
+static const VMStateInfo vmstate_info_avr = {
.name = "avr",
.get = get_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);
}
-const VMStateInfo vmstate_info_slbe = {
+static const VMStateInfo vmstate_info_slbe = {
.name = "slbe",
.get = get_slbe,
.put = put_slbe,
--
1.7.10.4
next reply other threads:[~2014-03-16 13:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-16 13:49 Stefan Weil [this message]
2014-03-20 1:13 ` [Qemu-devel] [PATCH] target-ppc: Add missing 'static' and 'const' attributes Andreas Färber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1394977794-18939-1-git-send-email-sw@weilnetz.de \
--to=sw@weilnetz.de \
--cc=agraf@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).