From nobody Mon Feb 9 17:59:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500395778880566.9232744986969; Tue, 18 Jul 2017 09:36:18 -0700 (PDT) Received: from localhost ([::1]:57765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXVTp-0007rT-Lk for importer@patchew.org; Tue, 18 Jul 2017 12:36:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXVKh-0000YI-Bk for qemu-devel@nongnu.org; Tue, 18 Jul 2017 12:26:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXVKg-00012f-Ay for qemu-devel@nongnu.org; Tue, 18 Jul 2017 12:26:47 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:37654) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dXVKg-0000zb-4f; Tue, 18 Jul 2017 12:26:46 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1dXVKW-00054O-FU; Tue, 18 Jul 2017 17:26:36 +0100 From: Peter Maydell To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Date: Tue, 18 Jul 2017 17:26:32 +0100 Message-Id: <1500395194-21455-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500395194-21455-1-git-send-email-peter.maydell@linaro.org> References: <1500395194-21455-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH for-2.10 2/4] bsd-user/elfload.c: Fix set-but-not-used warnings X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Fix various warnings about set-but-not-used variables on OpenBSD: bsd-user/elfload.c:1158:15: warning: variable 'mapped_addr' set but not use= d [-Wunused-but-set-variable] bsd-user/elfload.c:1165:9: warning: variable 'status' set but not used [-Wu= nused-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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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, str= uct target_pt_regs * regs, unsigned int interpreter_type =3D 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 =3D 0; - int status; abi_ulong start_code, end_code, start_data, end_data; abi_ulong reloc_func_desc =3D 0; - abi_ulong elf_stack; +#ifdef LOW_ELF_STACK + abi_ulong elf_stack =3D ~((abi_ulong)0UL); +#endif char passed_fileno[6]; =20 ibcs2_interpreter =3D 0; - status =3D 0; load_addr =3D 0; load_bias =3D 0; elf_ex =3D *((struct elfhdr *) bprm->buf); /* exec-header */ @@ -1221,7 +1220,6 @@ int load_elf_binary(struct linux_binprm * bprm, struc= t target_pt_regs * regs, elf_brk =3D 0; =20 =20 - elf_stack =3D ~((abi_ulong)0UL); elf_interpreter =3D NULL; start_code =3D ~((abi_ulong)0UL); end_code =3D 0; @@ -1546,7 +1544,7 @@ int load_elf_binary(struct linux_binprm * bprm, struc= t 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 =3D 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); } =20 --=20 2.7.4