Skip to content

Commit 659b66e

Browse files
lrq-maxrafaeljw
authored andcommitted
cpuidle: haltpoll: Call cpuidle_poll_state_init() later
Call cpuidle_poll_state_init() only if it is needed to avoid doing useless work. Signed-off-by: Li RongQing <lirongqing@baidu.com> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 3a9cf77 commit 659b66e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/cpuidle/cpuidle-haltpoll.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ static int __init haltpoll_init(void)
108108
if (boot_option_idle_override != IDLE_NO_OVERRIDE)
109109
return -ENODEV;
110110

111-
cpuidle_poll_state_init(drv);
112-
113111
if (!kvm_para_available() || !haltpoll_want())
114112
return -ENODEV;
115113

114+
cpuidle_poll_state_init(drv);
115+
116116
ret = cpuidle_register_driver(drv);
117117
if (ret < 0)
118118
return ret;

0 commit comments

Comments
 (0)