Skip to contentSkip to conversation

um: Remove unused bp stack-frame pointer

PATCH In review Manfred Schlaegl 2 participants 7 messages Oct 18, 2014 – Oct 19, 2014 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 um: Remove unused bp stack-frame pointer

The pointer to bp stack-frame is no longer used. Removed it. This also removes a corresponding compiler-warning.

---
 arch/um/kernel/sysrq.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
arch/um/kernel/sysrq.c +1 -1
index 894c8d3..aa1b56f 100644
@@ -29,7 +29,7 @@ static const struct stacktrace_ops stackops = {
  void show_stack(struct task_struct *task, unsigned long *stack)
 {
-	unsigned long *sp = stack, bp = 0;
+	unsigned long *sp = stack;
 	struct pt_regs *segv_regs = current->thread.segv_regs;
 	int i;
 @@ -39,10 +39,6 @@ void show_stack(struct task_struct *task, unsigned long *stack)
 		return;

}
-#ifdef CONFIG_FRAME_POINTER
- bp = get_frame_pointer(task, segv_regs);
-#endif
-
if (!stack)
sp = get_stack_pointer(task, segv_regs);
-- 1.7.10.4

#1 lore raw

Am 18.10.2014 um 16:23 schrieb Manfred Schlaegl:

Quoted 1 line

The pointer to bp stack-frame is no longer used. Removed it.

Good catch!

Quoted 1 line

This also removes a corresponding compiler-warning.

Which warning exactly?

Thanks,
//richard

#2 lore raw
Quoted 4 lines · Richard Weinberger

Am 18.10.2014 um 16:23 schrieb Manfred Schlaegl:

Quoted 1 line

The pointer to bp stack-frame is no longer used. Removed it.

Good catch!

Thank you.

Quoted 4 lines
Quoted 2 lines

This also removes a corresponding compiler-warning.

Which warning exactly?

On "normal" (defconfig) builds the warning does not show up because CONFIG_FRAME_POINTER is set. I've found the unused bp because CONFIG_FRAME_POINTER was not set in my configuration.

CC arch/um/kernel/sysrq.o
arch/um/kernel/sysrq.c: In function ‘show_stack’:
arch/um/kernel/sysrq.c:32:29: warning: unused variable ‘bp’ [-Wunused-variable]

It's reproducible on linus-tree (0429fbc0b) by
make mrproper
make tinyconfig ARCH=um SUBARCH=i386
make ARCH=um SUBARCH=i386

Quoted 4 lines

Thanks,
//richard

best regards,
manfred
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#3 lore raw

Am 18.10.2014 um 17:12 schrieb Manfred Schlaegl:

Quoted 10 lines · Richard Weinberger
Quoted 4 lines

Am 18.10.2014 um 16:23 schrieb Manfred Schlaegl:

Quoted 1 line

The pointer to bp stack-frame is no longer used. Removed it.

Good catch!

Thank you.

Quoted 3 lines
Quoted 2 lines

This also removes a corresponding compiler-warning.

Quoted 8 lines
Quoted 1 line

Which warning exactly?

On "normal" (defconfig) builds the warning does not show up because CONFIG_FRAME_POINTER is set. I've found the unused bp because CONFIG_FRAME_POINTER was not set in my configuration.

CC arch/um/kernel/sysrq.o
arch/um/kernel/sysrq.c: In function ‘show_stack’:
arch/um/kernel/sysrq.c:32:29: warning: unused variable ‘bp’ [-Wunused-variable]

Looks like my gcc need's an upgrade. :D

Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#4 lore raw
Quoted 16 lines · Richard Weinberger

Am 18.10.2014 um 17:12 schrieb Manfred Schlaegl:

Quoted 15 lines · Richard Weinberger
Quoted 4 lines

Am 18.10.2014 um 16:23 schrieb Manfred Schlaegl:

Quoted 1 line

The pointer to bp stack-frame is no longer used. Removed it.

Good catch!

Thank you.

Quoted 4 lines
Quoted 2 lines

This also removes a corresponding compiler-warning.

Which warning exactly?

On "normal" (defconfig) builds the warning does not show up because CONFIG_FRAME_POINTER is set. I've found the unused bp because CONFIG_FRAME_POINTER was not set in my configuration.

Quoted 9 lines
Quoted 3 lines

CC arch/um/kernel/sysrq.o
arch/um/kernel/sysrq.c: In function ‘show_stack’:
arch/um/kernel/sysrq.c:32:29: warning: unused variable ‘bp’ [-Wunused-variable]

Looks like my gcc need's an upgrade. :D

Thanks,
//richard

I'm using gcc version 4.7.2 (Debian 4.7.2-5). -> not THAT new ;-)

best regards
manfred
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#5 lore raw

Am 18.10.2014 um 17:24 schrieb Manfred Schlaegl:

Quoted 21 lines · Richard Weinberger
Quoted 20 lines

Am 18.10.2014 um 17:12 schrieb Manfred Schlaegl:

Quoted 18 lines · Richard Weinberger
Quoted 4 lines

Am 18.10.2014 um 16:23 schrieb Manfred Schlaegl:

Quoted 1 line

The pointer to bp stack-frame is no longer used. Removed it.

Good catch!

Thank you.

Quoted 4 lines
Quoted 2 lines

This also removes a corresponding compiler-warning.

Which warning exactly?

On "normal" (defconfig) builds the warning does not show up because CONFIG_FRAME_POINTER is set. I've found the unused bp because CONFIG_FRAME_POINTER was not set in my configuration.

CC arch/um/kernel/sysrq.o
arch/um/kernel/sysrq.c: In function ‘show_stack’:
arch/um/kernel/sysrq.c:32:29: warning: unused variable ‘bp’ [-Wunused-variable]

Quoted 7 lines
Quoted 5 lines

Looks like my gcc need's an upgrade. :D

Thanks,
//richard

I'm using gcc version 4.7.2 (Debian 4.7.2-5). -> not THAT new ;-)

With a cup of coffee applied I managed it to read your mail correctly. The warning triggers only with CONFIG_FRAME_POINTER=n. Now it makes sense.

Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#6 lore raw
Quoted 24 lines · Richard Weinberger

Am 18.10.2014 um 17:24 schrieb Manfred Schlaegl:

Quoted 23 lines · Richard Weinberger
Quoted 22 lines

Am 18.10.2014 um 17:12 schrieb Manfred Schlaegl:

Quoted 10 lines · Richard Weinberger
Quoted 4 lines

Am 18.10.2014 um 16:23 schrieb Manfred Schlaegl:

Quoted 1 line

The pointer to bp stack-frame is no longer used. Removed it.

Good catch!

Thank you.

Quoted 3 lines
Quoted 2 lines

This also removes a corresponding compiler-warning.

Quoted 8 lines
Quoted 1 line

Which warning exactly?

On "normal" (defconfig) builds the warning does not show up because CONFIG_FRAME_POINTER is set. I've found the unused bp because CONFIG_FRAME_POINTER was not set in my configuration.

CC arch/um/kernel/sysrq.o
arch/um/kernel/sysrq.c: In function ‘show_stack’:
arch/um/kernel/sysrq.c:32:29: warning: unused variable ‘bp’ [-Wunused-variable]

Looks like my gcc need's an upgrade. :D

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Thanks,
//richard

I'm using gcc version 4.7.2 (Debian 4.7.2-5). -> not THAT new ;-)

With a cup of coffee applied I managed it to read your mail correctly. The warning triggers only with CONFIG_FRAME_POINTER=n. Now it makes sense.

Misunderstanding solved! Miracle cure caffeine ;-)

greetings
manfred

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/