Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932915AbbDMVtA (ORCPT ); Mon, 13 Apr 2015 17:49:00 -0400 Received: from mail-la0-f48.google.com ([209.85.215.48]:34481 "EHLO mail-la0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754684AbbDMVsn (ORCPT ); Mon, 13 Apr 2015 17:48:43 -0400 From: Mateusz Kulikowski To: gregkh@linuxfoundation.org Cc: Mateusz Kulikowski , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 18/21] staging: rtl8192e: fix LONG_LINE warnings - replace ?: expressions Date: Mon, 13 Apr 2015 23:47:41 +0200 Message-Id: <1428961664-4241-19-git-send-email-mateusz.kulikowski@gmail.com> X-Mailer: git-send-email 1.8.4.1 In-Reply-To: <1428961664-4241-1-git-send-email-mateusz.kulikowski@gmail.com> References: <1428961664-4241-1-git-send-email-mateusz.kulikowski@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3145 Lines: 72 Replace temporary conditional (?:) with ordinary condition or max_t. Signed-off-by: Mateusz Kulikowski --- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/