From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E0A2C28CBC for ; Sun, 3 May 2020 09:15:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B74FB2075B for ; Sun, 3 May 2020 09:15:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kocurkovo.cz header.i=@kocurkovo.cz header.b="rSr4Yf2m" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727924AbgECJPQ (ORCPT ); Sun, 3 May 2020 05:15:16 -0400 Received: from mail.kocurkovo.cz ([185.8.236.170]:58858 "EHLO mail.kocurkovo.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726445AbgECJPQ (ORCPT ); Sun, 3 May 2020 05:15:16 -0400 Received: by mail.kocurkovo.cz (Postfix, from userid 1000) id 34D1518CB; Sun, 3 May 2020 11:15:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.kocurkovo.cz 34D1518CB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kocurkovo.cz; s=mail; t=1588497313; bh=yfcoX/+hpJsCO5PGGQP4+W0+BM8RubmIhakYFRtOT9w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rSr4Yf2mT8SIa81KMwMR4sbV4w9ZAZZna6/qoJXBdc/YITI40wMN0f96Vl1ONQCwK L00kbcSzRZLfEiVL1lr+fGFX8aBGSu8CZkh91mBv9xfUTdm1YQYxqN8X5uAQL1TCDY kJW+RIK5UJtJpZUTFtYju+nCA+WJjVd/iNFZuBRU= Date: Sun, 3 May 2020 11:15:13 +0200 From: Matej Dujava To: Joe Perches Cc: Forest Bond , Greg Kroah-Hartman , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Stefano Brivio , Briana Oursler , "Frank A. Cancio Bello" Subject: Re: [PATCH 2/2] staging: vt6655: fix LONG_LINE warning Message-ID: <20200503091513.GA8308@new.kocurkovo.cz> Mail-Followup-To: Joe Perches , Forest Bond , Greg Kroah-Hartman , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Stefano Brivio , Briana Oursler , "Frank A. Cancio Bello" References: <1588457794-31438-1-git-send-email-mdujava@kocurkovo.cz> <1588457794-31438-2-git-send-email-mdujava@kocurkovo.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 02, 2020 at 10:11:43PM -0700, Joe Perches wrote: >On Sun, 2020-05-03 at 00:16 +0200, Matej Dujava wrote: >> This patch will fix LONG_LINE error from checkpatch, by createing temporary >> variable so call to the function is not in if/else block. >[] >> diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c >[] Sorry, am I missing something here? >> @@ -164,16 +164,24 @@ s_uGetTxRsvTime( >> ) >> { >> unsigned int uDataTime, uAckTime; >> + unsigned short basic_rate; >> >> uDataTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, cbFrameLength, wRate); >> >> if (!bNeedAck) >> return uDataTime; >> >> - if (byPktType == PK_TYPE_11B) /* llb,CCK mode */ >> - uAckTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 14, (unsigned short)pDevice->byTopCCKBasicRate); >> - else /* 11g 2.4G OFDM mode & 11a 5G OFDM mode */ >> - uAckTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 14, (unsigned short)pDevice->byTopOFDMBasicRate); >> + /* >> + * CCK mode - 11b >> + * OFDM mode - 11g 2.4G & 11a 5G >> + */ >> + if (byPktType == PK_TYPE_11B) >> + basic_rate = (unsigned short)pDevice->byTopCCKBasicRate; >> + else >> + basic_rate = (unsigned short)pDevice->byTopOFDMBasicRate; >> + >> + uAckTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 14, >> + basic_rate); >> >> return uDataTime + pDevice->uSIFS + uAckTime; >> } > >perhaps simpler using a ?: > > uAckTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 14, > byPktType == PK_TYPE_11B > ? pDevice->byTopCCKBasicRate > : pDevice->byTopOFDMBasicRate); > >the casts aren't necessary either as both by... fields are u8 Thank you, will resend my patch. > > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA6FDC28CBC for ; Sun, 3 May 2020 09:15:23 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5F2132075B for ; Sun, 3 May 2020 09:15:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kocurkovo.cz header.i=@kocurkovo.cz header.b="rSr4Yf2m" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F2132075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kocurkovo.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 38B3C886A4; Sun, 3 May 2020 09:15:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SXsPpfuQ09MH; Sun, 3 May 2020 09:15:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id C862A88195; Sun, 3 May 2020 09:15:21 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id BECFE1BF5A5 for ; Sun, 3 May 2020 09:15:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id BB1E988195 for ; Sun, 3 May 2020 09:15:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4deOnBWOoxfQ for ; Sun, 3 May 2020 09:15:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.kocurkovo.cz (mail.kocurkovo.cz [185.8.236.170]) by whitealder.osuosl.org (Postfix) with ESMTPS id 33BE58816C for ; Sun, 3 May 2020 09:15:19 +0000 (UTC) Received: by mail.kocurkovo.cz (Postfix, from userid 1000) id 34D1518CB; Sun, 3 May 2020 11:15:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.kocurkovo.cz 34D1518CB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kocurkovo.cz; s=mail; t=1588497313; bh=yfcoX/+hpJsCO5PGGQP4+W0+BM8RubmIhakYFRtOT9w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rSr4Yf2mT8SIa81KMwMR4sbV4w9ZAZZna6/qoJXBdc/YITI40wMN0f96Vl1ONQCwK L00kbcSzRZLfEiVL1lr+fGFX8aBGSu8CZkh91mBv9xfUTdm1YQYxqN8X5uAQL1TCDY kJW+RIK5UJtJpZUTFtYju+nCA+WJjVd/iNFZuBRU= Date: Sun, 3 May 2020 11:15:13 +0200 From: Matej Dujava To: Joe Perches Subject: Re: [PATCH 2/2] staging: vt6655: fix LONG_LINE warning Message-ID: <20200503091513.GA8308@new.kocurkovo.cz> Mail-Followup-To: Joe Perches , Forest Bond , Greg Kroah-Hartman , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Stefano Brivio , Briana Oursler , "Frank A. Cancio Bello" References: <1588457794-31438-1-git-send-email-mdujava@kocurkovo.cz> <1588457794-31438-2-git-send-email-mdujava@kocurkovo.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Stefano Brivio , Forest Bond , "Frank A. Cancio Bello" , Briana Oursler Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" On Sat, May 02, 2020 at 10:11:43PM -0700, Joe Perches wrote: >On Sun, 2020-05-03 at 00:16 +0200, Matej Dujava wrote: >> This patch will fix LONG_LINE error from checkpatch, by createing temporary >> variable so call to the function is not in if/else block. >[] >> diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c >[] Sorry, am I missing something here? >> @@ -164,16 +164,24 @@ s_uGetTxRsvTime( >> ) >> { >> unsigned int uDataTime, uAckTime; >> + unsigned short basic_rate; >> >> uDataTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, cbFrameLength, wRate); >> >> if (!bNeedAck) >> return uDataTime; >> >> - if (byPktType == PK_TYPE_11B) /* llb,CCK mode */ >> - uAckTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 14, (unsigned short)pDevice->byTopCCKBasicRate); >> - else /* 11g 2.4G OFDM mode & 11a 5G OFDM mode */ >> - uAckTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 14, (unsigned short)pDevice->byTopOFDMBasicRate); >> + /* >> + * CCK mode - 11b >> + * OFDM mode - 11g 2.4G & 11a 5G >> + */ >> + if (byPktType == PK_TYPE_11B) >> + basic_rate = (unsigned short)pDevice->byTopCCKBasicRate; >> + else >> + basic_rate = (unsigned short)pDevice->byTopOFDMBasicRate; >> + >> + uAckTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 14, >> + basic_rate); >> >> return uDataTime + pDevice->uSIFS + uAckTime; >> } > >perhaps simpler using a ?: > > uAckTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 14, > byPktType == PK_TYPE_11B > ? pDevice->byTopCCKBasicRate > : pDevice->byTopOFDMBasicRate); > >the casts aren't necessary either as both by... fields are u8 Thank you, will resend my patch. > > _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel