[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190726112737.19309-1-anders.roxell@linaro.org>
Date: Fri, 26 Jul 2019 13:27:37 +0200
From: Anders Roxell <anders.roxell@...aro.org>
To: will@...nel.org, mark.rutland@....com
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Anders Roxell <anders.roxell@...aro.org>
Subject: [PATCH] arm_pmu: Mark expected switch fall-through
When fall-through warnings was enabled by default the following warning
was starting to show up:
../drivers/perf/arm_pmu.c: In function ‘cpu_pm_pmu_notify’:
../drivers/perf/arm_pmu.c:726:3: warning: this statement may fall
through [-Wimplicit-fallthrough=]
cpu_pm_pmu_setup(armpmu, cmd);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/perf/arm_pmu.c:727:2: note: here
case CPU_PM_ENTER_FAILED:
^~~~
Rework so that the compiler doesn't warn about fall-through.
Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning")
Signed-off-by: Anders Roxell <anders.roxell@...aro.org>
---
I'm not convinced that this is the correct patch to fix this issue.
However, I can't see why we do 'armpmu->start(armpmu);' only in 'case
CPU_PM_ENTER_FAILED' and why we not call function cpu_pm_pmu_setup()
there also, since in cpu_pm_pmu_setup() has a case prepared for
CPU_PM_ENTER_FAILED.
drivers/perf/arm_pmu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index 2d06b8095a19..465a15705bab 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -724,6 +724,7 @@ static int cpu_pm_pmu_notify(struct notifier_block *b, unsigned long cmd,
break;
case CPU_PM_EXIT:
cpu_pm_pmu_setup(armpmu, cmd);
+ /* Fall through */
case CPU_PM_ENTER_FAILED:
armpmu->start(armpmu);
break;
--
2.20.1
Powered by blists - more mailing lists