2006-05-19 03:49:27

by Stephane Ouellette

[permalink] [raw]
Subject: [PATCH] Compile warning because of an uninitialized variable

Folks,

gcc generates a warning because of an uninitialized variable in arch/i386/kernel/cpu/transmeta.c.
The variable "cpu_freq" is initialized by a call to cpuid(). The following patch fixes the warning.

Regards,

Stephane.


Attachments:
transmetta.c.patch (424.00 B)

2006-05-19 03:59:35

by Dave Jones

[permalink] [raw]
Subject: Re: [PATCH] Compile warning because of an uninitialized variable

On Thu, May 18, 2006 at 11:49:25PM -0400, Stephane Ouellette wrote:
> Folks,
>
> gcc generates a warning because of an uninitialized variable in
> arch/i386/kernel/cpu/transmeta.c.
> The variable "cpu_freq" is initialized by a call to cpuid(). The following
> patch fixes the warning.

This is a gcc bug. The variable is passed by reference
to a function where the assignment is made.
The second time it's used, if that > 80860002 condition
is satisfied, we *must* have satisfied the previous
check where we made the assignment, as 'max' hasn't changed
between the two checks.

Dave

--
http://www.codemonkey.org.uk