Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3134828rwi; Fri, 28 Oct 2022 16:34:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM45ZBfh9Viq8ROWYyUsPTZcPYB9bwKmaWWrCRM/nVIOQCrre6Lw+ps3WsKJsoRgc4ifLzxn X-Received: by 2002:a17:90b:4a92:b0:213:54f:ddd8 with SMTP id lp18-20020a17090b4a9200b00213054fddd8mr19324514pjb.234.1667000088472; Fri, 28 Oct 2022 16:34:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667000088; cv=none; d=google.com; s=arc-20160816; b=AsBBvz0ZwmWkj0FiEvpWljcO9TtrwmcWRUTDGhwGG+9aUApuYNTIGYoafBBEni0jSM p3McautM2k7gn4gKuGf3Hqj4d3RTdhmtmt7rB8GofQip1B7e3QCyBouLXP4Hzb7lWEQh JTbwlT4XF+FKdFP0vaSy65NgcFfgXsg5zTdy495q43ERdc3tVbGkXOl5LHtWTHttEtvS G6Mef5V/PLEiKEL+GL4dhZ8jF5s90GcbsZeMvX/a8Y8wcd+/H+SzndDv1ZQ6yaTyQ3fG OIEp73WOjUNnoKZN1W4lj5Rt/qClNbRLrsrJI1NtV0mE2JVNhGSNHcwvZ9Brd7TdYgWz tIxw== 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=UklhJgGoyZGLy7w3immveIEsxPRlB+UWC/kvGVYWMME=; b=Wl1ei9J19Mh1kvVVbwQ0fBb2zVxD2fP7hQfe77u+OCY/C6vnR3NakqbZ/oXmDcFUr7 PRVKnU/QM1FXOT5fgQyiEVbwKMeaBlKoQRD8zuhkcUArgFfoHDSnZPARK3eZHtURmJgo cc3nbBzTzY16wRFPMDEpsifI5T2WXMq3xPGllIqWAy3X5Q3Mci1CcFTjfplcCjVCETpF uLYsJG0Z8MamcMLZuwHF4A7t+xHSsrsEkWMYT809rOyTdJdmyFS2V4zJ7MHOllqyaZHf wHLkxMClCxp/qCM5rxleoAKru9pDbZREKhbxWKW4twYe4qyj6etk5ph5s6d7+pd3KOnp LA/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XflN1pJr; 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 q4-20020a170902dac400b001865d74328esi1661plx.312.2022.10.28.16.34.37; Fri, 28 Oct 2022 16:34:48 -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=XflN1pJr; 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 S229841AbiJ1X0T (ORCPT + 99 others); Fri, 28 Oct 2022 19:26:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229833AbiJ1X0M (ORCPT ); Fri, 28 Oct 2022 19:26:12 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6828A1DC82A for ; Fri, 28 Oct 2022 16:26:05 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id g7so10634661lfv.5 for ; Fri, 28 Oct 2022 16:26:05 -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=UklhJgGoyZGLy7w3immveIEsxPRlB+UWC/kvGVYWMME=; b=XflN1pJrFMvDtNQ0wg9hNRmYteseb1LBOr+PAnniO3oY9YRe1Npb6kfpF3GxLubpqK bPabpIptyS561e3a05MdycHZJBSE/clD79xLgM2rARfFaose6HLAolFRQsHLYldWO9bc aDpMGWc7iKBW40Jl5o7nUxjGTTO03d8434ioTgvCWlf2nauBa1ny33lTMr0c2/0aewaC 6ydISlUwSWoViB0CX1q/fvKg5GiMAg5OueTAGgcXgK1qSzPQiFsGCo/JcAty2o/9iYeC R5fAl38dKb31Jv1z/dMtweZ+6oLc+yJtKZCQPv56+WKe4ArAQxU5H4vf6sHqYx4nMN6n F2BQ== 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=UklhJgGoyZGLy7w3immveIEsxPRlB+UWC/kvGVYWMME=; b=poTlK774qf/SWlzJGYM/+hlZa98bUi++t4tCP+RZVssYDEEOEeUGBoQkKM17sFuxvT xlIkrWBb9KIFKo2efV3H2Hs4G2OhPwM3joCtckLRsIEcvjryp0QGREfVCthEMqLJIrr9 kgVqznUfFZuAveZuB0dH1W8a0UzzMRQa8F1ah3cxo4LN5iv5qk3zJkOQlhu9ggsawsWc zlC3r4LvWmGF/cEDEO6LdAMF7pdHmbSYQHD05XepB/F+xb6Q0u91JqfzF3qpTWy81izQ PienUrv7nfSqWOz7VAhAp3Q1j8DGatu4zDNXS4bJIPZYmFuBS1LP8EDWf8opuUaMTjh3 3ewg== X-Gm-Message-State: ACrzQf2ySuoObgSSmAWWfEYZssvw7+HEWeWUdxRM32OoSfoJabBBzsG/ zZDbAmt2nRagb6u5GLwgtBM= X-Received: by 2002:ac2:5dd4:0:b0:4af:fbde:bca4 with SMTP id x20-20020ac25dd4000000b004affbdebca4mr592331lfq.387.1666999563735; Fri, 28 Oct 2022 16:26:03 -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.26.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 16:26:03 -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 4/6] staging: vt6655: split long lines of code in s_vGenerateTxParamete Date: Fri, 28 Oct 2022 23:23:25 +0000 Message-Id: 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_vGenerateTxParameter Signed-off-by: Tanjuate Brunostar --- drivers/staging/vt6655/rxtx.c | 68 ++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 21 deletions(-) diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c index 7b6571ba7c36..475526b73e1a 100644 --- a/drivers/staging/vt6655/rxtx.c +++ b/drivers/staging/vt6655/rxtx.c @@ -834,7 +834,9 @@ static void s_vFillCTSHead(struct vnt_private *pDevice, } if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) { - if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) { + if (byFBOption != AUTO_FB_NONE && + uDMAIdx != TYPE_ATIMDMA && + uDMAIdx != TYPE_BEACONDMA) { /* Auto Fall back */ struct vnt_cts_fb *buf = pvCTS; /* Get SignalField, ServiceField & Length */ @@ -873,7 +875,11 @@ static void s_vFillCTSHead(struct vnt_private *pDevice, ether_addr_copy(buf->data.ra, pDevice->abyCurrentNetAddr); - } else { /* if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) */ + } else { + /* if (byFBOption != AUTO_FB_NONE && + * uDMAIdx != TYPE_ATIMDMA && + * uDMAIdx != TYPE_BEACONDMA) + */ struct vnt_cts *buf = pvCTS; /* Get SignalField, ServiceField & Length */ vnt_get_phy_field(pDevice, uCTSFrameLen, @@ -959,50 +965,70 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice, /* Fill RsvTime */ struct vnt_rrv_time_rts *buf = pvRrvTime; - buf->rts_rrv_time_aa = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize, wCurrentRate); - buf->rts_rrv_time_ba = get_rtscts_time(pDevice, 1, byPktType, cbFrameSize, wCurrentRate); - buf->rts_rrv_time_bb = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize, wCurrentRate); - buf->rrv_time_a = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK); - buf->rrv_time_b = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, pDevice->byTopCCKBasicRate, bNeedACK); - - s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption); + buf->rts_rrv_time_aa = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize, + wCurrentRate); + buf->rts_rrv_time_ba = get_rtscts_time(pDevice, 1, byPktType, cbFrameSize, + wCurrentRate); + buf->rts_rrv_time_bb = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize, + wCurrentRate); + buf->rrv_time_a = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize, + wCurrentRate, bNeedACK); + buf->rrv_time_b = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, + pDevice->byTopCCKBasicRate, + bNeedACK); + + s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, + psEthHeader, wCurrentRate, byFBOption); } else {/* RTS_needless, PCF mode */ struct vnt_rrv_time_cts *buf = pvRrvTime; - buf->rrv_time_a = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK); - buf->rrv_time_b = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, pDevice->byTopCCKBasicRate, bNeedACK); - buf->cts_rrv_time_ba = get_rtscts_time(pDevice, 3, byPktType, cbFrameSize, wCurrentRate); + buf->rrv_time_a = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize, + wCurrentRate, bNeedACK); + buf->rrv_time_b = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, + pDevice->byTopCCKBasicRate, + bNeedACK); + buf->cts_rrv_time_ba = get_rtscts_time(pDevice, 3, byPktType, cbFrameSize, + wCurrentRate); /* Fill CTS */ - s_vFillCTSHead(pDevice, uDMAIdx, byPktType, pvCTS, cbFrameSize, bNeedACK, bDisCRC, wCurrentRate, byFBOption); + s_vFillCTSHead(pDevice, uDMAIdx, byPktType, pvCTS, cbFrameSize, bNeedACK, + bDisCRC, wCurrentRate, byFBOption); } } else if (byPktType == PK_TYPE_11A) { if (pvRTS) {/* RTS_need, non PCF mode */ struct vnt_rrv_time_ab *buf = pvRrvTime; - buf->rts_rrv_time = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize, wCurrentRate); - buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK); + buf->rts_rrv_time = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize, + wCurrentRate); + buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize, + wCurrentRate, bNeedACK); /* Fill RTS */ - s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption); + s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, + psEthHeader, wCurrentRate, byFBOption); } else if (!pvRTS) {/* RTS_needless, non PCF mode */ struct vnt_rrv_time_ab *buf = pvRrvTime; - buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11A, cbFrameSize, wCurrentRate, bNeedACK); + buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11A, cbFrameSize, + wCurrentRate, bNeedACK); } } else if (byPktType == PK_TYPE_11B) { if (pvRTS) {/* RTS_need, non PCF mode */ struct vnt_rrv_time_ab *buf = pvRrvTime; - buf->rts_rrv_time = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize, wCurrentRate); - buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK); + buf->rts_rrv_time = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize, + wCurrentRate); + buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, + wCurrentRate, bNeedACK); /* Fill RTS */ - s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption); + s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, + psEthHeader, wCurrentRate, byFBOption); } else { /* RTS_needless, non PCF mode */ struct vnt_rrv_time_ab *buf = pvRrvTime; - buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK); + buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, + wCurrentRate, bNeedACK); } } } -- 2.34.1