linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpuidle: set poll_limit_ns out of if-else
@ 2021-07-23 18:27 Pankaj Gupta
  2021-08-04 17:22 ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Pankaj Gupta @ 2021-07-23 18:27 UTC (permalink / raw)
  To: rjw, daniel.lezcano, pankaj.gupta.linux
  Cc: linux-pm, linux-kernel, Pankaj Gupta

From: Pankaj Gupta <pankaj.gupta@ionos.com>

 Since poll_limit_ns is being set at the end of both if and else statement.
 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-04 18:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-23 18:27 [PATCH] cpuidle: set poll_limit_ns out of if-else Pankaj Gupta
2021-08-04 17:22 ` Rafael J. Wysocki
2021-08-04 18:20   ` Pankaj Gupta

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).