Skip to contentSkip to conversation

atl1c: remove unneeded conversions to bool

PATCH New Andrew F. Davis 1 participant 7 messages Oct 16, 2019

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

PATCH 4/10 atl1c: remove unneeded conversions to bool

Found with scripts/coccinelle/misc/boolconv.cocci.

---
 drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/atheros/atl1c/atl1c_main.c +1 -1
index 2b239ecea05f..d6385899762c 100644
@@ -1189,7 +1189,7 @@ static void atl1c_start_mac(struct atl1c_adapter *adapter)
 	struct atl1c_hw *hw = &adapter->hw;
 	u32 mac, txq, rxq;
 
-	hw->mac_duplex = adapter->link_duplex = FULL_DUPLEX ? true : false;
+	hw->mac_duplex = adapter->link_duplex = FULL_DUPLEX;
 	hw->mac_speed = adapter->link_speed = SPEED_1000 ?
 		atl1c_mac_speed_1000 : atl1c_mac_speed_10_100;
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH 5/10 mlxsw: Remove unneeded conversions to bool

Found with scripts/coccinelle/misc/boolconv.cocci.

---
 drivers/net/ethernet/mellanox/mlxsw/switchx2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlxsw/switchx2.c +1 -1
index 1c14c051ee52..1de6a9c6cd00 100644
@@ -180,7 +180,7 @@ static int mlxsw_sx_port_oper_status_get(struct mlxsw_sx_port *mlxsw_sx_port,
 	if (err)
 		return err;
 	oper_status = mlxsw_reg_paos_oper_status_get(paos_pl);
-	*p_is_up = oper_status = MLXSW_PORT_ADMIN_STATUS_UP ? true : false;
+	*p_is_up = oper_status = MLXSW_PORT_ADMIN_STATUS_UP;
 	return 0;
 }
 
Signature · 1 line
2.17.1
#2 lore raw

PATCH 6/10 thermal: devfreq_cooling: Remove unneeded conversions to bool

In reply to Andrew F. Davis

Found with scripts/coccinelle/misc/boolconv.cocci.

---
 drivers/thermal/devfreq_cooling.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/devfreq_cooling.c +1 -1
index ef59256887ff..e386a3241700 100644
@@ -85,7 +85,7 @@ static int partition_enable_opps(struct devfreq_cooling_device *dfc,
 		struct dev_pm_opp *opp;
 		int ret = 0;
 		unsigned int freq = dfc->freq_table[i];
-		bool want_enable = i >= cdev_state ? true : false;
+		bool want_enable = i >= cdev_state;
 
 		opp = dev_pm_opp_find_freq_exact(dev, freq, !want_enable);
 
Signature · 1 line
2.17.1
#3 lore raw

PATCH 7/10 Buslogic: Remove unneeded conversions to bool

In reply to Andrew F. Davis

Found with scripts/coccinelle/misc/boolconv.cocci.

---
 drivers/scsi/BusLogic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/BusLogic.c +1 -0
index c25e8a54e869..6a0a74e9edc9 100644
@@ -2236,7 +2236,7 @@ static bool __init blogic_inquiry(struct blogic_adapter *adapter)
 					"INQUIRE INSTALLED DEVICES ID 0 TO 7");
 		for (tgt_id = 0; tgt_id < 8; tgt_id++)
 			adapter->tgt_flags[tgt_id].tgt_exists -				(installed_devs0to7[tgt_id] != 0 ? true : false);
+				(installed_devs0to7[tgt_id] != 0);
 	}
 	/*
 	   Issue the Inquire Setup Information command.
Signature · 1 line
2.17.1
#4 lore raw

PATCH 8/10 i40e: Remove unneeded conversions to bool

In reply to Andrew F. Davis

Found with scripts/coccinelle/misc/boolconv.cocci.

---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
index 6031223eafab..87a9f2b586d5 100644
@@ -11435,7 +11435,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.17.1
#5 lore raw

PATCH 9/10 ixgbe: Remove unneeded conversions to bool

In reply to Andrew F. Davis

Found with scripts/coccinelle/misc/boolconv.cocci.

---
 drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +1 -2
index 0bd1294ba517..2d896d663e3d 100644
@@ -64,8 +64,7 @@ bool ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw)
 			hw->mac.ops.check_link(hw, &speed, &link_up, false);
 			/* if link is down, assume supported */
 			if (link_up)
-				supported = speed = IXGBE_LINK_SPEED_1GB_FULL ?
-				true : false;
+				supported = speed = IXGBE_LINK_SPEED_1GB_FULL;
 			else
 				supported = true;
 		}
Signature · 1 line
2.17.1
#6 lore raw

PATCH 10/10 ath5k: Remove unneeded conversions to bool

In reply to Andrew F. Davis

Found with scripts/coccinelle/misc/boolconv.cocci.

---
 drivers/net/wireless/ath/ath5k/ani.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath5k/ani.c +1 -1
index 0624333f5430..850c608b43a3 100644
@@ -501,7 +501,7 @@ ath5k_ani_calibration(struct ath5k_hw *ah)
 
 	if (as->ofdm_errors > ofdm_high || as->cck_errors > cck_high) {
 		/* too many PHY errors - we have to raise immunity */
-		bool ofdm_flag = as->ofdm_errors > ofdm_high ? true : false;
+		bool ofdm_flag = as->ofdm_errors > ofdm_high;
 		ath5k_ani_raise_immunity(ah, as, ofdm_flag);
 		ath5k_ani_period_restart(as);
 
Signature · 1 line
2.17.1