diff options
author | Yu Liao <liaoyu15@huawei.com> | 2022-08-29 03:15:34 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2022-09-03 20:14:51 +0200 |
commit | 06f7c08751939f33d79712590c2b21d02aba61b6 (patch) | |
tree | 53b8f2e37babc720633665048c7834130f534648 /drivers/cpuidle | |
parent | intel_idle: move from strlcpy() with unused retval to strscpy() (diff) | |
download | linux-06f7c08751939f33d79712590c2b21d02aba61b6.tar.xz linux-06f7c08751939f33d79712590c2b21d02aba61b6.zip |
cpuidle: Remove redundant check in cpuidle_switch_governor()
gov has already been NULL checked at the beginning of
cpuidle_switch_governor, so remove redundant check.
While at it, use pr_info() instead printk() to address the following
checkpatch warning:
WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then
dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...
Signed-off-by: Yu Liao <liaoyu15@huawei.com>
[ rjw: Subject and changelog edits, added empty line after if () ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpuidle')
-rw-r--r-- | drivers/cpuidle/governor.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/cpuidle/governor.c b/drivers/cpuidle/governor.c index 29acaf48e575..0d0f9751ff8f 100644 --- a/drivers/cpuidle/governor.c +++ b/drivers/cpuidle/governor.c @@ -63,12 +63,11 @@ int cpuidle_switch_governor(struct cpuidle_governor *gov) cpuidle_curr_governor = gov; - if (gov) { - list_for_each_entry(dev, &cpuidle_detected_devices, device_list) - cpuidle_enable_device(dev); - cpuidle_install_idle_handler(); - printk(KERN_INFO "cpuidle: using governor %s\n", gov->name); - } + list_for_each_entry(dev, &cpuidle_detected_devices, device_list) + cpuidle_enable_device(dev); + + cpuidle_install_idle_handler(); + pr_info("cpuidle: using governor %s\n", gov->name); return 0; } |