diff mbox series

[19/19] Fix misleading indentation gcc warning

Message ID 3575d33c0520d3117e1d12af91f1b1e31a2571c2.1665137247.git.mykyta_poturai@epam.com (mailing list archive)
State New, archived
Headers show
Series [01/19] xen/arm: Implement PSCI system suspend | expand

Commit Message

Mykyta Poturai Oct. 7, 2022, 10:32 a.m. UTC
From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

percpu.c: In function 'cpu_percpu_callback':
percpu.c:61:7: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
       if ( system_state != SYS_STATE_resume )
       ^~
percpu.c:63:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
         break;
         ^~~~~
percpu.c:67:7: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
       if ( system_state != SYS_STATE_suspend )
       ^~
percpu.c:69:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
         break;
         ^~~~~

Fixes: c3109b76d967 ("xen: don't free percpu areas during suspend")

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
---
 xen/arch/arm/percpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Julien Grall Dec. 6, 2022, 10:17 p.m. UTC | #1
Hi,

On 07/10/2022 11:32, Mykyta Poturai wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> 
> percpu.c: In function 'cpu_percpu_callback':
> percpu.c:61:7: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
>         if ( system_state != SYS_STATE_resume )
>         ^~
> percpu.c:63:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
>           break;
>           ^~~~~
> percpu.c:67:7: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
>         if ( system_state != SYS_STATE_suspend )
>         ^~
> percpu.c:69:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
>           break;
>           ^~~~~
> 
> Fixes: c3109b76d967 ("xen: don't free percpu areas during suspend")

This commit hash doesn't seem to exist upstream. But it sounds like you 
are fixing a bug that was introduced by this series.

In general, patch within a series should be able to compile without any 
follow-up requirement. Similarly, we should not bug fix a patch within 
the same series.

Instead, this should be folded in the patch that introduced the problem.

Cheers,
diff mbox series

Patch

diff --git a/xen/arch/arm/percpu.c b/xen/arch/arm/percpu.c
index 0642705544..9eab1e6d7c 100644
--- a/xen/arch/arm/percpu.c
+++ b/xen/arch/arm/percpu.c
@@ -60,13 +60,13 @@  static int cpu_percpu_callback(
     case CPU_UP_PREPARE:
       if ( system_state != SYS_STATE_resume )
         rc = init_percpu_area(cpu);
-        break;
+      break;
     case CPU_UP_CANCELED:
     case CPU_DEAD:
     case CPU_RESUME_FAILED:
       if ( system_state != SYS_STATE_suspend )
         free_percpu_area(cpu);
-        break;
+      break;
     default:
         break;
     }