public inbox for linux-i3c@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH][next] i3c: master: Remove ternary operator on return statement
@ 2025-09-02 13:52 Colin Ian King
  2025-09-14 21:36 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2025-09-02 13:52 UTC (permalink / raw)
  To: Wolfram Sang, Tommaso Merciai, Alexandre Belloni, Frank Li,
	linux-i3c
  Cc: kernel-janitors, linux-kernel

The value of ret at the end of the function renesas_i3c_daa
is always zero since previous checks for less than zero have already
exited via return paths. Hence the final ternary operator checking
for a less than zero value for ret is redundant and can be removed.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/i3c/master/renesas-i3c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index 174d3dc5d276..275f7b924288 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -679,7 +679,7 @@ static int renesas_i3c_daa(struct i3c_master_controller *m)
 			i3c_master_add_i3c_dev_locked(m, i3c->addrs[pos]);
 	}
 
-	return ret < 0 ? ret : 0;
+	return 0;
 }
 
 static bool renesas_i3c_supports_ccc_cmd(struct i3c_master_controller *m,
-- 
2.51.0


-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

* Re: [PATCH][next] i3c: master: Remove ternary operator on return statement
  2025-09-02 13:52 [PATCH][next] i3c: master: Remove ternary operator on return statement Colin Ian King
@ 2025-09-14 21:36 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2025-09-14 21:36 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Tommaso Merciai, Alexandre Belloni, Frank Li, linux-i3c,
	kernel-janitors, linux-kernel

On Tue, Sep 02, 2025 at 02:52:39PM +0100, Colin Ian King wrote:
> The value of ret at the end of the function renesas_i3c_daa
> is always zero since previous checks for less than zero have already
> exited via return paths. Hence the final ternary operator checking
> for a less than zero value for ret is redundant and can be removed.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Already sent (and applied just today):

https://lore.kernel.org/r/20250803211256.18513-2-wsa+renesas@sang-engineering.com


-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

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

end of thread, other threads:[~2025-09-14 21:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-02 13:52 [PATCH][next] i3c: master: Remove ternary operator on return statement Colin Ian King
2025-09-14 21:36 ` Wolfram Sang

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