mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] binfmt_elf: Quiet GCC-4.6 'set but not used' warning in load_elf_binary()
@ 2011-01-24 23:04 David Daney
  0 siblings, 0 replies; only message in thread
From: David Daney @ 2011-01-24 23:04 UTC (permalink / raw)
  To: linux-kernel, torvalds, viro, linux-fsdevel, akpm; +Cc: linux-mips, David Daney

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-01-24 23:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-24 23:04 [PATCH] binfmt_elf: Quiet GCC-4.6 'set but not used' warning in load_elf_binary() David Daney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®