[PATCH v2 18/21] staging: rtl8192e: fix LONG_LINE warnings - replace ?: expressions

From: Mateusz Kulikowski
Date: Mon Apr 13 2015 - 17:49:06 EST


Replace temporary conditional (?:) with ordinary condition or max_t.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@xxxxxxxxx>
---
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 30 +++++++++++++++++++++---------
drivers/staging/rtl8192e/rtllib_rx.c | 2 +-
2 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index 2f4a96c..2362e84 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -403,17 +403,29 @@ static void dm_check_rate_adaptive(struct net_device *dev)
((bshort_gi_enabled) ? BIT31 : 0);

if (pra->ratr_state == DM_RATR_STA_HIGH) {
- HighRSSIThreshForRA = pra->high2low_rssi_thresh_for_ra;
- LowRSSIThreshForRA = (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) ?
- (pra->low_rssi_thresh_for_ra40M) : (pra->low_rssi_thresh_for_ra20M);
+ HighRSSIThreshForRA = pra->high2low_rssi_thresh_for_ra;
+ if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20)
+ LowRSSIThreshForRA =
+ pra->low_rssi_thresh_for_ra40M;
+ else
+ LowRSSIThreshForRA =
+ pra->low_rssi_thresh_for_ra20M;
} else if (pra->ratr_state == DM_RATR_STA_LOW) {
- HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra;
- LowRSSIThreshForRA = (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) ?
- (pra->low2high_rssi_thresh_for_ra40M) : (pra->low2high_rssi_thresh_for_ra20M);
+ HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra;
+ if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20)
+ LowRSSIThreshForRA =
+ pra->low2high_rssi_thresh_for_ra40M;
+ else
+ LowRSSIThreshForRA =
+ pra->low2high_rssi_thresh_for_ra20M;
} else {
- HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra;
- LowRSSIThreshForRA = (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) ?
- (pra->low_rssi_thresh_for_ra40M) : (pra->low_rssi_thresh_for_ra20M);
+ HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra;
+ if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20)
+ LowRSSIThreshForRA =
+ pra->low_rssi_thresh_for_ra40M;
+ else
+ LowRSSIThreshForRA =
+ pra->low_rssi_thresh_for_ra20M;
}

if (priv->undecorated_smoothed_pwdb >=
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index a66d8dc..0bf0163 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -1687,7 +1687,7 @@ static int rtllib_qos_convert_ac_to_parameters(struct rtllib_qos_parameter_info
qos_param->aifs[aci] = (ac_params->aci_aifsn) & 0x0f;

/* WMM spec P.11: The minimum value for AIFSN shall be 2 */
- qos_param->aifs[aci] = (qos_param->aifs[aci] < 2) ? 2 : qos_param->aifs[aci];
+ qos_param->aifs[aci] = max_t(u8, qos_param->aifs[aci], 2);

qos_param->cw_min[aci] = cpu_to_le16(ac_params->ecw_min_max &
0x0F);
--
1.8.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/