From patchwork Thu Oct 27 06:01:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tanjuate Brunostar X-Patchwork-Id: 11579 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp51920wru; Wed, 26 Oct 2022 23:03:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7fPuuCeCYYCX5Iklq9K/JnQ7KXfN4JMBMLVWoAgSMUAJ3p9LOAth2KqFntz/alnQ6Srqif X-Received: by 2002:a63:81c8:0:b0:462:953a:8534 with SMTP id t191-20020a6381c8000000b00462953a8534mr39862056pgd.69.1666850605251; Wed, 26 Oct 2022 23:03:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666850605; cv=none; d=google.com; s=arc-20160816; b=b5mVVBHmt8JqdPXX99lfGPfdgZ9n72+CpIkomlgM9FIN/6O9X1feEDJX8LQfBH1OQ2 DHCZ8cyr0yw/T9dRrY8nqR4qIo2NNrhyIe7AhNVMqTSIhqszxhvkuViQxslhpyHSpoiN LpZXckHI8gA9iqO72jyz4DMWoOkicd6P2bMxIxmWihNof3R61QmFefq5dR621kftjbyY 0DdEumUuJgCwTYw40B/3URhdrcEXilHKwh7QHxFmdHjkkWqMOxN233Z62O1E69ZzZ8AI xAIyLp4Ibe15i9Sm12LwO+N/CnMwYrgX036/PHaBtyS80iqiq/nVLu9XngLsXGhkMIqI /LAQ== 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=8Mcq4XElldK8n+d5RjVbZo8PZpT7nLSBwi7AAq7x+9Q=; b=E/4YuUHJHqCRGX7sO570Ssc846OOYvQ6d+KPSyZKLIAZWa6hyMRM9C8QtJ7WmSGjw2 qpShrjtLFsCru3bW9TlrXkSZKa5Hg/81q+uh8RMs282dSQRGjqZz8UnRiK087AyDnfaZ 7fIBoqkmSM8evshWLVOvid18qv2dxusK9X500k7D0JnXfUW454ibHByrwSNWOYCrC0Ve ROnP32a0Ur82AzU9z78GR6FawTpAbGHcFU/JDOZQc9r345o55EWnqO8Hp0y7kdKZtnHr WOdttvnsyjdRqLQ0JUP3sEJ00ucCm1iOmWn2aVPqVQsI4VEO6cWGQifNyAaOqdbCMqZe MzNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZjHoPw+i; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o186-20020a625ac3000000b0054d5253e7d7si730089pfb.190.2022.10.26.23.03.11; Wed, 26 Oct 2022 23:03:25 -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=ZjHoPw+i; 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 S234225AbiJ0GCG (ORCPT + 99 others); Thu, 27 Oct 2022 02:02:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234290AbiJ0GBy (ORCPT ); Thu, 27 Oct 2022 02:01:54 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B7A37CA80 for ; Wed, 26 Oct 2022 23:01:52 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id u2so843460ljl.3 for ; Wed, 26 Oct 2022 23:01: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=8Mcq4XElldK8n+d5RjVbZo8PZpT7nLSBwi7AAq7x+9Q=; b=ZjHoPw+if37X9gDnaT+FhKICLRbsHByghkoJqnE2lPRJniVdoE25wHTHnyx02snUJZ nVyARZD7c7lxwF5QOi2/Q8L2CGL5imorD0borhbLmMhtikd6Cu02Os/Sz2d9Vlip88NE BwqOFxQXW/xEx1Dmcayu6qHYb/FlVMMs04IwR8p7o4+00S1sHmJYa01i/LE74/XYagRU gKD+lpTjRmeDqCqZTIlGPEMr/xPavfq/pOAiPbdbTPW2gHnAw2WrO0BwrHNX6WeM+yg+ NW+i4QCXSi4zju5k5ji99qOLJsaLL3Ge1Dcf+qcu22dp+E8s6hi/4pu3CCVLAMY1+Du5 d1qQ== 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=8Mcq4XElldK8n+d5RjVbZo8PZpT7nLSBwi7AAq7x+9Q=; b=tyh6oBl3e1SjN7SVmBidp/7nGtV6OFo+j3QP+DpScyQGrLahllQIoiKetKOCOiQf40 bVcWUdt2EXRDoncFpoGyxfJ0RoXEf6wJlnZbX6Qfzfik44V5/01oDOXd2HPJrbkw2h4M Qzf86I2Hmi7S55BfSCXJVVEeJVDpl+G+GTPb94nDOS0vVvb2y7c403qOkJv19F7lrA18 wFEPnxTu2Bpkj5BghkWjMfgboqNqcNnptY2UZVZYKTWBhj7aCocAYMOMFIxGBDKBcdre Prqhs/jbG/EWSWuGOnnrjJoZqzlCzVd4yXWu6dh5nCNSKBz23bO3b6JLN2AGDbOex+Ok hByA== X-Gm-Message-State: ACrzQf3WecVfvpjREd25q1l7J3v8BcVvl1DIuODO5hx4YSQ14d2M3/rE ZZFZQj+fGFVmvl00HZZO33cTn/6NdY8y/Q== X-Received: by 2002:a2e:9648:0:b0:277:ae8:7512 with SMTP id z8-20020a2e9648000000b002770ae87512mr7645747ljh.244.1666850510547; Wed, 26 Oct 2022 23:01:50 -0700 (PDT) Received: from elroy-temp-vm.gaiao0uenmiufjlowqgp5yxwdh.gvxx.internal.cloudapp.net ([20.240.130.248]) by smtp.googlemail.com with ESMTPSA id j3-20020a056512344300b0049fff3f645esm61537lfr.70.2022.10.26.23.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 23:01: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 v5 3/6] staging: vt6655: refactor code in s_uFillDataHead Date: Thu, 27 Oct 2022 06:01:27 +0000 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747819540136512340?= X-GMAIL-MSGID: =?utf-8?q?1747819540136512340?= fix checkpatch errors by refactoring long lines of code in the function: s_uFillDataHead Signed-off-by: Tanjuate Brunostar --- drivers/staging/vt6655/rxtx.c | 97 ++++++++++++++++++++++++----------- 1 file changed, 67 insertions(+), 30 deletions(-) diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c index 8e56a7ee8035..7b6571ba7c36 100644 --- a/drivers/staging/vt6655/rxtx.c +++ b/drivers/staging/vt6655/rxtx.c @@ -481,19 +481,28 @@ static __le16 s_uFillDataHead(struct vnt_private *pDevice, } else { /* Get Duration and TimeStamp */ buf->duration_a = - cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, - byPktType, wCurrentRate, bNeedAck, uFragIdx, - cbLastFragmentSize, uMACfragNum, + cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, + cbFrameLength, + byPktType, + wCurrentRate, bNeedAck, + uFragIdx, + cbLastFragmentSize, + uMACfragNum, byFBOption)); buf->duration_b = - cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength, - PK_TYPE_11B, pDevice->byTopCCKBasicRate, - bNeedAck, uFragIdx, cbLastFragmentSize, - uMACfragNum, byFBOption)); + cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_B, + cbFrameLength, + PK_TYPE_11B, + pDevice->byTopCCKBasicRate, + bNeedAck, uFragIdx, + cbLastFragmentSize, + uMACfragNum, + byFBOption)); } buf->time_stamp_off_a = vnt_time_stamp_off(pDevice, wCurrentRate); - buf->time_stamp_off_b = vnt_time_stamp_off(pDevice, pDevice->byTopCCKBasicRate); + buf->time_stamp_off_b = vnt_time_stamp_off(pDevice, + pDevice->byTopCCKBasicRate); return buf->duration_a; } @@ -506,14 +515,29 @@ static __le16 s_uFillDataHead(struct vnt_private *pDevice, pDevice->byTopCCKBasicRate, PK_TYPE_11B, &buf->b); /* Get Duration and TimeStamp */ - buf->duration_a = cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, byPktType, - wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); - buf->duration_b = cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength, PK_TYPE_11B, - pDevice->byTopCCKBasicRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); - buf->duration_a_f0 = cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A_F0, cbFrameLength, byPktType, - wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); - buf->duration_a_f1 = cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A_F1, cbFrameLength, byPktType, - wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); + buf->duration_a = cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, + cbFrameLength, byPktType, + wCurrentRate, bNeedAck, + uFragIdx, cbLastFragmentSize, + uMACfragNum, byFBOption)); + buf->duration_b = cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_B, + cbFrameLength, PK_TYPE_11B, + pDevice->byTopCCKBasicRate, + bNeedAck, uFragIdx, + cbLastFragmentSize, + uMACfragNum, byFBOption)); + buf->duration_a_f0 = cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A_F0, + cbFrameLength, byPktType, + wCurrentRate, bNeedAck, + uFragIdx, + cbLastFragmentSize, + uMACfragNum, byFBOption)); + buf->duration_a_f1 = cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A_F1, + cbFrameLength, byPktType, + wCurrentRate, bNeedAck, + uFragIdx, + cbLastFragmentSize, + uMACfragNum, byFBOption)); buf->time_stamp_off_a = vnt_time_stamp_off(pDevice, wCurrentRate); buf->time_stamp_off_b = vnt_time_stamp_off(pDevice, pDevice->byTopCCKBasicRate); @@ -531,12 +555,24 @@ static __le16 s_uFillDataHead(struct vnt_private *pDevice, byPktType, &buf->a); /* Get Duration and TimeStampOff */ - buf->duration = cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, byPktType, - wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); - buf->duration_f0 = cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A_F0, cbFrameLength, byPktType, - wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); - buf->duration_f1 = cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A_F1, cbFrameLength, byPktType, - wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption)); + buf->duration = + cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, + cbFrameLength, byPktType, + wCurrentRate, bNeedAck, + uFragIdx, cbLastFragmentSize, + uMACfragNum, byFBOption)); + buf->duration_f0 = + cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A_F0, + cbFrameLength, byPktType, + wCurrentRate, bNeedAck, + uFragIdx, cbLastFragmentSize, + uMACfragNum, byFBOption)); + buf->duration_f1 = + cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A_F1, + cbFrameLength, byPktType, + wCurrentRate, bNeedAck, + uFragIdx, cbLastFragmentSize, + uMACfragNum, byFBOption)); buf->time_stamp_off = vnt_time_stamp_off(pDevice, wCurrentRate); return buf->duration; } @@ -552,10 +588,11 @@ static __le16 s_uFillDataHead(struct vnt_private *pDevice, } else { /* Get Duration and TimeStampOff */ buf->duration = - cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, byPktType, - wCurrentRate, bNeedAck, uFragIdx, - cbLastFragmentSize, uMACfragNum, - byFBOption)); + cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, + cbFrameLength, byPktType, + wCurrentRate, bNeedAck, + uFragIdx, cbLastFragmentSize, + uMACfragNum, byFBOption)); } buf->time_stamp_off = vnt_time_stamp_off(pDevice, wCurrentRate); @@ -573,10 +610,10 @@ static __le16 s_uFillDataHead(struct vnt_private *pDevice, } else { /* Get Duration and TimeStampOff */ buf->duration = - cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength, byPktType, - wCurrentRate, bNeedAck, uFragIdx, - cbLastFragmentSize, uMACfragNum, - byFBOption)); + cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength, + byPktType, wCurrentRate, bNeedAck, + uFragIdx, cbLastFragmentSize, + uMACfragNum, byFBOption)); } buf->time_stamp_off = vnt_time_stamp_off(pDevice, wCurrentRate);