diff options
author | Joe Perches <joe@perches.com> | 2014-03-11 13:03:00 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-03-11 19:49:22 -0400 |
commit | e837f9b58b83a705c9c14b26c3ee29fd9870322e (patch) | |
tree | d6c85eb6f8c3e2c406e8d9dc88ba0f8cfb309d58 /drivers/cpufreq/cpufreq.c | |
parent | d351cb31146833b67b6db7e46dcd6cb766d584ae (diff) |
cpufreq: Reformat printk() statements
- Add missing newlines
- Coalesce format fragments
- Convert printks to pr_<level>
- Align arguments
Based-on-patch-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 75 |
1 files changed, 35 insertions, 40 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 61dd72b8c143..746f70875078 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -182,8 +182,8 @@ unsigned int cpufreq_generic_get(unsigned int cpu) | |||
182 | struct cpufreq_policy *policy = per_cpu(cpufreq_cpu_data, cpu); | 182 | struct cpufreq_policy *policy = per_cpu(cpufreq_cpu_data, cpu); |
183 | 183 | ||
184 | if (!policy || IS_ERR(policy->clk)) { | 184 | if (!policy || IS_ERR(policy->clk)) { |
185 | pr_err("%s: No %s associated to cpu: %d\n", __func__, | 185 | pr_err("%s: No %s associated to cpu: %d\n", |
186 | policy ? "clk" : "policy", cpu); | 186 | __func__, policy ? "clk" : "policy", cpu); |
187 | return 0; | 187 | return 0; |
188 | } | 188 | } |
189 | 189 | ||
@@ -255,15 +255,15 @@ static void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci) | |||
255 | if (!l_p_j_ref_freq) { | 255 | if (!l_p_j_ref_freq) { |
256 | l_p_j_ref = loops_per_jiffy; | 256 | l_p_j_ref = loops_per_jiffy; |
257 | l_p_j_ref_freq = ci->old; | 257 | l_p_j_ref_freq = ci->old; |
258 | pr_debug("saving %lu as reference value for loops_per_jiffy; " | 258 | pr_debug("saving %lu as reference value for loops_per_jiffy; freq is %u kHz\n", |
259 | "freq is %u kHz\n", l_p_j_ref, l_p_j_ref_freq); | 259 | l_p_j_ref, l_p_j_ref_freq); |
260 | } | 260 | } |
261 | if ((val == CPUFREQ_POSTCHANGE && ci->old != ci->new) || | 261 | if ((val == CPUFREQ_POSTCHANGE && ci->old != ci->new) || |
262 | (val == CPUFREQ_RESUMECHANGE || val == CPUFREQ_SUSPENDCHANGE)) { | 262 | (val == CPUFREQ_RESUMECHANGE || val == CPUFREQ_SUSPENDCHANGE)) { |
263 | loops_per_jiffy = cpufreq_scale(l_p_j_ref, l_p_j_ref_freq, | 263 | loops_per_jiffy = cpufreq_scale(l_p_j_ref, l_p_j_ref_freq, |
264 | ci->new); | 264 | ci->new); |
265 | pr_debug("scaling loops_per_jiffy to %lu " | 265 | pr_debug("scaling loops_per_jiffy to %lu for frequency %u kHz\n", |
266 | "for frequency %u kHz\n", loops_per_jiffy, ci->new); | 266 | loops_per_jiffy, ci->new); |
267 | } | 267 | } |
268 | } | 268 | } |
269 | #else | 269 | #else |
@@ -283,7 +283,7 @@ static void __cpufreq_notify_transition(struct cpufreq_policy *policy, | |||
283 | 283 | ||
284 | freqs->flags = cpufreq_driver->flags; | 284 | freqs->flags = cpufreq_driver->flags; |
285 | pr_debug("notification %u of frequency transition to %u kHz\n", | 285 | pr_debug("notification %u of frequency transition to %u kHz\n", |
286 | state, freqs->new); | 286 | state, freqs->new); |
287 | 287 | ||
288 | switch (state) { | 288 | switch (state) { |
289 | 289 | ||
@@ -295,9 +295,8 @@ static void __cpufreq_notify_transition(struct cpufreq_policy *policy, | |||
295 | if (!(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) { | 295 | if (!(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) { |
296 | if ((policy) && (policy->cpu == freqs->cpu) && | 296 | if ((policy) && (policy->cpu == freqs->cpu) && |
297 | (policy->cur) && (policy->cur != freqs->old)) { | 297 | (policy->cur) && (policy->cur != freqs->old)) { |
298 | pr_debug("Warning: CPU frequency is" | 298 | pr_debug("Warning: CPU frequency is %u, cpufreq assumed %u kHz\n", |
299 | " %u, cpufreq assumed %u kHz.\n", | 299 | freqs->old, policy->cur); |
300 | freqs->old, policy->cur); | ||
301 | freqs->old = policy->cur; | 300 | freqs->old = policy->cur; |
302 | } | 301 | } |
303 | } | 302 | } |
@@ -308,8 +307,8 @@ static void __cpufreq_notify_transition(struct cpufreq_policy *policy, | |||
308 | 307 | ||
309 | case CPUFREQ_POSTCHANGE: | 308 | case CPUFREQ_POSTCHANGE: |
310 | adjust_jiffies(CPUFREQ_POSTCHANGE, freqs); | 309 | adjust_jiffies(CPUFREQ_POSTCHANGE, freqs); |
311 | pr_debug("FREQ: %lu - CPU: %lu", (unsigned long)freqs->new, | 310 | pr_debug("FREQ: %lu - CPU: %lu\n", |
312 | (unsigned long)freqs->cpu); | 311 | (unsigned long)freqs->new, (unsigned long)freqs->cpu); |
313 | trace_cpu_frequency(freqs->new, freqs->cpu); | 312 | trace_cpu_frequency(freqs->new, freqs->cpu); |
314 | srcu_notifier_call_chain(&cpufreq_transition_notifier_list, | 313 | srcu_notifier_call_chain(&cpufreq_transition_notifier_list, |
315 | CPUFREQ_POSTCHANGE, freqs); | 314 | CPUFREQ_POSTCHANGE, freqs); |
@@ -369,13 +368,13 @@ static ssize_t store_boost(struct kobject *kobj, struct attribute *attr, | |||
369 | return -EINVAL; | 368 | return -EINVAL; |
370 | 369 | ||
371 | if (cpufreq_boost_trigger_state(enable)) { | 370 | if (cpufreq_boost_trigger_state(enable)) { |
372 | pr_err("%s: Cannot %s BOOST!\n", __func__, | 371 | pr_err("%s: Cannot %s BOOST!\n", |
373 | enable ? "enable" : "disable"); | 372 | __func__, enable ? "enable" : "disable"); |
374 | return -EINVAL; | 373 | return -EINVAL; |
375 | } | 374 | } |
376 | 375 | ||
377 | pr_debug("%s: cpufreq BOOST %s\n", __func__, | 376 | pr_debug("%s: cpufreq BOOST %s\n", |
378 | enable ? "enabled" : "disabled"); | 377 | __func__, enable ? "enabled" : "disabled"); |
379 | 378 | ||
380 | return count; | 379 | return count; |
381 | } | 380 | } |
@@ -1264,7 +1263,7 @@ static int cpufreq_nominate_new_policy_cpu(struct cpufreq_policy *policy, | |||
1264 | sysfs_remove_link(&cpu_dev->kobj, "cpufreq"); | 1263 | sysfs_remove_link(&cpu_dev->kobj, "cpufreq"); |
1265 | ret = kobject_move(&policy->kobj, &cpu_dev->kobj); | 1264 | ret = kobject_move(&policy->kobj, &cpu_dev->kobj); |
1266 | if (ret) { | 1265 | if (ret) { |
1267 | pr_err("%s: Failed to move kobj: %d", __func__, ret); | 1266 | pr_err("%s: Failed to move kobj: %d\n", __func__, ret); |
1268 | 1267 | ||
1269 | down_write(&policy->rwsem); | 1268 | down_write(&policy->rwsem); |
1270 | cpumask_set_cpu(old_cpu, policy->cpus); | 1269 | cpumask_set_cpu(old_cpu, policy->cpus); |
@@ -1330,7 +1329,7 @@ static int __cpufreq_remove_dev_prepare(struct device *dev, | |||
1330 | 1329 | ||
1331 | if (!frozen) { | 1330 | if (!frozen) { |
1332 | pr_debug("%s: policy Kobject moved to cpu: %d from: %d\n", | 1331 | pr_debug("%s: policy Kobject moved to cpu: %d from: %d\n", |
1333 | __func__, new_cpu, cpu); | 1332 | __func__, new_cpu, cpu); |
1334 | } | 1333 | } |
1335 | } | 1334 | } |
1336 | } | 1335 | } |
@@ -1370,7 +1369,7 @@ static int __cpufreq_remove_dev_finish(struct device *dev, | |||
1370 | CPUFREQ_GOV_POLICY_EXIT); | 1369 | CPUFREQ_GOV_POLICY_EXIT); |
1371 | if (ret) { | 1370 | if (ret) { |
1372 | pr_err("%s: Failed to exit governor\n", | 1371 | pr_err("%s: Failed to exit governor\n", |
1373 | __func__); | 1372 | __func__); |
1374 | return ret; | 1373 | return ret; |
1375 | } | 1374 | } |
1376 | } | 1375 | } |
@@ -1398,7 +1397,7 @@ static int __cpufreq_remove_dev_finish(struct device *dev, | |||
1398 | if ((ret = __cpufreq_governor(policy, CPUFREQ_GOV_START)) || | 1397 | if ((ret = __cpufreq_governor(policy, CPUFREQ_GOV_START)) || |
1399 | (ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS))) { | 1398 | (ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS))) { |
1400 | pr_err("%s: Failed to start governor\n", | 1399 | pr_err("%s: Failed to start governor\n", |
1401 | __func__); | 1400 | __func__); |
1402 | return ret; | 1401 | return ret; |
1403 | } | 1402 | } |
1404 | } | 1403 | } |
@@ -1455,8 +1454,8 @@ static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq, | |||
1455 | struct cpufreq_freqs freqs; | 1454 | struct cpufreq_freqs freqs; |
1456 | unsigned long flags; | 1455 | unsigned long flags; |
1457 | 1456 | ||
1458 | pr_debug("Warning: CPU frequency out of sync: cpufreq and timing " | 1457 | pr_debug("Warning: CPU frequency out of sync: cpufreq and timing core thinks of %u, is %u kHz\n", |
1459 | "core thinks of %u, is %u kHz.\n", old_freq, new_freq); | 1458 | old_freq, new_freq); |
1460 | 1459 | ||
1461 | freqs.old = old_freq; | 1460 | freqs.old = old_freq; |
1462 | freqs.new = new_freq; | 1461 | freqs.new = new_freq; |
@@ -1780,7 +1779,7 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, | |||
1780 | target_freq = policy->min; | 1779 | target_freq = policy->min; |
1781 | 1780 | ||
1782 | pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n", | 1781 | pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n", |
1783 | policy->cpu, target_freq, relation, old_target_freq); | 1782 | policy->cpu, target_freq, relation, old_target_freq); |
1784 | 1783 | ||
1785 | /* | 1784 | /* |
1786 | * This might look like a redundant call as we are checking it again | 1785 | * This might look like a redundant call as we are checking it again |
@@ -1825,8 +1824,7 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, | |||
1825 | freqs.flags = 0; | 1824 | freqs.flags = 0; |
1826 | 1825 | ||
1827 | pr_debug("%s: cpu: %d, oldfreq: %u, new freq: %u\n", | 1826 | pr_debug("%s: cpu: %d, oldfreq: %u, new freq: %u\n", |
1828 | __func__, policy->cpu, freqs.old, | 1827 | __func__, policy->cpu, freqs.old, freqs.new); |
1829 | freqs.new); | ||
1830 | 1828 | ||
1831 | cpufreq_notify_transition(policy, &freqs, | 1829 | cpufreq_notify_transition(policy, &freqs, |
1832 | CPUFREQ_PRECHANGE); | 1830 | CPUFREQ_PRECHANGE); |
@@ -1835,7 +1833,7 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, | |||
1835 | retval = cpufreq_driver->target_index(policy, index); | 1833 | retval = cpufreq_driver->target_index(policy, index); |
1836 | if (retval) | 1834 | if (retval) |
1837 | pr_err("%s: Failed to change cpu frequency: %d\n", | 1835 | pr_err("%s: Failed to change cpu frequency: %d\n", |
1838 | __func__, retval); | 1836 | __func__, retval); |
1839 | 1837 | ||
1840 | if (notify) | 1838 | if (notify) |
1841 | cpufreq_notify_post_transition(policy, &freqs, retval); | 1839 | cpufreq_notify_post_transition(policy, &freqs, retval); |
@@ -1891,11 +1889,8 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, | |||
1891 | if (!gov) | 1889 | if (!gov) |
1892 | return -EINVAL; | 1890 | return -EINVAL; |
1893 | else { | 1891 | else { |
1894 | printk(KERN_WARNING "%s governor failed, too long" | 1892 | pr_warn("%s governor failed, too long transition latency of HW, fallback to %s governor\n", |
1895 | " transition latency of HW, fallback" | 1893 | policy->governor->name, gov->name); |
1896 | " to %s governor\n", | ||
1897 | policy->governor->name, | ||
1898 | gov->name); | ||
1899 | policy->governor = gov; | 1894 | policy->governor = gov; |
1900 | } | 1895 | } |
1901 | } | 1896 | } |
@@ -1905,7 +1900,7 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, | |||
1905 | return -EINVAL; | 1900 | return -EINVAL; |
1906 | 1901 | ||
1907 | pr_debug("__cpufreq_governor for CPU %u, event %u\n", | 1902 | pr_debug("__cpufreq_governor for CPU %u, event %u\n", |
1908 | policy->cpu, event); | 1903 | policy->cpu, event); |
1909 | 1904 | ||
1910 | mutex_lock(&cpufreq_governor_lock); | 1905 | mutex_lock(&cpufreq_governor_lock); |
1911 | if ((policy->governor_enabled && event == CPUFREQ_GOV_START) | 1906 | if ((policy->governor_enabled && event == CPUFREQ_GOV_START) |
@@ -2033,8 +2028,8 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy, | |||
2033 | struct cpufreq_governor *old_gov; | 2028 | struct cpufreq_governor *old_gov; |
2034 | int ret; | 2029 | int ret; |
2035 | 2030 | ||
2036 | pr_debug("setting new policy for CPU %u: %u - %u kHz\n", new_policy->cpu, | 2031 | pr_debug("setting new policy for CPU %u: %u - %u kHz\n", |
2037 | new_policy->min, new_policy->max); | 2032 | new_policy->cpu, new_policy->min, new_policy->max); |
2038 | 2033 | ||
2039 | memcpy(&new_policy->cpuinfo, &policy->cpuinfo, sizeof(policy->cpuinfo)); | 2034 | memcpy(&new_policy->cpuinfo, &policy->cpuinfo, sizeof(policy->cpuinfo)); |
2040 | 2035 | ||
@@ -2070,7 +2065,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy, | |||
2070 | policy->max = new_policy->max; | 2065 | policy->max = new_policy->max; |
2071 | 2066 | ||
2072 | pr_debug("new min and max freqs are %u - %u kHz\n", | 2067 | pr_debug("new min and max freqs are %u - %u kHz\n", |
2073 | policy->min, policy->max); | 2068 | policy->min, policy->max); |
2074 | 2069 | ||
2075 | if (cpufreq_driver->setpolicy) { | 2070 | if (cpufreq_driver->setpolicy) { |
2076 | policy->policy = new_policy->policy; | 2071 | policy->policy = new_policy->policy; |
@@ -2158,7 +2153,7 @@ int cpufreq_update_policy(unsigned int cpu) | |||
2158 | } | 2153 | } |
2159 | 2154 | ||
2160 | if (!policy->cur) { | 2155 | if (!policy->cur) { |
2161 | pr_debug("Driver did not initialize current freq"); | 2156 | pr_debug("Driver did not initialize current freq\n"); |
2162 | policy->cur = new_policy.cur; | 2157 | policy->cur = new_policy.cur; |
2163 | } else { | 2158 | } else { |
2164 | if (policy->cur != new_policy.cur && has_target()) | 2159 | if (policy->cur != new_policy.cur && has_target()) |
@@ -2260,8 +2255,8 @@ int cpufreq_boost_trigger_state(int state) | |||
2260 | cpufreq_driver->boost_enabled = !state; | 2255 | cpufreq_driver->boost_enabled = !state; |
2261 | write_unlock_irqrestore(&cpufreq_driver_lock, flags); | 2256 | write_unlock_irqrestore(&cpufreq_driver_lock, flags); |
2262 | 2257 | ||
2263 | pr_err("%s: Cannot %s BOOST\n", __func__, | 2258 | pr_err("%s: Cannot %s BOOST\n", |
2264 | state ? "enable" : "disable"); | 2259 | __func__, state ? "enable" : "disable"); |
2265 | } | 2260 | } |
2266 | 2261 | ||
2267 | return ret; | 2262 | return ret; |
@@ -2333,7 +2328,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) | |||
2333 | ret = cpufreq_sysfs_create_file(&boost.attr); | 2328 | ret = cpufreq_sysfs_create_file(&boost.attr); |
2334 | if (ret) { | 2329 | if (ret) { |
2335 | pr_err("%s: cannot register global BOOST sysfs file\n", | 2330 | pr_err("%s: cannot register global BOOST sysfs file\n", |
2336 | __func__); | 2331 | __func__); |
2337 | goto err_null_driver; | 2332 | goto err_null_driver; |
2338 | } | 2333 | } |
2339 | } | 2334 | } |
@@ -2356,7 +2351,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) | |||
2356 | /* if all ->init() calls failed, unregister */ | 2351 | /* if all ->init() calls failed, unregister */ |
2357 | if (ret) { | 2352 | if (ret) { |
2358 | pr_debug("no CPU initialized for driver %s\n", | 2353 | pr_debug("no CPU initialized for driver %s\n", |
2359 | driver_data->name); | 2354 | driver_data->name); |
2360 | goto err_if_unreg; | 2355 | goto err_if_unreg; |
2361 | } | 2356 | } |
2362 | } | 2357 | } |