linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Pankaj Gupta <pankaj.gupta@ionos.com>
Subject: Re: [PATCH] cpuidle: set poll_limit_ns out of if-else
Date: Wed, 4 Aug 2021 19:22:39 +0200	[thread overview]
Message-ID: <CAJZ5v0hV-3KXJM0WiQ=5nLoO06-A5ky_E7FViokj9uDax8zg1Q@mail.gmail.com> (raw)
In-Reply-To: <20210723182759.74491-1-pankaj.gupta.linux@gmail.com>

On Fri, Jul 23, 2021 at 8:28 PM Pankaj Gupta
<pankaj.gupta.linux@gmail.com> wrote:
>
> From: Pankaj Gupta <pankaj.gupta@ionos.com>
>
>  Since poll_limit_ns is being set at the end of both if and else statement.

But they are if () and else if (), so not really.

>  Moving and setting it out at one place.
>
> Signed-off-by: Pankaj Gupta <pankaj.gupta@ionos.com>
> ---
>  drivers/cpuidle/governors/haltpoll.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cpuidle/governors/haltpoll.c b/drivers/cpuidle/governors/haltpoll.c
> index cb2a96eafc02..7d0e95bc94f3 100644
> --- a/drivers/cpuidle/governors/haltpoll.c
> +++ b/drivers/cpuidle/governors/haltpoll.c
> @@ -90,7 +90,6 @@ static void adjust_poll_limit(struct cpuidle_device *dev, u64 block_ns)
>                 if (val > guest_halt_poll_ns)
>                         val = guest_halt_poll_ns;
>
> -               dev->poll_limit_ns = val;
>         } else if (block_ns > guest_halt_poll_ns &&
>                    guest_halt_poll_allow_shrink) {
>                 unsigned int shrink = guest_halt_poll_shrink;
> @@ -100,8 +99,9 @@ static void adjust_poll_limit(struct cpuidle_device *dev, u64 block_ns)
>                         val = 0;
>                 else
>                         val /= shrink;
> -               dev->poll_limit_ns = val;
>         }
> +
> +       dev->poll_limit_ns = val;
>  }
>
>  /**
> --
> 2.25.1
>

  reply	other threads:[~2021-08-04 17:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 18:27 Pankaj Gupta
2021-08-04 17:22 ` Rafael J. Wysocki [this message]
2021-08-04 18:20   ` Pankaj Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJZ5v0hV-3KXJM0WiQ=5nLoO06-A5ky_E7FViokj9uDax8zg1Q@mail.gmail.com' \
    --to=rafael@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pankaj.gupta.linux@gmail.com \
    --cc=pankaj.gupta@ionos.com \
    --cc=rjw@rjwysocki.net \
    --subject='Re: [PATCH] cpuidle: set poll_limit_ns out of if-else' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).