public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/ptrace: fix empty-body warning
@ 2018-12-18 20:53 Mathieu Malaterre
  2018-12-19  0:22 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Mathieu Malaterre @ 2018-12-18 20:53 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Mathieu Malaterre, Oleg Nesterov, Benjamin Herrenschmidt,
	Paul Mackerras, linuxppc-dev, linux-kernel

In commit a225f1567405 ("powerpc/ptrace: replace ptrace_report_syscall()
with a tracehook call") an empty body if(); was added.

Replace ; with {} to remove a warning (treated as error) reported by gcc
using W=1:

  arch/powerpc/kernel/ptrace.c: In function ‘do_syscall_trace_enter’:
  arch/powerpc/kernel/ptrace.c:3281:4: error: suggest braces around empty body in an ‘if’ statement [-Werror=empty-body]

Fixes: a225f1567405 ("powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call")
Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/kernel/ptrace.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 8314e8fed0ee..e1988892b3e7 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -3277,8 +3277,8 @@ long do_syscall_trace_enter(struct pt_regs *regs)
 		 * avoid clobbering any register also, thus, not 'gotoing'
 		 * skip label.
 		 */
-		if (tracehook_report_syscall_entry(regs))
-			;
+		if (tracehook_report_syscall_entry(regs)) {
+		}
 		return -1;
 	}
 
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] powerpc/ptrace: fix empty-body warning
  2018-12-18 20:53 [PATCH] powerpc/ptrace: fix empty-body warning Mathieu Malaterre
@ 2018-12-19  0:22 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2018-12-19  0:22 UTC (permalink / raw)
  To: Mathieu Malaterre
  Cc: Mathieu Malaterre, Oleg Nesterov, Benjamin Herrenschmidt,
	Paul Mackerras, linuxppc-dev, linux-kernel

Hi Mathieu,

Mathieu Malaterre <malat@debian.org> writes:
> In commit a225f1567405 ("powerpc/ptrace: replace ptrace_report_syscall()
> with a tracehook call") an empty body if(); was added.
>
> Replace ; with {} to remove a warning (treated as error) reported by gcc
> using W=1:
>
>   arch/powerpc/kernel/ptrace.c: In function ‘do_syscall_trace_enter’:
>   arch/powerpc/kernel/ptrace.c:3281:4: error: suggest braces around empty body in an ‘if’ statement [-Werror=empty-body]
>
> Fixes: a225f1567405 ("powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call")
> Signed-off-by: Mathieu Malaterre <malat@debian.org>

Thanks for the fix, but this code is being refactored already in next,
see:

https://patchwork.ozlabs.org/patch/1014179/

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-19  0:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-18 20:53 [PATCH] powerpc/ptrace: fix empty-body warning Mathieu Malaterre
2018-12-19  0:22 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox