lkml.org 
[lkml]   [2015]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 18/21] staging: rtl8192e: fix LONG_LINE warnings - replace ?: expressions
Date
Replace temporary conditional (?:) with ordinary condition or max_t.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
---
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


\
 
 \ /
  Last update: 2015-04-14 00:21    [W:0.974 / U:1.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site