mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Matej Dujava <mdujava@kocurkovo.cz>,
	Forest Bond <forest@alittletooquiet.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Cc: Stefano Brivio <sbrivio@redhat.com>,
	Briana Oursler <briana.oursler@gmail.com>,
	"Frank A. Cancio Bello" <frank@generalsoftwareinc.com>
Subject: Re: [PATCH 2/2] staging: vt6655: fix LONG_LINE warning
Date: Sat, 02 May 2020 22:11:43 -0700	[thread overview]
Message-ID: <e5166009d549f42b75e8d764bc9078538ce0ce4a.camel@perches.com> (raw)
In-Reply-To: <1588457794-31438-2-git-send-email-mdujava@kocurkovo.cz>

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
[]
> @@ -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



  reply	other threads:[~2020-05-03  5:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-02 22:16 [PATCH 1/2] staging: vt6655: return early if not bNeedAck Matej Dujava
2020-05-02 22:16 ` [PATCH 2/2] staging: vt6655: fix LONG_LINE warning Matej Dujava
2020-05-03  5:11   ` Joe Perches [this message]
2020-05-03  9:15     ` Matej Dujava

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e5166009d549f42b75e8d764bc9078538ce0ce4a.camel@perches.com \
    --to=joe@perches.com \
    --cc=briana.oursler@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=forest@alittletooquiet.net \
    --cc=frank@generalsoftwareinc.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mdujava@kocurkovo.cz \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®