]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.45/arm-ux500-fix-prcmu_is_cpu_in_wfi-calculation.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.45 / arm-ux500-fix-prcmu_is_cpu_in_wfi-calculation.patch
CommitLineData
0cd91647
GKH
1From f0e8faa7a5e894b0fc99d24be1b18685a92ea466 Mon Sep 17 00:00:00 2001
2From: Arnd Bergmann <arnd@arndb.de>
3Date: Wed, 16 Nov 2016 16:20:37 +0100
4Subject: ARM: ux500: fix prcmu_is_cpu_in_wfi() calculation
5
6From: Arnd Bergmann <arnd@arndb.de>
7
8commit f0e8faa7a5e894b0fc99d24be1b18685a92ea466 upstream.
9
10This function clearly never worked and always returns true,
11as pointed out by gcc-7:
12
13arch/arm/mach-ux500/pm.c: In function 'prcmu_is_cpu_in_wfi':
14arch/arm/mach-ux500/pm.c:137:212: error: ?:
15using integer constants in boolean context, the expression
16will always evaluate to 'true' [-Werror=int-in-bool-context]
17
18With the added braces, the condition actually makes sense.
19
20Fixes: 34fe6f107eab ("mfd : Check if the other db8500 core is in WFI")
21Signed-off-by: Arnd Bergmann <arnd@arndb.de>
22Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
23Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25
26---
27 arch/arm/mach-ux500/pm.c | 4 ++--
28 1 file changed, 2 insertions(+), 2 deletions(-)
29
30--- a/arch/arm/mach-ux500/pm.c
31+++ b/arch/arm/mach-ux500/pm.c
32@@ -134,8 +134,8 @@ bool prcmu_pending_irq(void)
33 */
34 bool prcmu_is_cpu_in_wfi(int cpu)
35 {
36- return readl(PRCM_ARM_WFI_STANDBY) & cpu ? PRCM_ARM_WFI_STANDBY_WFI1 :
37- PRCM_ARM_WFI_STANDBY_WFI0;
38+ return readl(PRCM_ARM_WFI_STANDBY) &
39+ (cpu ? PRCM_ARM_WFI_STANDBY_WFI1 : PRCM_ARM_WFI_STANDBY_WFI0);
40 }
41
42 /*