lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210723182759.74491-1-pankaj.gupta.linux@gmail.com>
Date:   Fri, 23 Jul 2021 20:27:59 +0200
From:   Pankaj Gupta <pankaj.gupta.linux@...il.com>
To:     rjw@...ysocki.net, daniel.lezcano@...aro.org,
        pankaj.gupta.linux@...il.com
Cc:     linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        Pankaj Gupta <pankaj.gupta@...os.com>
Subject: [PATCH] cpuidle: set poll_limit_ns out of if-else

From: Pankaj Gupta <pankaj.gupta@...os.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@...os.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ