]>
Commit | Line | Data |
---|---|---|
0cd91647 GKH |
1 | From f0e8faa7a5e894b0fc99d24be1b18685a92ea466 Mon Sep 17 00:00:00 2001 |
2 | From: Arnd Bergmann <arnd@arndb.de> | |
3 | Date: Wed, 16 Nov 2016 16:20:37 +0100 | |
4 | Subject: ARM: ux500: fix prcmu_is_cpu_in_wfi() calculation | |
5 | ||
6 | From: Arnd Bergmann <arnd@arndb.de> | |
7 | ||
8 | commit f0e8faa7a5e894b0fc99d24be1b18685a92ea466 upstream. | |
9 | ||
10 | This function clearly never worked and always returns true, | |
11 | as pointed out by gcc-7: | |
12 | ||
13 | arch/arm/mach-ux500/pm.c: In function 'prcmu_is_cpu_in_wfi': | |
14 | arch/arm/mach-ux500/pm.c:137:212: error: ?: | |
15 | using integer constants in boolean context, the expression | |
16 | will always evaluate to 'true' [-Werror=int-in-bool-context] | |
17 | ||
18 | With the added braces, the condition actually makes sense. | |
19 | ||
20 | Fixes: 34fe6f107eab ("mfd : Check if the other db8500 core is in WFI") | |
21 | Signed-off-by: Arnd Bergmann <arnd@arndb.de> | |
22 | Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> | |
23 | Signed-off-by: Linus Walleij <linus.walleij@linaro.org> | |
24 | Signed-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 | /* |