Skip to contentSkip to conversation

net: ethernet: renesas: rcar_gen4_ptp: Remove bool conversion

PATCH Applied Thorsten Blum 4 participants 4 messages Feb 23, 2025 – Feb 25, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ethernet: renesas: rcar_gen4_ptp: Remove bool conversion

Remove the unnecessary bool conversion and simplify the code.

---
 drivers/net/ethernet/renesas/rcar_gen4_ptp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/renesas/rcar_gen4_ptp.c +1 -1
index 72e7fcc56693..4c3e8cc5046f 100644
@@ -29,8 +29,8 @@ static const struct rcar_gen4_ptp_reg_offset gen4_offs = {
 static int rcar_gen4_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
 {
 	struct rcar_gen4_ptp_private *ptp_priv = ptp_to_priv(ptp);
-	bool neg_adj = scaled_ppm < 0 ? true : false;
 	s64 addend = ptp_priv->default_addend;
+	bool neg_adj = scaled_ppm < 0;
 	s64 diff;
 
 	if (neg_adj)
Signature · 1 line
2.48.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Thorsten Blum

Remove the unnecessary bool conversion and simplify the code.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Reviewed-by on v1 1/1
#2 lore raw
In reply to Thorsten Blum

Hi Thorsten,

Thanks for your work.

Quoted 3 lines · Thorsten Blum

Remove the unnecessary bool conversion and simplify the code.

Quoted 22 lines
---
 drivers/net/ethernet/renesas/rcar_gen4_ptp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/renesas/rcar_gen4_ptp.c +1 -1
index 72e7fcc56693..4c3e8cc5046f 100644
@@ -29,8 +29,8 @@ static const struct rcar_gen4_ptp_reg_offset gen4_offs = {
 static int rcar_gen4_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
 {
 	struct rcar_gen4_ptp_private *ptp_priv = ptp_to_priv(ptp);
-	bool neg_adj = scaled_ppm < 0 ? true : false;
 	s64 addend = ptp_priv->default_addend;
+	bool neg_adj = scaled_ppm < 0;
 	s64 diff;
 
 	if (neg_adj)
Signature · 1 line
2.48.1
Signature · 2 lines
Kind Regards,
Niklas Söderlund
#3 lore raw
In reply to Thorsten Blum
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 6 lines · On Mon, 24 Feb 2025 00:36:11 +0100 you wrote:

Remove the unnecessary bool conversion and simplify the code.

---
 drivers/net/ethernet/renesas/rcar_gen4_ptp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
- [net-next] net: ethernet: renesas: rcar_gen4_ptp: Remove bool conversion

    https://git.kernel.org/netdev/net-next/c/6538c8ca8ee1

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html