cpuidle: set poll_limit_ns out of if-else
PATCH 1/1 cpuidle: set poll_limit_ns out of if-else
From: Pankaj Gupta <[email protected]>
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 <[email protected]>
--- drivers/cpuidle/governors/haltpoll.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cpuidle/governors/haltpoll.c +2 -2
@@ -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; }/**
Signature · 1 line
2.25.1
Rafael J. Wysocki
maintainerQuoted 4 lines · Pankaj Gupta
From: Pankaj Gupta <[email protected]>
Since
poll_limit_nsis being set at the end of both if and else statement.
But they are if () and else if (), so not really.
Quoted 33 lines
Moving and setting it out at one place.
Signed-off-by Pankaj Gupta <[email protected]>--- drivers/cpuidle/governors/haltpoll.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/cpuidle/governors/haltpoll.c +2
-3@@ -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
Quoted 7 lines
Quoted 4 lines · <[email protected]> wrote:
From: Pankaj Gupta <[email protected]>
Since
poll_limit_nsis being set at the end of both if and else statement.But they are if () and else if (), so not really.
So sorry!
Thanks,
Pankaj