Skip to contentSkip to conversation

i40e: Remove unneeded conversion to bool

PATCH Applied Jason Yan 2 participants 2 messages Apr 20, 2020 – Apr 21, 2020

Subsystems (4)
lore
Share & tools
lore

Jason Yan

author
#0 lore raw

PATCH 1/1 i40e: Remove unneeded conversion to bool

The '==' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning:

drivers/net/ethernet/intel/i40e/i40e_main.c:1614:52-57: WARNING:
conversion to bool not needed here drivers/net/ethernet/intel/i40e/i40e_main.c:11439:52-57: WARNING:
conversion to bool not needed here

---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -2
index 8c3e753bfb9d..2a037ec244b9 100644
@@ -1611,7 +1611,7 @@ static int i40e_config_rss_aq(struct i40e_vsi *vsi, const u8 *seed,
 		}
 	}
 	if (lut) {
-		bool pf_lut = vsi->type == I40E_VSI_MAIN ? true : false;
+		bool pf_lut = vsi->type == I40E_VSI_MAIN;
 
 		ret = i40e_aq_set_rss_lut(hw, vsi->id, pf_lut, lut, lut_size);
 		if (ret) {
@@ -11436,7 +11436,7 @@ static int i40e_get_rss_aq(struct i40e_vsi *vsi, const u8 *seed,
 	}
 
 	if (lut) {
-		bool pf_lut = vsi->type == I40E_VSI_MAIN ? true : false;
+		bool pf_lut = vsi->type == I40E_VSI_MAIN;
 
 		ret = i40e_aq_get_rss_lut(hw, vsi->id, pf_lut, lut, lut_size);
 		if (ret) {
Signature · 1 line
2.21.1
maintainer Applied
#1 lore raw

From: Jason Yan <[email protected]>
Date: Mon, 20 Apr 2020 20:34:48 +0800

Quoted 9 lines

The '==' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning:

drivers/net/ethernet/intel/i40e/i40e_main.c:1614:52-57: WARNING:
conversion to bool not needed here drivers/net/ethernet/intel/i40e/i40e_main.c:11439:52-57: WARNING:
conversion to bool not needed here

Applied to net-next.