From nobody Wed Apr 8 01:35:49 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 691D1C433FE for ; Thu, 20 Oct 2022 18:29:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229449AbiJTS36 (ORCPT ); Thu, 20 Oct 2022 14:29:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230104AbiJTS3o (ORCPT ); Thu, 20 Oct 2022 14:29:44 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 463393B998 for ; Thu, 20 Oct 2022 11:29:40 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id m23so519099lji.2 for ; Thu, 20 Oct 2022 11:29:40 -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=Pok2LECBNlMvrqXKyrI6aFwHhW7o05S9x0G8ryNfPC0=; b=l8ymFiKj1kP/UjFBIEdasfBzNKRaUp4nsQr0RD6CqBJ3fY8i7gGAXZ1Wp8fh3LpCIs iijlSxtUdCfGqWetE6GfI19+/T98NOMgEllD+0Kmv9d3EKlWS5N1AOPP0gmGI5AI3Vwz wOJ7QYbLX10xtl5bI3NyCcWyaGkPS72nfms+5sVwm2dt8eEJghHWzM54cuiIfX96ENsz 7rcG2OEOgaaOE6utAb/qiD5eTZhtb0oQCIpv9zySvp+QNqzYPd1dKPbUoY+qo8JuKe+L rpOO8RC+4IVTsGPdjZTPbiWO+XEahSP5qPKH4xOUabNE255ou5HwmRNfY7GjprL4+cQG AEew== 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=Pok2LECBNlMvrqXKyrI6aFwHhW7o05S9x0G8ryNfPC0=; b=PjjXGlH5uFAJbTPsRs/ozsqY9JG7QJNgTIvsvbywBrGIycZsBh95osJXcXud9tiDeS X17o6exxDySJSIUTNEpOBLEkaF+dd++Gucq1Mr1ggKCZfpSwSOVT472srHmd7KFs9A7D bX5Vqd02i560edyOP+92si3OMFOvD+wb5B+Cnz4kQ0dYWsug1UvU1QBG1WwKSZdc4dH2 eBldHCh2wPyWK38ivvecMr8/AAhb8laXsqhScJKCT4TvLu8ngTfwmUFMDzax0yrKrlWo iTlEfFNVuWsEqfxrlf0qQ2Fu21WuyHQYBRMWzBePpjPjTH46f4ZlcsCje4nbRebNYTXo U6jA== X-Gm-Message-State: ACrzQf14484S1QvVFc4QWVR5sWJKq87BxWYvAqNkk7KRmt94dbtQ1u/1 NLwLZfTgw9kYxl5zSvRoQlA= X-Google-Smtp-Source: AMsMyM6j+quBbDwCyDVxQA3IeiyLmZ4JM4w+W5iObRCO1d4S23KJXTo+64fk2KDE5WOb14UqB5Y5Nw== X-Received: by 2002:a05:651c:222a:b0:26f:dc76:a5ee with SMTP id y42-20020a05651c222a00b0026fdc76a5eemr5767436ljq.242.1666290578508; Thu, 20 Oct 2022 11:29:38 -0700 (PDT) Received: from elroy-temp-vm.gaiao0uenmiufjlowqgp5yxwdh.gvxx.internal.cloudapp.net ([20.240.130.248]) by smtp.googlemail.com with ESMTPSA id h10-20020a0565123c8a00b00497a3e11608sm2797216lfv.303.2022.10.20.11.29.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 11:29:38 -0700 (PDT) From: Tanjuate Brunostar To: forest@alittletooquiet.net Cc: greg@kroah.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, outreachy@lists.linux.dev, Tanjuate Brunostar Subject: [PATCH 2/6] staging: vt6655: refactor long lines of code in s_uGetRTSCTSDuration Date: Thu, 20 Oct 2022 18:27:42 +0000 Message-Id: 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 f9d0b00d7cff..01e72999831b 100644 --- a/drivers/staging/vt6655/rxtx.c +++ b/drivers/staging/vt6655/rxtx.c @@ -188,20 +188,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); } @@ -323,73 +332,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