[PATCH] [v2] parport: mfc3: avoid empty-body warning

Arnd Bergmann posted 1 patch 2 years, 6 months ago
There is a newer version of this series
drivers/parport/parport_mfc3.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH] [v2] parport: mfc3: avoid empty-body warning
Posted by Arnd Bergmann 2 years, 6 months ago
From: Arnd Bergmann <arnd@arndb.de>

on m68k builds, the mfc3 driver causes a warning about an empty if() block:

drivers/parport/parport_mfc3.c: In function 'control_pc_to_mfc3':
drivers/parport/parport_mfc3.c:106:37: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]

Remove it in favor of a simpler comment.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
v2: fix typo
---
 drivers/parport/parport_mfc3.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/parport/parport_mfc3.c b/drivers/parport/parport_mfc3.c
index f4d0da741e856..bb1817218d7b2 100644
--- a/drivers/parport/parport_mfc3.c
+++ b/drivers/parport/parport_mfc3.c
@@ -102,8 +102,7 @@ static unsigned char control_pc_to_mfc3(unsigned char control)
 		ret |= 128;
 	if (control & PARPORT_CONTROL_AUTOFD) /* AUTOLF */
 		ret &= ~64;
-	if (control & PARPORT_CONTROL_STROBE) /* Strobe */
-		/* Handled directly by hardware */;
+	/* PARPORT_CONTROL_STROBE handled directly by hardware */
 	return ret;
 }
 
-- 
2.39.2
Re: [PATCH] [v2] parport: mfc3: avoid empty-body warning
Posted by Sudip Mukherjee 2 years, 5 months ago
On Thu, 27 Jul 2023 at 13:24, Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> on m68k builds, the mfc3 driver causes a warning about an empty if() block:
>
> drivers/parport/parport_mfc3.c: In function 'control_pc_to_mfc3':
> drivers/parport/parport_mfc3.c:106:37: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
>
> Remove it in favor of a simpler comment.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>


-- 
Regards
Sudip