add gcc printf format checking and fix wrong format in speedstep-smi.c
Subsystems (2)
PATCH 1/1 add gcc printf format checking and fix wrong format in speedstep-smi.c
[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 <[email protected]>
include/linux/cpufreq.h +1 -1
@@ -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
arch/x86/kernel/cpu/cpufreq/speedstep-smi.c +1 -1
@@ -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
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 <[email protected]>
arch/x86/kernel/cpu/cpufreq/speedstep-smi.c +1 -1
@@ -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
include/linux/cpufreq.h +1 -1
@@ -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