Skip to contentSkip to conversation

i40e: remove an unneeded check

PATCH In review Dan Carpenter 2 participants 4 messages Mar 28, 2014 – Apr 3, 2014

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

PATCH 1/1 i40e: remove an unneeded check

We know "ret" is zero here. No need to check again.

drivers/net/ethernet/intel/i40e/i40e_ethtool.c +2 -2
index 28da412..2640004 100644
@@ -1534,12 +1534,12 @@ static int i40e_add_del_fdir_ethtool(struct i40e_vsi *vsi,
 		return ret;
 	}
 
-	if (!ret && add)
+	if (add)
 		i40e_update_ethtool_fdir_entry(vsi, input, fsp->location, NULL);
 	else
 		kfree(input);
 
-	return ret;
+	return 0;
 }
 
 /**
#2 lore raw
In reply to Dan Carpenter
Quoted 3 lines · Dan Carpenter

We know "ret" is zero here. No need to check again.

Dan with the latest bunch of patches I just pushed and that Dave accepted, the code changes which directly affect your patch to leaves your patch only changing the return statement from:

return ret;

to

return 0;

but with the recent change in the code, the ret value can be something other than 0 so your patch does not appear to be needed any longer.

Can you double check my findings by taking a look at David Miller's latest net-next tree to verify please?

Cheers,
Jeff

#3 lore raw
In reply to Dan Carpenter
Quoted 9 lines · Jeff Kirsher
Quoted 3 lines · Dan Carpenter

We know "ret" is zero here. No need to check again.

Dan with the latest bunch of patches I just pushed and that Dave accepted, the code changes which directly affect your patch to leaves your patch only changing the return statement from:

Quoted 8 lines

return ret;

to

return 0;

but with the recent change in the code, the ret value can be something other than 0 so your patch does not appear to be needed any longer.

Sure, yep. It's not needed anymore.

regards,
dan carpenter