In commit 7a22d6321c3d ("powerpc/mm/radix: Update command line parsing for
disable_radix") an `if` statement was added for a possible empty body
(prom_debug).
Fix the following warning, treated as error with W=1:
arch/powerpc/kernel/prom_init.c:656:46: error: suggest braces around empty body in an ‘if’ statement [-Werror=empty-body]
Signed-off-by: Mathieu Malaterre <redacted>
---
arch/powerpc/kernel/prom_init.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
From: Randy Dunlap <hidden> Date: 2018-04-08 20:34:37
On 04/08/2018 12:44 PM, Mathieu Malaterre wrote:
quoted hunk
In commit 7a22d6321c3d ("powerpc/mm/radix: Update command line parsing for
disable_radix") an `if` statement was added for a possible empty body
(prom_debug).
Fix the following warning, treated as error with W=1:
arch/powerpc/kernel/prom_init.c:656:46: error: suggest braces around empty body in an ‘if’ statement [-Werror=empty-body]
Signed-off-by: Mathieu Malaterre <redacted>
---
arch/powerpc/kernel/prom_init.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
On Sun, Apr 8, 2018 at 10:34 PM, Randy Dunlap [off-list ref] wrote=
:
On 04/08/2018 12:44 PM, Mathieu Malaterre wrote:
quoted
In commit 7a22d6321c3d ("powerpc/mm/radix: Update command line parsing f=
or
quoted
disable_radix") an `if` statement was added for a possible empty body
(prom_debug).
Fix the following warning, treated as error with W=3D1:
arch/powerpc/kernel/prom_init.c:656:46: error: suggest braces around e=
mpty body in an =E2=80=98if=E2=80=99 statement [-Werror=3Dempty-body]
Looks like the macro for #prom_debug() should be fixed instead.
Well if I try instead:
@@ -101,9 +101,9 @@ int of_workarounds; } while (0) #ifdef DEBUG_PROM-#define prom_debug(x...) prom_printf(x)+#define prom_debug(x...) do { prom_printf(x); } while (0) #else-#define prom_debug(x...)+#define prom_debug(x...) do { } while (0) #endif
the checkpatch script returns:
WARNING: Single statement macros should not use a do {} while (0) loop
#33: FILE: arch/powerpc/kernel/prom_init.c:104:
+#define prom_debug(x...) do { prom_printf(x); } while (0)
So I suspect we cannot do much better than my original patch unfortunately.
On Mon, Apr 23, 2018 at 9:31 PM, Mathieu Malaterre [off-list ref] wrote=
:
On Sun, Apr 8, 2018 at 10:34 PM, Randy Dunlap [off-list ref] wro=
te:
quoted
On 04/08/2018 12:44 PM, Mathieu Malaterre wrote:
quoted
In commit 7a22d6321c3d ("powerpc/mm/radix: Update command line parsing =
for
quoted
quoted
disable_radix") an `if` statement was added for a possible empty body
(prom_debug).
Fix the following warning, treated as error with W=3D1:
arch/powerpc/kernel/prom_init.c:656:46: error: suggest braces around =
empty body in an =E2=80=98if=E2=80=99 statement [-Werror=3Dempty-body]
Looks like the macro for #prom_debug() should be fixed instead.
Well if I try instead:
@@ -101,9 +101,9 @@ int of_workarounds; } while (0) #ifdef DEBUG_PROM-#define prom_debug(x...) prom_printf(x)+#define prom_debug(x...) do { prom_printf(x); } while (0) #else-#define prom_debug(x...)+#define prom_debug(x...) do { } while (0) #endif
the checkpatch script returns:
WARNING: Single statement macros should not use a do {} while (0) loop
#33: FILE: arch/powerpc/kernel/prom_init.c:104:
+#define prom_debug(x...) do { prom_printf(x); } while (0)
So I suspect we cannot do much better than my original patch unfortunatel=
y.
Right, it seems I cannot read the correct line number for a warning.
An updated patch is coming.
In commit 7a22d6321c3d ("powerpc/mm/radix: Update command line parsing for
disable_radix") an `if` statement was added for a possible empty body
(prom_debug).
Fix the following warning, treated as error with W=1:
arch/powerpc/kernel/prom_init.c:656:46: error: suggest braces around empty body in an ‘if’ statement [-Werror=empty-body]
Suggested-by: Randy Dunlap <redacted>
Signed-off-by: Mathieu Malaterre <redacted>
---
v2: update macro directly
arch/powerpc/kernel/prom_init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Randy Dunlap <hidden> Date: 2018-04-23 21:13:49
On 04/23/18 12:36, Mathieu Malaterre wrote:
In commit 7a22d6321c3d ("powerpc/mm/radix: Update command line parsing for
disable_radix") an `if` statement was added for a possible empty body
(prom_debug).
Fix the following warning, treated as error with W=1:
arch/powerpc/kernel/prom_init.c:656:46: error: suggest braces around empty body in an ‘if’ statement [-Werror=empty-body]
Suggested-by: Randy Dunlap <redacted>
Signed-off-by: Mathieu Malaterre <redacted>
From: Michael Ellerman <hidden> Date: 2018-05-25 11:41:43
On Mon, 2018-04-23 at 19:36:38 UTC, Mathieu Malaterre wrote:
In commit 7a22d6321c3d ("powerpc/mm/radix: Update command line parsing for
disable_radix") an `if` statement was added for a possible empty body
(prom_debug).
Fix the following warning, treated as error with W=1:
arch/powerpc/kernel/prom_init.c:656:46: error: suggest braces around empty body in an ���if��� statement [-Werror=empty-body]
Suggested-by: Randy Dunlap <redacted>
Signed-off-by: Mathieu Malaterre <redacted>
Acked-by: Randy Dunlap <redacted>