* [PATCH] Compile warning because of an uninitialized variable
@ 2006-05-19 3:49 Stephane Ouellette
2006-05-19 3:59 ` Dave Jones
0 siblings, 1 reply; 2+ messages in thread
From: Stephane Ouellette @ 2006-05-19 3:49 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 231 bytes --]
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.
[-- Attachment #2: transmetta.c.patch --]
[-- Type: text/x-patch, Size: 424 bytes --]
--- linux-2.6.16.16/arch/i386/kernel/cpu/transmeta.c 2006-05-04 20:03:45.000000000 -0400
+++ linux-2.6.16.16-fixed/arch/i386/kernel/cpu/transmeta.c 2006-05-18 15:19:52.000000000 -0400
@@ -18,6 +18,7 @@
/* Print CMS and CPU revision */
max = cpuid_eax(0x80860000);
cpu_rev = 0;
+ cpu_freq = 0;
if ( max >= 0x80860001 ) {
cpuid(0x80860001, &dummy, &cpu_rev, &cpu_freq, &cpu_flags);
if (cpu_rev != 0x02000000) {
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Compile warning because of an uninitialized variable
2006-05-19 3:49 [PATCH] Compile warning because of an uninitialized variable Stephane Ouellette
@ 2006-05-19 3:59 ` Dave Jones
0 siblings, 0 replies; 2+ messages in thread
From: Dave Jones @ 2006-05-19 3:59 UTC (permalink / raw)
To: Stephane Ouellette; +Cc: linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-05-19 3:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-19 3:49 [PATCH] Compile warning because of an uninitialized variable Stephane Ouellette
2006-05-19 3:59 ` Dave Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox