Skip to contentSkip to conversation

arch/x86_64/kernel/apic.c(701): remark #593: variable "ver" was set but never us

PATCH In review d binderman 4 participants 5 messages Nov 21, 2006

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw

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

Reported by D Binderman <[email protected]>.

---
 arch/x86_64/kernel/apic.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
arch/x86_64/kernel/apic.c +1 -3
index 4d9d5ed..96743aa 100644
@@ -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))
#2 lore raw
Quoted 4 lines · David Rientjes

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

Reported by D Binderman <[email protected]>.

Added thanks.

-Andi

#3 lore raw

PATCH 1/1 x86_64 __setup_APIC_LVTT(): remove unused variable

In reply to d binderman
Quoted 11 lines · d binderman

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

Quoted 6 lines

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.

Quoted 3 lines

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.

arch/x86_64/kernel/apic.c renamed from arch/x86_64/kernel/apic.c.old +1 -2
@@ -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))
#4 lore raw

Re: [2.6 patch] x86_64 __setup_APIC_LVTT(): remove unused variable

Quoted 4 lines

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