linux-mips
[Top] [All Lists]

[PATCH] binfmt_elf: Quiet GCC-4.6 'set but not used' warning in load_elf

To: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org
Subject: [PATCH] binfmt_elf: Quiet GCC-4.6 'set but not used' warning in load_elf_binary()
From: David Daney <ddaney@caviumnetworks.com>
Date: Mon, 24 Jan 2011 15:04:09 -0800
Cc: linux-mips@linux-mips.org, David Daney <ddaney@caviumnetworks.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
With GCC-4.6 we get warnings about things being 'set but not used'.

In load_elf_binary() this can happen with reloc_func_desc if
ELF_PLAT_INIT is defined, but doesn't use the reloc_func_desc
argument.

Quiet the warning/error by marking reloc_func_desc as __maybe_unused.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
---
 fs/binfmt_elf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index d5b640b..b2fae009 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -570,7 +570,7 @@ static int load_elf_binary(struct linux_binprm *bprm, 
struct pt_regs *regs)
        unsigned long elf_entry;
        unsigned long interp_load_addr = 0;
        unsigned long start_code, end_code, start_data, end_data;
-       unsigned long reloc_func_desc = 0;
+       unsigned long reloc_func_desc __maybe_unused = 0;
        int executable_stack = EXSTACK_DEFAULT;
        unsigned long def_flags = 0;
        struct {
-- 
1.7.2.3


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] binfmt_elf: Quiet GCC-4.6 'set but not used' warning in load_elf_binary(), David Daney <=