qemu-trivial.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Cc: patches@linaro.org
Subject: [Qemu-trivial] [PATCH for-2.10 2/4] bsd-user/elfload.c: Fix set-but-not-used warnings
Date: Tue, 18 Jul 2017 17:26:32 +0100	[thread overview]
Message-ID: <1500395194-21455-3-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1500395194-21455-1-git-send-email-peter.maydell@linaro.org>

Fix various warnings about set-but-not-used variables on OpenBSD:

bsd-user/elfload.c:1158:15: warning: variable 'mapped_addr' set but not used [-Wunused-but-set-variable]
bsd-user/elfload.c:1165:9: warning: variable 'status' set but not used [-Wunused-but-set-variable]
bsd-user/elfload.c:1168:15: warning: variable 'elf_stack' set but not used [-Wunused-but-set-variable]

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 bsd-user/elfload.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
index 41a1309..7cccf3e 100644
--- a/bsd-user/elfload.c
+++ b/bsd-user/elfload.c
@@ -1155,21 +1155,20 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
     unsigned int interpreter_type = INTERPRETER_NONE;
     unsigned char ibcs2_interpreter;
     int i;
-    abi_ulong mapped_addr;
     struct elf_phdr * elf_ppnt;
     struct elf_phdr *elf_phdata;
     abi_ulong elf_bss, k, elf_brk;
     int retval;
     char * elf_interpreter;
     abi_ulong elf_entry, interp_load_addr = 0;
-    int status;
     abi_ulong start_code, end_code, start_data, end_data;
     abi_ulong reloc_func_desc = 0;
-    abi_ulong elf_stack;
+#ifdef LOW_ELF_STACK
+    abi_ulong elf_stack = ~((abi_ulong)0UL);
+#endif
     char passed_fileno[6];
 
     ibcs2_interpreter = 0;
-    status = 0;
     load_addr = 0;
     load_bias = 0;
     elf_ex = *((struct elfhdr *) bprm->buf);          /* exec-header */
@@ -1221,7 +1220,6 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
     elf_brk = 0;
 
 
-    elf_stack = ~((abi_ulong)0UL);
     elf_interpreter = NULL;
     start_code = ~((abi_ulong)0UL);
     end_code = 0;
@@ -1546,7 +1544,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
                and some applications "depend" upon this behavior.
                Since we do not have the power to recompile these, we
                emulate the SVr4 behavior.  Sigh.  */
-            mapped_addr = target_mmap(0, qemu_host_page_size, PROT_READ | PROT_EXEC,
+            target_mmap(0, qemu_host_page_size, PROT_READ | PROT_EXEC,
                                       MAP_FIXED | MAP_PRIVATE, -1, 0);
     }
 
-- 
2.7.4



  parent reply	other threads:[~2017-07-18 16:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-18 16:26 [Qemu-trivial] [PATCH for-2.10 0/4] bsd-user: silence warnings on OpenBSD Peter Maydell
2017-07-18 16:26 ` [Qemu-trivial] [PATCH for-2.10 1/4] bsd-user/mmap.c: Move __thread attribute to right place Peter Maydell
2017-07-18 16:45   ` [Qemu-trivial] [Qemu-devel] " Philippe Mathieu-Daudé
2017-07-18 16:26 ` Peter Maydell [this message]
2017-07-18 16:44   ` [Qemu-trivial] [PATCH for-2.10 2/4] bsd-user/elfload.c: Fix set-but-not-used warnings Philippe Mathieu-Daudé
2017-07-18 16:26 ` [Qemu-trivial] [PATCH for-2.10 3/4] bsd-user/bsdload.c: Remove write-only id_change variable Peter Maydell
2017-07-21 11:12   ` [Qemu-trivial] [Qemu-devel] " Thomas Huth
2017-07-21 15:25     ` Peter Maydell
2017-07-18 16:26 ` [Qemu-trivial] [PATCH for-2.10 4/4] bsd-user/main.c: Fix unused variable warning Peter Maydell
2017-07-18 22:01   ` [Qemu-trivial] [Qemu-devel] " Eric Blake
2017-07-19  8:19     ` Peter Maydell
2017-07-21 11:18       ` Thomas Huth
2017-07-21 12:23       ` Eric Blake
2017-07-21 15:25         ` Peter Maydell
2017-07-18 21:29 ` [Qemu-trivial] [Qemu-devel] [PATCH for-2.10 0/4] bsd-user: silence warnings on OpenBSD no-reply
2017-07-21 10:27 ` Peter Maydell

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=1500395194-21455-3-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=patches@linaro.org \
    --cc=qemu-devel@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).