From: Mark McLoughlin <markmc@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Mark McLoughlin <markmc@redhat.com>, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/3] dyngen: fix some warnings about unused functions
Date: Thu, 13 Nov 2008 16:42:05 +0000 [thread overview]
Message-ID: <1226594526-1855-2-git-send-email-markmc@redhat.com> (raw)
In-Reply-To: <1226594526-1855-1-git-send-email-markmc@redhat.com>
Warnings were:
dyngen.c:292: error: ‘pstrcpy’ defined but not used
Only used with CONFIG_FORMAT_COFF
dyngen.c:319: error: ‘swab32ss’ defined but not used
With ELF_USES_RELOCA, either swab32ss() or swab64ss() will
be used depending on ELF_CLASS. Easier to just mark them
both as unused.
dyngen.c:334: error: ‘get16’ defined but not used
dyngen.c:343: error: ‘get32’ defined but not used
dyngen.c:352: error: ‘put16’ defined but not used
dyngen.c:359: error: ‘put32’ defined but not used
Maybe be used for some host arches; easiest to mark them as
unused.
dyngen.c:425: error: ‘elf_swap_phdr’ defined but not used
This one is completely unused; just delete.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
---
dyngen.c | 28 ++++++++++------------------
1 files changed, 10 insertions(+), 18 deletions(-)
diff --git a/dyngen.c b/dyngen.c
index 68f23ad..c55a115 100644
--- a/dyngen.c
+++ b/dyngen.c
@@ -32,6 +32,8 @@
#include "config-host.h"
+#define ATTRIBUTE_UNUSED __attribute__((unused))
+
/* NOTE: we test CONFIG_WIN32 instead of _WIN32 to enabled cross
compilation */
#if defined(CONFIG_WIN32)
@@ -288,6 +290,7 @@ static int strstart(const char *str, const char *val, const char **ptr)
return 1;
}
+#ifdef CONFIG_FORMAT_COFF
static void pstrcpy(char *buf, int buf_size, const char *str)
{
int c;
@@ -304,6 +307,7 @@ static void pstrcpy(char *buf, int buf_size, const char *str)
}
*q = '\0';
}
+#endif /* CONFIG_FORMAT_COFF */
static void swab16s(uint16_t *p)
{
@@ -315,7 +319,7 @@ static void swab32s(uint32_t *p)
*p = bswap32(*p);
}
-static void swab32ss(int32_t *p)
+static void ATTRIBUTE_UNUSED swab32ss(int32_t *p)
{
*p = bswap32(*p);
}
@@ -325,12 +329,12 @@ static void swab64s(uint64_t *p)
*p = bswap64(*p);
}
-static void swab64ss(int64_t *p)
+static void ATTRIBUTE_UNUSED swab64ss(int64_t *p)
{
*p = bswap64(*p);
}
-static uint16_t get16(uint16_t *p)
+static uint16_t ATTRIBUTE_UNUSED get16(uint16_t *p)
{
uint16_t val;
val = *p;
@@ -339,7 +343,7 @@ static uint16_t get16(uint16_t *p)
return val;
}
-static uint32_t get32(uint32_t *p)
+static uint32_t ATTRIBUTE_UNUSED get32(uint32_t *p)
{
uint32_t val;
val = *p;
@@ -348,14 +352,14 @@ static uint32_t get32(uint32_t *p)
return val;
}
-static void put16(uint16_t *p, uint16_t val)
+static void ATTRIBUTE_UNUSED put16(uint16_t *p, uint16_t val)
{
if (do_swap)
val = bswap16(val);
*p = val;
}
-static void put32(uint32_t *p, uint32_t val)
+static void ATTRIBUTE_UNUSED put32(uint32_t *p, uint32_t val)
{
if (do_swap)
val = bswap32(val);
@@ -421,18 +425,6 @@ static void elf_swap_shdr(struct elf_shdr *h)
swabls(&h-> sh_entsize); /* Entry size if section holds table */
}
-static void elf_swap_phdr(struct elf_phdr *h)
-{
- swab32s(&h->p_type); /* Segment type */
- swabls(&h->p_offset); /* Segment file offset */
- swabls(&h->p_vaddr); /* Segment virtual address */
- swabls(&h->p_paddr); /* Segment physical address */
- swabls(&h->p_filesz); /* Segment size in file */
- swabls(&h->p_memsz); /* Segment size in memory */
- swab32s(&h->p_flags); /* Segment flags */
- swabls(&h->p_align); /* Segment alignment */
-}
-
static void elf_swap_rel(ELF_RELOC *rel)
{
swabls(&rel->r_offset);
--
1.5.4.3
next prev parent reply other threads:[~2008-11-13 16:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-13 16:42 [Qemu-devel] [PATCH 1/3] x86: fix warning without CONFIG_KVM Mark McLoughlin
2008-11-13 16:42 ` Mark McLoughlin [this message]
2008-11-13 16:42 ` [Qemu-devel] [PATCH 3/3] cris: fix a segfault if pflash drive not found Mark McLoughlin
2008-11-13 19:37 ` [Qemu-devel] " Anthony Liguori
2008-11-13 20:57 ` Edgar E. Iglesias
2008-11-13 17:10 ` [Qemu-devel] Re: [PATCH 2/3] dyngen: fix some warnings about unused functions Jan Kiszka
2008-11-13 19:39 ` Anthony Liguori
2008-11-14 15:25 ` Mark McLoughlin
2008-11-13 17:09 ` [Qemu-devel] Re: [PATCH 1/3] x86: fix warning without CONFIG_KVM Jan Kiszka
2008-11-13 19:31 ` Anthony Liguori
2008-11-14 3:22 ` Jamie Lokier
2008-11-13 19:38 ` Anthony Liguori
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=1226594526-1855-2-git-send-email-markmc@redhat.com \
--to=markmc@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=qemu-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.