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 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel