Thread (2 messages) 2 messages, 2 authors, 2016-11-29

Re: [PATCH v3 2/3] cpuidle:powernv: Add helper function to populate powernv idle states.

From: Gautham R Shenoy <hidden>
Date: 2016-11-29 06:09:29
Also in: linuxppc-dev, lkml

Possibly related (same subject, not in this thread)

Hi Michael,

On Wed, Nov 23, 2016 at 08:49:08PM +1100, Michael Ellerman wrote:
"Gautham R. Shenoy" [off-list ref] writes:
quoted
diff --git a/drivers/cpuidle/cpuidle-powernv.c b/drivers/cpuidle/cpuidle-powernv.c
index 7fe442c..9240e08 100644
--- a/drivers/cpuidle/cpuidle-powernv.c
+++ b/drivers/cpuidle/cpuidle-powernv.c
@@ -243,28 +262,31 @@ static int powernv_add_idle_states(void)
 		 */
 		if (latency_ns[i] > POWERNV_THRESHOLD_LATENCY_NS)
 			continue;
+		/*
+		 * Firmware passes residency and latency values in ns.
+		 * cpuidle expects it in us.
+		 */
+		exit_latency = ((unsigned int)latency_ns[i]) / 1000;
+		target_residency = (!rc) ? ((unsigned int)residency_ns[i]) : 0;
+		target_residency /= 1000;
Urk.

Can you just do it normally:

		if (rc == 0)
			target_residency = (unsigned int)residency_ns[i] / 1000;
Wrote this in a non-standard manner since the normal way would exceed
80 chars.
I also don't see why you need the cast?
It is a remnant from the previous code. But I see your point, the cast
is redundant, and removing it will make it possible to implement this
in the normal manner without checkpatch warning about it.
cheers
--
Thanks and Regards
gautham.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help