* [PATCH] Prevent usage of uninitialized variable in transmeta cpu driver
@ 2006-07-23 21:48 Johannes Weiner
2006-07-23 23:57 ` Jiri Slaby
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Weiner @ 2006-07-23 21:48 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 142 bytes --]
This patch fixes a gcc-`uninitialized' warning in
arch/i386/kernel/cpu/transmeta.c.
Signed-off-by: Johannes Weiner <hnazfoo@gmail.com>
---
[-- Attachment #2: transmeta-suppress-warning.patch --]
[-- Type: text/plain, Size: 1023 bytes --]
diff --git a/arch/i386/kernel/cpu/transmeta.c b/arch/i386/kernel/cpu/transmeta.c
index 7214c9b..5b71071 100644
--- a/arch/i386/kernel/cpu/transmeta.c
+++ b/arch/i386/kernel/cpu/transmeta.c
@@ -17,9 +17,9 @@ static void __init init_transmeta(struct
/* Print CMS and CPU revision */
max = cpuid_eax(0x80860000);
- cpu_rev = 0;
+ cpu_rev = cpu_freq = 0;
if ( max >= 0x80860001 ) {
- cpuid(0x80860001, &dummy, &cpu_rev, &cpu_freq, &cpu_flags);
+ cpuid(0x80860001, &dummy, &cpu_rev, &cpu_freq, &cpu_flags);
if (cpu_rev != 0x02000000) {
printk(KERN_INFO "CPU: Processor revision %u.%u.%u.%u, %u MHz\n",
(cpu_rev >> 24) & 0xff,
@@ -72,7 +72,7 @@ static void __init init_transmeta(struct
wrmsr(0x80860004, ~0, uk);
c->x86_capability[0] = cpuid_edx(0x00000001);
wrmsr(0x80860004, cap_mask, uk);
-
+
/* If we can run i686 user-space code, call us an i686 */
#define USER686 (X86_FEATURE_TSC|X86_FEATURE_CX8|X86_FEATURE_CMOV)
if ( c->x86 == 5 && (c->x86_capability[0] & USER686) == USER686 )
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] Prevent usage of uninitialized variable in transmeta cpu driver
2006-07-23 21:48 [PATCH] Prevent usage of uninitialized variable in transmeta cpu driver Johannes Weiner
@ 2006-07-23 23:57 ` Jiri Slaby
2006-07-24 5:46 ` Johannes Weiner
0 siblings, 1 reply; 3+ messages in thread
From: Jiri Slaby @ 2006-07-23 23:57 UTC (permalink / raw)
To: hnazfoo; +Cc: linux-kernel
Johannes Weiner napsal(a):
> This patch fixes a gcc-`uninitialized' warning in
> arch/i386/kernel/cpu/transmeta.c.
NACK.
Gcc bug, don't hide it (I don't really know, why cpu_rev is zeroed).
[Post only whitespace changes. And note that such changes should be in separated
patches.]
>
> Signed-off-by: Johannes Weiner <hnazfoo@gmail.com>
>
> ---
>
>
> ------------------------------------------------------------------------
>
> diff --git a/arch/i386/kernel/cpu/transmeta.c b/arch/i386/kernel/cpu/transmeta.c
> index 7214c9b..5b71071 100644
> --- a/arch/i386/kernel/cpu/transmeta.c
> +++ b/arch/i386/kernel/cpu/transmeta.c
> @@ -17,9 +17,9 @@ static void __init init_transmeta(struct
>
> /* Print CMS and CPU revision */
> max = cpuid_eax(0x80860000);
> - cpu_rev = 0;
> + cpu_rev = cpu_freq = 0;
> if ( max >= 0x80860001 ) {
> - cpuid(0x80860001, &dummy, &cpu_rev, &cpu_freq, &cpu_flags);
> + cpuid(0x80860001, &dummy, &cpu_rev, &cpu_freq, &cpu_flags);
> if (cpu_rev != 0x02000000) {
> printk(KERN_INFO "CPU: Processor revision %u.%u.%u.%u, %u MHz\n",
> (cpu_rev >> 24) & 0xff,
> @@ -72,7 +72,7 @@ static void __init init_transmeta(struct
> wrmsr(0x80860004, ~0, uk);
> c->x86_capability[0] = cpuid_edx(0x00000001);
> wrmsr(0x80860004, cap_mask, uk);
> -
> +
> /* If we can run i686 user-space code, call us an i686 */
> #define USER686 (X86_FEATURE_TSC|X86_FEATURE_CX8|X86_FEATURE_CMOV)
> if ( c->x86 == 5 && (c->x86_capability[0] & USER686) == USER686 )
regards,
--
<a href="http://www.fi.muni.cz/~xslaby/">Jiri Slaby</a>
faculty of informatics, masaryk university, brno, cz
e-mail: jirislaby gmail com, gpg pubkey fingerprint:
B674 9967 0407 CE62 ACC8 22A0 32CC 55C3 39D4 7A7E
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] Prevent usage of uninitialized variable in transmeta cpu driver
2006-07-23 23:57 ` Jiri Slaby
@ 2006-07-24 5:46 ` Johannes Weiner
0 siblings, 0 replies; 3+ messages in thread
From: Johannes Weiner @ 2006-07-24 5:46 UTC (permalink / raw)
To: linux-kernel
Hi,
On Mon, Jul 24, 2006 at 01:56:44AM +0159, Jiri Slaby wrote:
> Johannes Weiner napsal(a):
> > This patch fixes a gcc-`uninitialized' warning in
> > arch/i386/kernel/cpu/transmeta.c.
>
> NACK.
>
> Gcc bug, don't hide it (I don't really know, why cpu_rev is zeroed).
Ok. This GCC release I'm running (4.1.1) shows really a lot more of
them then the prior. Should have wondered and thought about it before ;)
Hannes
--
#include <stdio.h>
char *love[] = { "this", "language" };
#define gimme(s) #s, 0[s], 0[s+1]
int main(void) { printf("%s %s %s\n", gimme(love)); return 0; }
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-07-24 5:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-23 21:48 [PATCH] Prevent usage of uninitialized variable in transmeta cpu driver Johannes Weiner
2006-07-23 23:57 ` Jiri Slaby
2006-07-24 5:46 ` Johannes Weiner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox