Skip to content

Commit 06f7c08

Browse files
yuliao0214rafaeljw
authored andcommitted
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 <[email protected]> [ rjw: Subject and changelog edits, added empty line after if () ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 0dbc0f4 commit 06f7c08

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/cpuidle/governor.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,11 @@ int cpuidle_switch_governor(struct cpuidle_governor *gov)
6363

6464
cpuidle_curr_governor = gov;
6565

66-
if (gov) {
67-
list_for_each_entry(dev, &cpuidle_detected_devices, device_list)
68-
cpuidle_enable_device(dev);
69-
cpuidle_install_idle_handler();
70-
printk(KERN_INFO "cpuidle: using governor %s\n", gov->name);
71-
}
66+
list_for_each_entry(dev, &cpuidle_detected_devices, device_list)
67+
cpuidle_enable_device(dev);
68+
69+
cpuidle_install_idle_handler();
70+
pr_info("cpuidle: using governor %s\n", gov->name);
7271

7372
return 0;
7473
}

0 commit comments

Comments
 (0)