2006-11-21 19:46:50

by David Binderman

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


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


2006-11-21 20:18:29

by David Rientjes

[permalink] [raw]
Subject: Re: arch/x86_64/kernel/apic.c(701): remark #593: variable "ver" was set but never us

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

Reported by D Binderman <[email protected]>.

Cc: Andi Kleen <[email protected]>
Cc: Ingo Molnar <[email protected]>
Signed-off-by: David Rientjes <[email protected]>
---
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))

2006-11-21 20:20:47

by Adrian Bunk

[permalink] [raw]
Subject: [2.6 patch] x86_64 __setup_APIC_LVTT(): remove unused variable

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 <[email protected]>

--- 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))

2006-11-21 20:24:11

by Andi Kleen

[permalink] [raw]
Subject: Re: arch/x86_64/kernel/apic.c(701): remark #593: variable "ver" was set but never us

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 <[email protected]>.

Added thanks.


-Andi

2006-11-21 20:24:12

by Andi Kleen

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


>
> 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