[PATCH net-next] rocker: Simplify if condition in ofdpa_port_fdb()

Thorsten Blum posted 1 patch 10 months ago
drivers/net/ethernet/rocker/rocker_ofdpa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH net-next] rocker: Simplify if condition in ofdpa_port_fdb()
Posted by Thorsten Blum 10 months ago
Remove the double negation and simplify the if condition.

No functional changes intended.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/net/ethernet/rocker/rocker_ofdpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/rocker/rocker_ofdpa.c b/drivers/net/ethernet/rocker/rocker_ofdpa.c
index 826990459fa4..8832bfdd8833 100644
--- a/drivers/net/ethernet/rocker/rocker_ofdpa.c
+++ b/drivers/net/ethernet/rocker/rocker_ofdpa.c
@@ -1933,7 +1933,7 @@ static int ofdpa_port_fdb(struct ofdpa_port *ofdpa_port,
 	spin_unlock_irqrestore(&ofdpa->fdb_tbl_lock, lock_flags);
 
 	/* Check if adding and already exists, or removing and can't find */
-	if (!found != !removing) {
+	if (!found == removing) {
 		kfree(fdb);
 		if (!found && removing)
 			return 0;
Re: [PATCH net-next] rocker: Simplify if condition in ofdpa_port_fdb()
Posted by Jiri Pirko 10 months ago
Mon, Apr 07, 2025 at 11:14:42AM +0200, thorsten.blum@linux.dev wrote:
>Remove the double negation and simplify the if condition.
>
>No functional changes intended.
>
>Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>

Why not.

Reviewed-by: Jiri Pirko <jiri@nvidia.com>