Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1228908

[PATCHv3 12/15] staging: rtl8192u: r8192U_core: rtl8192_tx: replace some inline conditions

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Raphaël Beamonte <raphael.beamonte@gmail.com>
Newsgroups linux.kernel
Subject [PATCHv3 12/15] staging: rtl8192u: r8192U_core: rtl8192_tx: replace some inline conditions
Date Sun, 20 Sep 2015 19:20:01 +0200
Message-ID <qaQrn-6fo-7@gated-at.bofh.it> (permalink)
References <qaQrn-6fo-9@gated-at.bofh.it>
X-Original-To Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references:mime-version:content-type :content-transfer-encoding; bh=YFR8t0XU4jW2oQYb/vs5yfvM6lVwHZGxbB5YorfQzeI=; b=ex946YaaOA2/OuK29lAk/x72aRJZC8V5cLZ2mpLCZcE8bd3AHOP+nWPt7tjZnvEoNG /2Jsza5H1WKNrTUl1hUgiI63tIdycv8p3W4Gke30AgnFcQv7mh+U2OSxcjpcY3g6uNec l6RsczU0mgxZl0Uepc88smVHOx55UO05WPdy4N3gQQFES1vD33EM5+ViIrzAUgLbse5t zTv50NI1ogqEYOzmm0XF5M6WxqHaGT9rnuyOaIusNBSJJFbDSeuwTQ1JLA6/XwHoYWEa WTEU/BBMRH8Jj1Br0+2d9WjsCIK3dAeICY5La45KGX6Mw+s4CxO571RLT7s4KWhmn4/H ScAQ==
X-Received by 10.140.234.212 with SMTP id f203mr19096676qhc.10.1442769404147; Sun, 20 Sep 2015 10:16:44 -0700 (PDT)
X-Mailer git-send-email 2.5.1
MIME-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 45
Organization linux.* mail to news gateway
X-Original-Cc Raphaël Beamonte <raphael.beamonte@gmail.com>, Cristina Opriceana <cristina.opriceana@gmail.com>, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
X-Original-Date Sun, 20 Sep 2015 13:14:24 -0400
X-Original-Message-ID <8e785405284d6ac4bb50047268f816cf37077aff.1442769012.git.raphael.beamonte@gmail.com>
X-Original-References <cover.1442769012.git.raphael.beamonte@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1228908

Show key headers only | View raw


Replace some inline conditions by a full if-else statement to make
the source clearer and follow the 80 characters kernel code style
rule.

Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
---
 drivers/staging/rtl8192u/r8192U_core.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index b3cedec..7dc1b34 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -1546,12 +1546,18 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
 	tx_fwinfo->RtsEnable = (tcb_desc->bRTSEnable) ? 1 : 0;
 	tx_fwinfo->CtsEnable = (tcb_desc->bCTSEnable) ? 1 : 0;
 	tx_fwinfo->RtsSTBC = (tcb_desc->bRTSSTBC) ? 1 : 0;
-	tx_fwinfo->RtsHT = (tcb_desc->rts_rate & 0x80) ? 1 : 0;
 	tx_fwinfo->RtsRate =  MRateToHwRate8190Pci((u8)tcb_desc->rts_rate);
-	tx_fwinfo->RtsSubcarrier = (tx_fwinfo->RtsHT == 0) ? (tcb_desc->RTSSC) : 0;
-	tx_fwinfo->RtsBandwidth = (tx_fwinfo->RtsHT == 1) ? ((tcb_desc->bRTSBW) ? 1 : 0) : 0;
-	tx_fwinfo->RtsShort = (tx_fwinfo->RtsHT == 0) ? (tcb_desc->bRTSUseShortPreamble ? 1 : 0) :
-			      (tcb_desc->bRTSUseShortGI ? 1 : 0);
+	if (tcb_desc->rts_rate & 0x80) {
+		tx_fwinfo->RtsHT = 1;
+		tx_fwinfo->RtsSubcarrier = 0;
+		tx_fwinfo->RtsBandwidth = (tcb_desc->bRTSBW) ? 1 : 0;
+		tx_fwinfo->RtsShort = (tcb_desc->bRTSUseShortGI ? 1 : 0);
+	} else {
+		tx_fwinfo->RtsHT = 0;
+		tx_fwinfo->RtsSubcarrier = tcb_desc->RTSSC;
+		tx_fwinfo->RtsBandwidth = 0;
+		tx_fwinfo->RtsShort = (tcb_desc->bRTSUseShortPreamble ? 1 : 0);
+	}
 
 	/* Set Bandwidth and sub-channel settings. */
 	if (priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20_40) {
-- 
2.5.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/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCHv3 12/15] staging: rtl8192u: r8192U_core: rtl8192_tx: replace some inline conditions Raphaël Beamonte <raphael.beamonte@gmail.com> - 2015-09-20 19:20 +0200

csiph-web