[PATCH] staging: sm750fb: remove unnecessary parentheses in ddk750_swi2c.c

Subsystems: staging - silicon motion sm750 frame buffer driver, staging subsystem, the rest

STALE178d

2 messages, 2 authors, 2026-02-04 · open the first message on its own page

[PATCH] staging: sm750fb: remove unnecessary parentheses in ddk750_swi2c.c

From: Zeeshan Ahmad <hidden>
Date: 2026-02-04 12:55:44

Checkpatch reported "Unnecessary parentheses around 'clk_gpio > 31'"
and 'data_gpio > 31'.

Remove the extra parentheses to clean up the code and satisfy the
coding style guidelines.

Signed-off-by: Zeeshan Ahmad <redacted>
---
 drivers/staging/sm750fb/ddk750_swi2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c b/drivers/staging/sm750fb/ddk750_swi2c.c
index 0ef8d4ff2ef9..50e51d730d86 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -393,7 +393,7 @@ long sm750_sw_i2c_init(unsigned char clk_gpio, unsigned char data_gpio)
 	 * Return 0 if the GPIO pins to be used is out of range. The
 	 * range is only from [0..63]
 	 */
-	if ((clk_gpio > 31) || (data_gpio > 31))
+	if (clk_gpio > 31 || data_gpio > 31)
 		return -1;
 
 	if (sm750_get_chip_type() == SM750LE)
-- 
2.43.0

Re: [PATCH] staging: sm750fb: remove unnecessary parentheses in ddk750_swi2c.c

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2026-02-04 13:14:28

On Wed, Feb 04, 2026 at 05:55:25PM +0500, Zeeshan Ahmad wrote:
quoted hunk
Checkpatch reported "Unnecessary parentheses around 'clk_gpio > 31'"
and 'data_gpio > 31'.

Remove the extra parentheses to clean up the code and satisfy the
coding style guidelines.

Signed-off-by: Zeeshan Ahmad <redacted>
---
 drivers/staging/sm750fb/ddk750_swi2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c b/drivers/staging/sm750fb/ddk750_swi2c.c
index 0ef8d4ff2ef9..50e51d730d86 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -393,7 +393,7 @@ long sm750_sw_i2c_init(unsigned char clk_gpio, unsigned char data_gpio)
 	 * Return 0 if the GPIO pins to be used is out of range. The
 	 * range is only from [0..63]
 	 */
-	if ((clk_gpio > 31) || (data_gpio > 31))
+	if (clk_gpio > 31 || data_gpio > 31)
Now I have to remember which is a higher priority in C, > or ||

Please don't make changes like this, I thought checkpatch turned these
off for staging code, as I keep complaining about it on a weekly (or
more than that) basis :(

If you look at the mailing list, I think I just complained about this a
few hours before you sent this change as well...

thanks,

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help