cpufreq: change print_once to printk_once
Subsystems (2)
PATCH 1/1 cpufreq: change print_once to printk_once
Replace the print_once code blocks with the printk_once macro.
Signed-off-by H Hartley Sweeten <[email protected]>
---
arch/x86/kernel/cpu/cpufreq/powernow-k8.c +1 -9
@@ -1221,7 +1221,6 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)struct powernow_k8_data *data;cpumask_t oldmask;int rc; -static int print_once;if (!cpu_online (pol->cpu))return -ENODEV ;
@@ -1244,19 +1243,12 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)* an UP version, and is deprecated by AMD. */ if (num_online_cpus () !=1 ) { -/* -* Replace this one with print_once as soon as such a -* thing gets introduced -*/ -if (!print_once) { - WARN_ONCE(1, KERN_ERR FW_BUG PFX "Your BIOS " + printk_once(KERN_ERR FW_BUG PFX "Your BIOS ""does not provide ACPI _PSS objects " "in a way that Linux understands. " "Please report this to the Linux ACPI" " maintainers and complain to your " "BIOS vendor.\n"); - print_once++; - } goto err_out; }if (pol->cpu !=0 ) {
drivers/cpufreq/cpufreq_conservative.c +4 -12
@@ -179,26 +179,18 @@ static struct notifier_block dbs_cpufreq_notifier_block = {/************************** sysfs interface ************************/ static ssize_t show_sampling_rate_max (struct cpufreq_policy *policy,char *buf) { -static int print_once; - -if (!print_once) { -printk (KERN_INFO "CPUFREQ: conservative sampling_rate_max " +printk_once (KERN_INFO "CPUFREQ: conservative sampling_rate_max " "sysfs file is deprecated - used by: %s\n" , current->comm); - print_once =1 ; - } +return sprintf (buf,"%u\n" ,MAX_SAMPLING_RATE ); }static ssize_t show_sampling_rate_min (struct cpufreq_policy *policy,char *buf) { -static int print_once; - -if (!print_once) { -printk (KERN_INFO "CPUFREQ: conservative sampling_rate_max " +printk_once (KERN_INFO "CPUFREQ: conservative sampling_rate_max " "sysfs file is deprecated - used by: %s\n" , current->comm); - print_once =1 ; - } +return sprintf (buf,"%u\n" ,MIN_SAMPLING_RATE ); }
drivers/cpufreq/cpufreq_ondemand.c +4 -12
@@ -216,27 +216,19 @@ static void ondemand_powersave_bias_init(void)/************************** sysfs interface ************************/ static ssize_t show_sampling_rate_max (struct cpufreq_policy *policy,char *buf) { -static int print_once; - -if (!print_once) { -printk (KERN_INFO "CPUFREQ: ondemand sampling_rate_max " +printk_once (KERN_INFO "CPUFREQ: ondemand sampling_rate_max " "sysfs file is deprecated - used by: %s\n" , current->comm); - print_once =1 ; - } +return sprintf (buf,"%u\n" ,MAX_SAMPLING_RATE ); }static ssize_t show_sampling_rate_min (struct cpufreq_policy *policy,char *buf) { -static int print_once; - -if (!print_once) { -printk (KERN_INFO "CPUFREQ: ondemand sampling_rate_min " +printk_once (KERN_INFO "CPUFREQ: ondemand sampling_rate_min " "sysfs file is deprecated - used by: %s\n" , current->comm); - print_once =1 ; - } +return sprintf (buf,"%u\n" ,MIN_SAMPLING_RATE ); }