From nobody Wed Apr 8 21:18:35 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 C7801FA3741 for ; Fri, 28 Oct 2022 23:26:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229826AbiJ1X0F (ORCPT ); Fri, 28 Oct 2022 19:26:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229808AbiJ1XZ6 (ORCPT ); Fri, 28 Oct 2022 19:25:58 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88C87249D15 for ; Fri, 28 Oct 2022 16:25:52 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id g12so10650024lfh.3 for ; Fri, 28 Oct 2022 16:25:52 -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=9QYGjKdaJZ5AAMSss+Z2Pspk+VYwutLrf3hAHYJXKtc=; b=nkJs1MhGhax3WDtTu2CVq4IYT7j0/16CNSBN+kwE4u1OAI1A/zADtodk9o6QAsupm+ lFOj1y7dKF93ncO6EEosPOOQV4Ey2frVsttr/fXsipVMTuebKPN9HNOItnbP1QocJKCc zMHvPzELJgVobg0DnE86oT5lutcFIxTNV/IBPkh1N9lPelx2BZxEXqrELHFFARNpcpSQ TQG2J5o0HDwjshBc4yzVEH+k3totHNzsEoXDHyuHzASTLT1V4ZaoYRVOMQTamgDsBejJ FAzMZZIeWvatY/6kA8XOGP0f72y2ikAsnj1Jv9Fmsa76GTyfT0f0jmR3+wBVGGb+ycdy IVxg== 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=9QYGjKdaJZ5AAMSss+Z2Pspk+VYwutLrf3hAHYJXKtc=; b=KEQe1yzRRmZF9y602HaFlzbQrH6k/xupy5hION/HZ3F2yJnWRDI/tnRTS8iMUzweDG UwQUhqzaeT42vktmYt9eWwSKhp+PRHbbnmHBgoAPBW1goacXbht0GczrNpJOB6xmyBJJ wQ+MS2/x5USdnbcV+XiVXIRdl1lG0qKIhR7UTdTjYamIZoBVMJwgO1rjL1Bwcm7rO8dG MAzOM56p0+DBpDSpyzaxTpCYx0F7FoEn9a/TmCzPDlz6iWlNes87nlj7wCcsA72OQNeX spqJvm114omSVI6c/YwzYzXWP/b898Tqo+L7/EE+T4ZtR6Kq25b0j4IzUxYrvnBp6lQR vLAQ== X-Gm-Message-State: ACrzQf1xbs0T0gjGTqMJhCAAVMD+FwMAAzKthwQBCni/7ZzbvoR1/NwZ aC7uph5yI9oHLbA8AN3CABc= X-Google-Smtp-Source: AMsMyM76+DSJEgccz4o3SioEl35CUNcCjWlxlhvWnIWb1Ea2lwJAgmL83iz0R/3yoXaVrkK/Hvms3w== X-Received: by 2002:a05:6512:22c3:b0:4a2:7cd9:1f1f with SMTP id g3-20020a05651222c300b004a27cd91f1fmr601951lfu.582.1666999551228; Fri, 28 Oct 2022 16:25:51 -0700 (PDT) Received: from elroy-temp-vm.gaiao0uenmiufjlowqgp5yxwdh.gvxx.internal.cloudapp.net ([20.240.130.248]) by smtp.googlemail.com with ESMTPSA id s2-20020a056512202200b0049aa20af00fsm7064lfs.21.2022.10.28.16.25.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 16:25:50 -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 v9 2/6] staging: vt6655: split long code lines in s_uGetRTSCTSDuration Date: Fri, 28 Oct 2022 23:23:23 +0000 Message-Id: <0e6a307052d3a354a850a502e509f46baccdbe1e.1666995639.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" Increase code visibility by splitting 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