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

Message ID 1691581193-8416-2-git-send-email-mihai.carabas@oracle.com
State New
Headers
Series [1/7] cpuidle-haltpoll: Make boot_option_idle_override check X86 specific |

Commit Message

Mihai Carabas Aug. 9, 2023, 11:39 a.m. UTC
  From: Joao Martins <joao.m.martins@oracle.com>

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@oracle.com>
Signed-off-by: Mihai Carabas <mihai.carabas@oracle.com>
---
 drivers/cpuidle/cpuidle-haltpoll.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Rafael J. Wysocki Aug. 10, 2023, 7:22 p.m. UTC | #1
On Wed, Aug 9, 2023 at 2:52 PM Mihai Carabas <mihai.carabas@oracle.com> wrote:
>
> From: Joao Martins <joao.m.martins@oracle.com>
>
> 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@oracle.com>
> Signed-off-by: Mihai Carabas <mihai.carabas@oracle.com>
> ---
>  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;
> --
  

Patch

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
 
 	if (!kvm_para_available() || !haltpoll_want())
 		return -ENODEV;