From nobody Wed Apr 8 08:18:59 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5913CC38A2D for ; Mon, 24 Oct 2022 10:02:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230286AbiJXKCf (ORCPT ); Mon, 24 Oct 2022 06:02:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230287AbiJXKCQ (ORCPT ); Mon, 24 Oct 2022 06:02:16 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B53905A16F for ; Mon, 24 Oct 2022 03:02:11 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id bp15so15785469lfb.13 for ; Mon, 24 Oct 2022 03:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GisTkrXG4tQARuScMo9w+It1weHIQ73W/nVCSWIv2to=; b=mjai6n4kDY62qBhhamKh6a+Wa9fRoEMVdPXhkHh+FABVOM7L3WyJBPIvO55VpwhH2B U+pwdT20nPzYhNZi7mw4eGcFug1jIO1FeXBeOrtNpUQoF01oIDKtbfTYo7PafCo9XIuv SXjdIPay9qqPgy9vXe/By2a8xB20m+a22rzZ3O4w75CLQVYfTuXHntNOCK0ffnCk3O51 cQ2BO2mFKV4j9oUJychvnwKN/Bc4nYUG5CZ/gdQggFxf/8GW802UyeFoPxi8Z0THm3j3 /jmbT1RhWTE8JTQpTPC1VaYVWrlj7+KqmnQJRmym5B8h5lvV1wgbaZ/d6hINzAV0i7kl b5Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GisTkrXG4tQARuScMo9w+It1weHIQ73W/nVCSWIv2to=; b=0/8X1qZtzLDKJCvIcgr/5Jyljih4YTwSKPRx+VtKaBeovMdqFOuDlwv+I7StqVS24Y 9ay2yHUyQOCeFWUGvtL93fg3FpbrbJ1JUUb3gzbRXHP4pv+Ie8RjBn38NEbWaYZlNXyj kPeUXiRxWy5BElS2ljKPKB1zlmT++f5iRhhI51lBkXS/tES4udf3+946srdUBEt+VFY8 MLCTHCvr1xfLvO9A8A0euU3HaTMfyEIv8oyLEBK7w+WSEC13cERPoo5+5M6oXFwvRxLA b7E9Te4+CVVdBkTUHrkzAjsQ0nKeZaXr8zP+O+c4CGRmV3nsaIRluaWlir2y24foXAft rvEg== X-Gm-Message-State: ACrzQf1GuL1oA1YwPiwZ9Ad/aBK8WhR0BuzXIPMor9WJnlI4kbAxUaso 8lBMx8S3LAr6zEOb1C95u1k= X-Google-Smtp-Source: AMsMyM5Uvbhl0QUoKSFojXRe1AwIGasJrHDwoCn5apvgbDq/sSDixte2MFHCILc07v5xrop3D37BCg== X-Received: by 2002:a05:6512:2616:b0:4a2:1723:cf40 with SMTP id bt22-20020a056512261600b004a21723cf40mr12150226lfb.354.1666605729930; Mon, 24 Oct 2022 03:02:09 -0700 (PDT) Received: from elroy-temp-vm.gaiao0uenmiufjlowqgp5yxwdh.gvxx.internal.cloudapp.net ([20.240.130.248]) by smtp.googlemail.com with ESMTPSA id s9-20020a2eb629000000b0026dfbdfc1ddsm4896832ljn.11.2022.10.24.03.02.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 03:02:09 -0700 (PDT) From: Tanjuate Brunostar To: gregkh@linuxfoundation.org Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, outreachy@lists.linux.dev, Tanjuate Brunostar Subject: [PATCH v4 2/6] staging: vt6655: refactor long lines of code in s_uGetRTSCTSDuration Date: Mon, 24 Oct 2022 10:01:48 +0000 Message-Id: <0e6a307052d3a354a850a502e509f46baccdbe1e.1666605225.git.tanjubrunostar0@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" fix checkpatch errors by refactoring long lines of code in the function: s_= uGetRTSCTSDuration Signed-off-by: Tanjuate Brunostar --- drivers/staging/vt6655/rxtx.c | 108 ++++++++++++++++++++++++---------- 1 file changed, 76 insertions(+), 32 deletions(-) diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c index 7eb7c6eb5cf0..8e56a7ee8035 100644 --- a/drivers/staging/vt6655/rxtx.c +++ b/drivers/staging/vt6655/rxtx.c @@ -186,20 +186,29 @@ static __le16 get_rtscts_time(struct vnt_private *pri= v, =20 data_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, frame_leng= th, current_rate); if (rts_rsvtype =3D=3D 0) { /* RTSTxRrvTime_bb */ - rts_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, 20, priv->= byTopCCKBasicRate); - ack_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, 14, priv->= byTopCCKBasicRate); + rts_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, 20, + priv->byTopCCKBasicRate); + ack_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, 14, + priv->byTopCCKBasicRate); cts_time =3D ack_time; } else if (rts_rsvtype =3D=3D 1) { /* RTSTxRrvTime_ba, only in 2.4GHZ */ - rts_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, 20, priv->= byTopCCKBasicRate); - cts_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, 14, priv->= byTopCCKBasicRate); - ack_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, 14, priv->= byTopOFDMBasicRate); + rts_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, 20, + priv->byTopCCKBasicRate); + cts_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, 14, + priv->byTopCCKBasicRate); + ack_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, 14, + priv->byTopOFDMBasicRate); } else if (rts_rsvtype =3D=3D 2) { /* RTSTxRrvTime_aa */ - rts_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, 20, priv->= byTopOFDMBasicRate); - ack_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, 14, priv->= byTopOFDMBasicRate); + rts_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, 20, + priv->byTopOFDMBasicRate); + ack_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, 14, + priv->byTopOFDMBasicRate); cts_time =3D ack_time; } else if (rts_rsvtype =3D=3D 3) { /* CTSTxRrvTime_ba, only in 2.4GHZ */ - cts_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, 14, priv->= byTopCCKBasicRate); - ack_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, 14, priv->= byTopOFDMBasicRate); + cts_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, 14, + priv->byTopCCKBasicRate); + ack_time =3D bb_get_frame_time(priv->preamble_type, pkt_type, 14, + priv->byTopOFDMBasicRate); rrv_time =3D cts_time + ack_time + data_time + 2 * priv->uSIFS; return cpu_to_le16((u16)rrv_time); } @@ -320,73 +329,108 @@ static __le16 s_uGetRTSCTSDuration(struct vnt_privat= e *pDevice, =20 switch (byDurType) { case RTSDUR_BB: /* RTSDuration_bb */ - uCTSTime =3D bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pD= evice->byTopCCKBasicRate); - uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, by= PktType, cbFrameLength, wRate, bNeedAck); + uCTSTime =3D bb_get_frame_time(pDevice->preamble_type, byPktType, 14, + pDevice->byTopCCKBasicRate); + uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck); break; =20 case RTSDUR_BA: /* RTSDuration_ba */ - uCTSTime =3D bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pD= evice->byTopCCKBasicRate); - uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, by= PktType, cbFrameLength, wRate, bNeedAck); + uCTSTime =3D bb_get_frame_time(pDevice->preamble_type, byPktType, 14, + pDevice->byTopCCKBasicRate); + uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck); break; =20 case RTSDUR_AA: /* RTSDuration_aa */ - uCTSTime =3D bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pD= evice->byTopOFDMBasicRate); - uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, by= PktType, cbFrameLength, wRate, bNeedAck); + uCTSTime =3D bb_get_frame_time(pDevice->preamble_type, byPktType, 14, + pDevice->byTopOFDMBasicRate); + uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck); break; =20 case CTSDUR_BA: /* CTSDuration_ba */ - uDurTime =3D pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFram= eLength, wRate, bNeedAck); + uDurTime =3D pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, + cbFrameLength, wRate, bNeedAck); break; =20 case RTSDUR_BA_F0: /* RTSDuration_ba_f0 */ - uCTSTime =3D bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pD= evice->byTopCCKBasicRate); + uCTSTime =3D bb_get_frame_time(pDevice->preamble_type, byPktType, 14, + pDevice->byTopCCKBasicRate); if ((byFBOption =3D=3D AUTO_FB_0) && (wRate >=3D RATE_18M) && (wRate <= =3D RATE_54M)) - uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, b= yPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); + uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); else if ((byFBOption =3D=3D AUTO_FB_1) && (wRate >=3D RATE_18M) && (wRat= e <=3D RATE_54M)) - uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, b= yPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); + uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); =20 break; =20 case RTSDUR_AA_F0: /* RTSDuration_aa_f0 */ - uCTSTime =3D bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pD= evice->byTopOFDMBasicRate); + uCTSTime =3D bb_get_frame_time(pDevice->preamble_type, byPktType, 14, + pDevice->byTopOFDMBasicRate); if ((byFBOption =3D=3D AUTO_FB_0) && (wRate >=3D RATE_18M) && (wRate <= =3D RATE_54M)) - uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, b= yPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); + uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); else if ((byFBOption =3D=3D AUTO_FB_1) && (wRate >=3D RATE_18M) && (wRat= e <=3D RATE_54M)) - uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, b= yPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); + uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); =20 break; =20 case RTSDUR_BA_F1: /* RTSDuration_ba_f1 */ - uCTSTime =3D bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pD= evice->byTopCCKBasicRate); + uCTSTime =3D bb_get_frame_time(pDevice->preamble_type, byPktType, 14, + pDevice->byTopCCKBasicRate); if ((byFBOption =3D=3D AUTO_FB_0) && (wRate >=3D RATE_18M) && (wRate <= =3D RATE_54M)) - uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, b= yPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); + uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); else if ((byFBOption =3D=3D AUTO_FB_1) && (wRate >=3D RATE_18M) && (wRat= e <=3D RATE_54M)) - uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, b= yPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); + uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); =20 break; =20 case RTSDUR_AA_F1: /* RTSDuration_aa_f1 */ - uCTSTime =3D bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pD= evice->byTopOFDMBasicRate); + uCTSTime =3D bb_get_frame_time(pDevice->preamble_type, byPktType, 14, + pDevice->byTopOFDMBasicRate); if ((byFBOption =3D=3D AUTO_FB_0) && (wRate >=3D RATE_18M) && (wRate <= =3D RATE_54M)) - uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, b= yPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); + uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); else if ((byFBOption =3D=3D AUTO_FB_1) && (wRate >=3D RATE_18M) && (wRat= e <=3D RATE_54M)) - uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, b= yPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); + uDurTime =3D uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); =20 break; =20 case CTSDUR_BA_F0: /* CTSDuration_ba_f0 */ if ((byFBOption =3D=3D AUTO_FB_0) && (wRate >=3D RATE_18M) && (wRate <= =3D RATE_54M)) - uDurTime =3D pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFra= meLength, wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); + uDurTime =3D pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); else if ((byFBOption =3D=3D AUTO_FB_1) && (wRate >=3D RATE_18M) && (wRat= e <=3D RATE_54M)) - uDurTime =3D pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFra= meLength, wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); + uDurTime =3D pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); =20 break; =20 case CTSDUR_BA_F1: /* CTSDuration_ba_f1 */ if ((byFBOption =3D=3D AUTO_FB_0) && (wRate >=3D RATE_18M) && (wRate <= =3D RATE_54M)) - uDurTime =3D pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFra= meLength, wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); + uDurTime =3D pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); else if ((byFBOption =3D=3D AUTO_FB_1) && (wRate >=3D RATE_18M) && (wRat= e <=3D RATE_54M)) - uDurTime =3D pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFra= meLength, wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); + uDurTime =3D pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); =20 break; =20 --=20 2.34.1