* [PATCH]add gcc printf format checking and fix wrong format in speedstep-smi.c
@ 2008-01-06 13:27 Helge Deller
2008-01-06 20:18 ` Helge Deller
0 siblings, 1 reply; 2+ messages in thread
From: Helge Deller @ 2008-01-06 13:27 UTC (permalink / raw)
To: cpufreq, davej
[PATCH] [CPUFREQ] add gcc printf format checking to cpufreq.h
ist_info.signature and the other variables in speedstep-smi.c are of type
"unsigned int", not "unsigned long". Detected with the added printf
format check.
Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 23932d7..7a276a6 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -365,7 +365,7 @@ void cpufreq_frequency_table_put_attr(unsigned int cpu);
#ifdef CONFIG_CPU_FREQ_DEBUG
extern void cpufreq_debug_printk(unsigned int type, const char *prefix,
- const char *fmt, ...);
+ const char *fmt, ...) __printf(3,4);
#else
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c b/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
index f2b5a62..f0dffe9 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
@@ -368,7 +368,7 @@ static int __init speedstep_init(void)
return -ENODEV;
}
- dprintk("signature:0x%.8lx, command:0x%.8lx, event:0x%.8lx, perf_level:0x%.8lx.\n",
+ dprintk("signature:0x%.8x, command:0x%.8x, event:0x%.8x, perf_level:0x%.8x.\n",
ist_info.signature, ist_info.command, ist_info.event, ist_info.perf_level);
/* Error if no IST-SMI BIOS or no PARM
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH]add gcc printf format checking and fix wrong format in speedstep-smi.c
2008-01-06 13:27 [PATCH]add gcc printf format checking and fix wrong format in speedstep-smi.c Helge Deller
@ 2008-01-06 20:18 ` Helge Deller
0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2008-01-06 20:18 UTC (permalink / raw)
To: cpufreq; +Cc: davej
Updated patch below
==============
[PATCH] [CPUFREQ] add gcc printf format checking to cpufreq.h
ist_info.signature and the other variables in speedstep-smi.c are of type
"unsigned int", not "unsigned long". Detected with the added printf
format check.
Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c b/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
index f2b5a62..f0dffe9 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
@@ -368,7 +368,7 @@ static int __init speedstep_init(void)
return -ENODEV;
}
- dprintk("signature:0x%.8lx, command:0x%.8lx, event:0x%.8lx, perf_level:0x%.8lx.\n",
+ dprintk("signature:0x%.8x, command:0x%.8x, event:0x%.8x, perf_level:0x%.8x.\n",
ist_info.signature, ist_info.command, ist_info.event, ist_info.perf_level);
/* Error if no IST-SMI BIOS or no PARM
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 23932d7..774add6 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -365,7 +365,7 @@ void cpufreq_frequency_table_put_attr(unsigned int cpu);
#ifdef CONFIG_CPU_FREQ_DEBUG
extern void cpufreq_debug_printk(unsigned int type, const char *prefix,
- const char *fmt, ...);
+ const char *fmt, ...) __attribute__ ((format(printf,3,4)));
#else
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-01-06 20:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-06 13:27 [PATCH]add gcc printf format checking and fix wrong format in speedstep-smi.c Helge Deller
2008-01-06 20:18 ` Helge Deller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.