lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1290584209.11971.49.camel@Joe-Laptop>
Date:	Tue, 23 Nov 2010 23:36:49 -0800
From:	Joe Perches <joe@...ches.com>
To:	Dave Jones <davej@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>, x86 <x86@...nel.org>
Cc:	cpufreq@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] 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 <joe@...ches.com>
---
 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(-)

diff --git a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
index 4f6f679..14dec2b 100644
--- a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
@@ -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));
 
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c b/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
index 8abd869..5872f4da 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
@@ -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);
 
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index c3e9de8..117b921 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -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 */
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ