cpufreq: Add __attribute__((format (printf...) to cpufreq_debug_printk and fix fallout
Subsystems (2)
PATCH 1/1 cpufreq: Add __attribute__((format (printf...) to cpufreq_debug_printk and fix fallout
Add __attribute__((format (printf, 3, 4))) to cpufreq_debug_printk. Use no_printk in !CONFIG_CPU_FREQ_DEBUG.
Make formats and arguments match.
Signed-off-by Joe Perches <[email protected]>
--- arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c | 6 +++--- arch/x86/kernel/cpu/cpufreq/speedstep-smi.c | 4 ++-- include/linux/cpufreq.h | 8 +++++--- 3 files changed, 10 insertions(+), 8 deletions(-)
arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c +3 -3
@@ -178,8 +178,8 @@ static unsigned int pcc_get_freq(unsigned int cpu) curr_freq = (((ioread32 (&pcch_hdr->nominal) * (output_buffer &0xff )) /100 ) *1000 ); -dprintk ("get: SUCCESS: (virtual) output_offset for cpu %d is " -"0x%x, contains a value of: 0x%x. Speed is: %d MHz\n" , +dprintk ("get: SUCCESS: (virtual) output_offset for cpu %d is %p, " +"contains a value of: 0x%x. Speed is: %d MHz\n" , cpu, (pcch_virt_addr + pcc_cpu_data->output_offset), output_buffer, curr_freq);
@@ -213,7 +213,7 @@ static int pcc_cpufreq_target(struct cpufreq_policy *policy, pcc_cpu_data =per_cpu_ptr (pcc_cpu_info, cpu);dprintk ("target: CPU %d should go to target freq: %d " -"(virtual) input_offset is 0x%x\n" , +"(virtual) input_offset is %p\n" , cpu, target_freq, (pcch_virt_addr + pcc_cpu_data->input_offset));
arch/x86/kernel/cpu/cpufreq/speedstep-smi.c +2 -2
@@ -407,8 +407,8 @@ 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);
include/linux/cpufreq.h +5 -3
@@ -416,12 +416,14 @@ 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, ...); +extern __attribute__((format (printf,3 ,4 ))) +void cpufreq_debug_printk (unsigned int type,const char *prefix, +const char *fmt, ...);#else -#define cpufreq_debug_printk(msg...) do { } while(0) +#define cpufreq_debug_printk (type, prefix, fmt, ...) \ + no_printk(fmt, ##__VA_ARGS__)#endif /* CONFIG_CPU_FREQ_DEBUG */