Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3154975rwi; Fri, 28 Oct 2022 16:57:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM62xMH9BWvHl69axjvYETOnoTC9xZgzlk++pUw1MHT6HO0qUGZVryE9Ch8DRwBIPx7/TIsk X-Received: by 2002:a05:6402:510d:b0:45d:a888:d831 with SMTP id m13-20020a056402510d00b0045da888d831mr1775990edd.315.1667001428490; Fri, 28 Oct 2022 16:57:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667001428; cv=none; d=google.com; s=arc-20160816; b=sG8pT7JCIQbHkm6zKrlF1h4eZxZdsP1EVQDsR0lWlrG9FKuazbmWpnXkrngDFuo3WQ 6iEbXcTdsnHAi7aqu36T3vHnxOyTkpa8CEUk4CvpEF9tjoEflMmDG4ZSPaOX58KoW7wc 6NWfjaWqwDZH8vBqXsfLUH5lMsqFwgkwtRfnlybknU8CeGLq0E1Z0UmWKDowJataB3qv +u5FxF7S/w/w2CnhflRVx2GfGqCRlwuvkMeXgZ87XqVrH1wFVxHzikPSVZTrz+G6bphc Y/c1xFO48Y/iX1H0qK34Dl7cZ32eIakyEXwCpViE5ObHYUwVn6kg2dse3+ws4IXPh5Hs JPlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9QYGjKdaJZ5AAMSss+Z2Pspk+VYwutLrf3hAHYJXKtc=; b=EUfW6Q8FQ66T8g9s+6Y4wXKZII0zC7353ZyG8p1QT/9b6Kd4uoMy5qLpBVbmALg7gK k3N13Dy3gXxeRmkCLRGo8d5VA5GRHjsXIzl7upjOwOOntHMNfUZ7CZVKWdpiXWzW7C+n QYZpOcZKnVEXbpOzU24AcxZZ0inKa4z8oRX4f9wOVWgZlKCdUrEcxldWXfNLw+j8uXXA anuFU6Q6kjuOVoWmN1kRWFuxjxr8mae3bqx1QWax6sJJaJf96p/LnpPVd5oVS6RzMzUA VMczLlEyqLUHJOmR1QBUDlOl97Lo9Urmw9jnNnnGIN8nv9NzbEAAuvlTyN4QMgSU0jQ6 HcHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nkJs1MhG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s5-20020a508d05000000b0045b50cee511si121835eds.122.2022.10.28.16.56.38; Fri, 28 Oct 2022 16:57:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nkJs1MhG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229823AbiJ1X0F (ORCPT + 99 others); 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-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: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 *priv, data_time = bb_get_frame_time(priv->preamble_type, pkt_type, frame_length, current_rate); if (rts_rsvtype == 0) { /* RTSTxRrvTime_bb */ - rts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 20, priv->byTopCCKBasicRate); - ack_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14, priv->byTopCCKBasicRate); + rts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 20, + priv->byTopCCKBasicRate); + ack_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14, + priv->byTopCCKBasicRate); cts_time = ack_time; } else if (rts_rsvtype == 1) { /* RTSTxRrvTime_ba, only in 2.4GHZ */ - rts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 20, priv->byTopCCKBasicRate); - cts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14, priv->byTopCCKBasicRate); - ack_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14, priv->byTopOFDMBasicRate); + rts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 20, + priv->byTopCCKBasicRate); + cts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14, + priv->byTopCCKBasicRate); + ack_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14, + priv->byTopOFDMBasicRate); } else if (rts_rsvtype == 2) { /* RTSTxRrvTime_aa */ - rts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 20, priv->byTopOFDMBasicRate); - ack_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14, priv->byTopOFDMBasicRate); + rts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 20, + priv->byTopOFDMBasicRate); + ack_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14, + priv->byTopOFDMBasicRate); cts_time = ack_time; } else if (rts_rsvtype == 3) { /* CTSTxRrvTime_ba, only in 2.4GHZ */ - cts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14, priv->byTopCCKBasicRate); - ack_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14, priv->byTopOFDMBasicRate); + cts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14, + priv->byTopCCKBasicRate); + ack_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14, + priv->byTopOFDMBasicRate); rrv_time = 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_private *pDevice, switch (byDurType) { case RTSDUR_BB: /* RTSDuration_bb */ - uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopCCKBasicRate); - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck); + uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, + pDevice->byTopCCKBasicRate); + uDurTime = uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck); break; case RTSDUR_BA: /* RTSDuration_ba */ - uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopCCKBasicRate); - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck); + uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, + pDevice->byTopCCKBasicRate); + uDurTime = uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck); break; case RTSDUR_AA: /* RTSDuration_aa */ - uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopOFDMBasicRate); - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck); + uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, + pDevice->byTopOFDMBasicRate); + uDurTime = uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck); break; case CTSDUR_BA: /* CTSDuration_ba */ - uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck); + uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, + cbFrameLength, wRate, bNeedAck); break; case RTSDUR_BA_F0: /* RTSDuration_ba_f0 */ - uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopCCKBasicRate); + uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, + pDevice->byTopCCKBasicRate); if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); + uDurTime = uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); + uDurTime = uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); break; case RTSDUR_AA_F0: /* RTSDuration_aa_f0 */ - uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopOFDMBasicRate); + uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, + pDevice->byTopOFDMBasicRate); if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); + uDurTime = uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); + uDurTime = uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); break; case RTSDUR_BA_F1: /* RTSDuration_ba_f1 */ - uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopCCKBasicRate); + uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, + pDevice->byTopCCKBasicRate); if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); + uDurTime = uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); + uDurTime = uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); break; case RTSDUR_AA_F1: /* RTSDuration_aa_f1 */ - uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopOFDMBasicRate); + uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, + pDevice->byTopOFDMBasicRate); if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); + uDurTime = uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); + uDurTime = uCTSTime + 2 * pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); break; case CTSDUR_BA_F0: /* CTSDuration_ba_f0 */ if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) - uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); + uDurTime = pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) - uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); + uDurTime = pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); break; case CTSDUR_BA_F1: /* CTSDuration_ba_f1 */ if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) - uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); + uDurTime = pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) - uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); + uDurTime = pDevice->uSIFS + + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, + wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); break; -- 2.34.1