public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* arch/x86_64/kernel/apic.c(701): remark #593: variable "ver" was set but never us
@ 2006-11-21 19:46 d binderman
  2006-11-21 20:18 ` David Rientjes
  2006-11-21 20:20 ` [2.6 patch] x86_64 __setup_APIC_LVTT(): remove unused variable Adrian Bunk
  0 siblings, 2 replies; 5+ messages in thread
From: d binderman @ 2006-11-21 19:46 UTC (permalink / raw)
  To: Linux-Kernel


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/kernel/apic.c(701): remark #593: variable "ver" was set but 
never used

The source code is

    unsigned int lvtt_value, tmp_value, ver;

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: arch/x86_64/kernel/apic.c(701): remark #593: variable "ver" was set but never us
  2006-11-21 19:46 arch/x86_64/kernel/apic.c(701): remark #593: variable "ver" was set but never us d binderman
@ 2006-11-21 20:18 ` David Rientjes
  2006-11-21 20:22   ` Andi Kleen
  2006-11-21 20:20 ` [2.6 patch] x86_64 __setup_APIC_LVTT(): remove unused variable Adrian Bunk
  1 sibling, 1 reply; 5+ messages in thread
From: David Rientjes @ 2006-11-21 20:18 UTC (permalink / raw)
  To: d binderman; +Cc: Andi Kleen, Ingo Molnar, linux-kernel

Remove unused GET_APIC_VERSION call from clear_local_APIC() and 
__setup_APIC_LVTT().

Reported by D Binderman <dcb314@hotmail.com>.

Cc: Andi Kleen <ak@suse.de>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: David Rientjes <rientjes@cs.washington.edu>
---
 arch/x86_64/kernel/apic.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c
index 4d9d5ed..96743aa 100644
--- a/arch/x86_64/kernel/apic.c
+++ b/arch/x86_64/kernel/apic.c
@@ -133,7 +133,6 @@ void clear_local_APIC(void)
 		apic_write(APIC_LVTERR, APIC_LVT_MASKED);
 	if (maxlvt >= 4)
 		apic_write(APIC_LVTPC, APIC_LVT_MASKED);
-	v = GET_APIC_VERSION(apic_read(APIC_LVR));
 	apic_write(APIC_ESR, 0);
 	apic_read(APIC_ESR);
 }
@@ -644,10 +643,9 @@ #define APIC_DIVISOR 16
 
 static void __setup_APIC_LVTT(unsigned int clocks)
 {
-	unsigned int lvtt_value, tmp_value, ver;
+	unsigned int lvtt_value, tmp_value;
 	int cpu = smp_processor_id();
 
-	ver = GET_APIC_VERSION(apic_read(APIC_LVR));
 	lvtt_value = APIC_LVT_TIMER_PERIODIC | LOCAL_TIMER_VECTOR;
 
 	if (cpu_isset(cpu, timer_interrupt_broadcast_ipi_mask))

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [2.6 patch] x86_64 __setup_APIC_LVTT(): remove unused variable
  2006-11-21 19:46 arch/x86_64/kernel/apic.c(701): remark #593: variable "ver" was set but never us d binderman
  2006-11-21 20:18 ` David Rientjes
@ 2006-11-21 20:20 ` Adrian Bunk
  2006-11-21 20:23   ` Andi Kleen
  1 sibling, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2006-11-21 20:20 UTC (permalink / raw)
  To: d binderman, ak; +Cc: Linux-Kernel, discuss, mingo

On Tue, Nov 21, 2006 at 07:46:46PM +0000, d binderman wrote:
> 
> 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/kernel/apic.c(701): remark #593: variable "ver" was set but 
> never used
> 
> The source code is
> 
>    unsigned int lvtt_value, tmp_value, ver;
> 
> I have checked the source code and I agree with the compiler.
> Suggest delete local variable.

Thanks for your report, patch below.

> Regards
> 
> David Binderman

cu
Adrian


<--  snip  -->


This patch removes a variable that whose usage was removed some time ago 
by Andi.

Spotted by the Intel C compiler.

Reported by David Binderman.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.19-rc5-mm2/arch/x86_64/kernel/apic.c.old	2006-11-21 21:17:03.000000000 +0100
+++ linux-2.6.19-rc5-mm2/arch/x86_64/kernel/apic.c	2006-11-21 21:17:16.000000000 +0100
@@ -722,10 +722,9 @@
 
 static void __setup_APIC_LVTT(unsigned int clocks)
 {
-	unsigned int lvtt_value, tmp_value, ver;
+	unsigned int lvtt_value, tmp_value;
 	int cpu = smp_processor_id();
 
-	ver = GET_APIC_VERSION(apic_read(APIC_LVR));
 	lvtt_value = APIC_LVT_TIMER_PERIODIC | LOCAL_TIMER_VECTOR;
 
 	if (cpu_isset(cpu, timer_interrupt_broadcast_ipi_mask))


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: arch/x86_64/kernel/apic.c(701): remark #593: variable "ver" was set but never us
  2006-11-21 20:18 ` David Rientjes
@ 2006-11-21 20:22   ` Andi Kleen
  0 siblings, 0 replies; 5+ messages in thread
From: Andi Kleen @ 2006-11-21 20:22 UTC (permalink / raw)
  To: David Rientjes; +Cc: d binderman, Ingo Molnar, linux-kernel

On Tuesday 21 November 2006 21:18, David Rientjes wrote:
> Remove unused GET_APIC_VERSION call from clear_local_APIC() and 
> __setup_APIC_LVTT().
> 
> Reported by D Binderman <dcb314@hotmail.com>.

Added thanks.


-Andi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [2.6 patch] x86_64 __setup_APIC_LVTT(): remove unused variable
  2006-11-21 20:20 ` [2.6 patch] x86_64 __setup_APIC_LVTT(): remove unused variable Adrian Bunk
@ 2006-11-21 20:23   ` Andi Kleen
  0 siblings, 0 replies; 5+ messages in thread
From: Andi Kleen @ 2006-11-21 20:23 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: d binderman, Linux-Kernel, discuss, mingo


> 
> This patch removes a variable that whose usage was removed some time ago 
> by Andi.

Thanks.

I already got the similar patch from David Rientjes. 
-Andi

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-11-21 20:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-21 19:46 arch/x86_64/kernel/apic.c(701): remark #593: variable "ver" was set but never us d binderman
2006-11-21 20:18 ` David Rientjes
2006-11-21 20:22   ` Andi Kleen
2006-11-21 20:20 ` [2.6 patch] x86_64 __setup_APIC_LVTT(): remove unused variable Adrian Bunk
2006-11-21 20:23   ` Andi Kleen

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