2006-11-23 10:08:17

by David Binderman

[permalink] [raw]
Subject: fs/binfmt_elf.c(548): remark #593: variable "have_pt_gnu_stack" was set but neve


Hello there,

I just tried to compile Linux kernel 2.6.18.3 with the Intel C
C compiler.

The compiler said

arch/x86_64/ia32/../../../fs/binfmt_elf.c(548): remark #593: variable
"have_pt_gnu_stack" was set but never used

The source code is

int have_pt_gnu_stack, executable_stack = EXSTACK_DEFAULT;

I have checked the source code and I agree with the compiler.
Suggest delete local variable.

Regards

David Binderman

_________________________________________________________________
Be the first to hear what's new at MSN - sign up to our free newsletters!
http://www.msn.co.uk/newsletters


2006-11-23 10:33:07

by David Rientjes

[permalink] [raw]
Subject: [PATCH] fs: remove unused variable

Removed unused 'have_pt_gnu_stack' variable.

Reported by David Binderman <[email protected]>

Signed-off-by: David Rientjes <[email protected]>
---
fs/binfmt_elf.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 79b05a1..8bdefa2 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -545,7 +545,7 @@ static int load_elf_binary(struct linux_
unsigned long reloc_func_desc = 0;
char passed_fileno[6];
struct files_struct *files;
- int have_pt_gnu_stack, executable_stack = EXSTACK_DEFAULT;
+ int executable_stack = EXSTACK_DEFAULT;
unsigned long def_flags = 0;
struct {
struct elfhdr elf_ex;
@@ -708,7 +708,6 @@ static int load_elf_binary(struct linux_
executable_stack = EXSTACK_DISABLE_X;
break;
}
- have_pt_gnu_stack = (i < loc->elf_ex.e_phnum);

/* Some simple consistency checks for the interpreter */
if (elf_interpreter) {