All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net/mlx4: Remove redundant ternary operators
@ 2025-08-27 12:15 Liao Yuanhong
  2025-08-28  2:46 ` Zhu Yanjun
  2025-08-28 19:09 ` Simon Horman
  0 siblings, 2 replies; 3+ messages in thread
From: Liao Yuanhong @ 2025-08-27 12:15 UTC (permalink / raw)
  To: Tariq Toukan, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni,
	open list:MELLANOX MLX4 core VPI driver,
	open list:MELLANOX MLX4 core VPI driver, open list
  Cc: Liao Yuanhong

For ternary operators in the form of "a ? true : false", if 'a' itself
returns a boolean result, the ternary operator can be omitted. Remove
redundant ternary operators to clean up the code.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
---
 drivers/net/ethernet/mellanox/mlx4/port.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c
index e3d0b13c1610..5abdb1363ccc 100644
--- a/drivers/net/ethernet/mellanox/mlx4/port.c
+++ b/drivers/net/ethernet/mellanox/mlx4/port.c
@@ -156,7 +156,7 @@ static bool mlx4_need_mf_bond(struct mlx4_dev *dev)
 	mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH)
 		++num_eth_ports;
 
-	return (num_eth_ports ==  2) ? true : false;
+	return num_eth_ports == 2;
 }
 
 int __mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac)
-- 
2.34.1


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

end of thread, other threads:[~2025-08-28 19:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-27 12:15 [PATCH net-next] net/mlx4: Remove redundant ternary operators Liao Yuanhong
2025-08-28  2:46 ` Zhu Yanjun
2025-08-28 19:09 ` Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.