linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] cpuidle: tegra: Correctly handle result of arm_cpuidle_simple_enter()
@ 2020-06-29 22:26 Dmitry Osipenko
  2020-06-30  9:02 ` Jon Hunter
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Osipenko @ 2020-06-29 22:26 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Rafael J. Wysocki, Daniel Lezcano
  Cc: linux-pm, linux-tegra

The arm_cpuidle_simple_enter() returns the entered idle-index and not a
error code. It happened that TEGRA_C1=index=err=0, and hence this typo
was difficult to notice in the code since everything happened to work
properly. This patch fixes the minor typo, it doesn't fix any problem.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/cpuidle/cpuidle-tegra.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-tegra.c b/drivers/cpuidle/cpuidle-tegra.c
index 150045849d78..9e9a9cccd755 100644
--- a/drivers/cpuidle/cpuidle-tegra.c
+++ b/drivers/cpuidle/cpuidle-tegra.c
@@ -236,14 +236,14 @@ static int tegra_cpuidle_enter(struct cpuidle_device *dev,
 			       int index)
 {
 	unsigned int cpu = cpu_logical_map(dev->cpu);
-	int err;
+	int err = 0;
 
 	index = tegra_cpuidle_adjust_state_index(index, cpu);
 	if (dev->states_usage[index].disable)
 		return -1;
 
 	if (index == TEGRA_C1)
-		err = arm_cpuidle_simple_enter(dev, drv, index);
+		index = arm_cpuidle_simple_enter(dev, drv, index);
 	else
 		err = tegra_cpuidle_state_enter(dev, index, cpu);
 
-- 
2.26.0


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

end of thread, other threads:[~2020-07-01 22:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29 22:26 [PATCH v1] cpuidle: tegra: Correctly handle result of arm_cpuidle_simple_enter() Dmitry Osipenko
2020-06-30  9:02 ` Jon Hunter
2020-06-30 18:54   ` Dmitry Osipenko
2020-07-01 13:56     ` Jon Hunter
2020-07-01 22:49       ` Dmitry Osipenko

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