Re: [PATCH 1/7] cpuidle-haltpoll: Make boot_option_idle_override check X86 specific

From: Rafael J. Wysocki
Date: Thu Aug 10 2023 - 15:22:46 EST


On Wed, Aug 9, 2023 at 2:52 PM Mihai Carabas <mihai.carabas@xxxxxxxxxx> wrote:
>
> From: Joao Martins <joao.m.martins@xxxxxxxxxx>
>
> In the pursuit of letting it build on ARM let's not include what is x86
> specific.
>
> Signed-off-by: Joao Martins <joao.m.martins@xxxxxxxxxx>
> Signed-off-by: Mihai Carabas <mihai.carabas@xxxxxxxxxx>
> ---
> drivers/cpuidle/cpuidle-haltpoll.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-haltpoll.c
> index e66df22f9695..0ca3c8422eb6 100644
> --- a/drivers/cpuidle/cpuidle-haltpoll.c
> +++ b/drivers/cpuidle/cpuidle-haltpoll.c
> @@ -104,9 +104,11 @@ static int __init haltpoll_init(void)
> int ret;
> struct cpuidle_driver *drv = &haltpoll_driver;
>
> +#ifdef CONFIG_X86
> /* Do not load haltpoll if idle= is passed */
> if (boot_option_idle_override != IDLE_NO_OVERRIDE)
> return -ENODEV;
> +#endif

I'm sure that adding this #ifdef to the function body is avoidable.

> if (!kvm_para_available() || !haltpoll_want())
> return -ENODEV;
> --