From: Stefano Brivio <sbrivio@redhat.com>
To: Briana Oursler <briana.oursler@gmail.com>
Cc: gregkh@linuxfoundation.org, forest@alittletooquiet.net,
julia.lawall@inria.fr, outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH 2/4] Staging: vt6655: Raise rate determination logic.
Date: Mon, 30 Mar 2020 20:02:19 +0200 [thread overview]
Message-ID: <20200330200219.671c57fc@elisabeth> (raw)
In-Reply-To: <ef75d57ce674d38a998c5d806dd33176f6db8087.1585542564.git.briana.oursler@gmail.com>
On Sun, 29 Mar 2020 21:48:00 -0700
Briana Oursler <briana.oursler@gmail.com> wrote:
> Raise rate setting logic out of nested if-else statement to prevent code
Again, not a native English speaker, but it's the first time I meet
this usage of "to raise". I would have rather said "move", or "factor
out".
> duplication.
>
> Signed-off-by: Briana Oursler <briana.oursler@gmail.com>
> ---
> drivers/staging/vt6655/rxtx.c | 26 ++++++--------------------
> 1 file changed, 6 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
> index f9e2087d2242..4be867b95d9d 100644
> --- a/drivers/staging/vt6655/rxtx.c
> +++ b/drivers/staging/vt6655/rxtx.c
> @@ -302,23 +302,18 @@ s_uGetDataDuration(
> return 0;
> }
> } else { /* First Frag or Mid Frag */
> - if (byFBOption == AUTO_FB_0) {
> - if (wRate < RATE_18M)
> - wRate = RATE_18M;
> - else if (wRate > RATE_54M)
> - wRate = RATE_54M;
> + if (wRate < RATE_18M)
> + wRate = RATE_18M;
> + else if (wRate > RATE_54M)
> + wRate = RATE_54M;
>
> + if (byFBOption == AUTO_FB_0) {
> if (uFragIdx == (uMACfragNum - 2))
> uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wFB_Opt0[FB_RATE0][wRate-RATE_18M], bNeedAck);
> else
> uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate-RATE_18M], bNeedAck);
>
> } else { /* (byFBOption == AUTO_FB_1) */
> - if (wRate < RATE_18M)
> - wRate = RATE_18M;
> - else if (wRate > RATE_54M)
> - wRate = RATE_54M;
> -
> if (uFragIdx == (uMACfragNum - 2))
> uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wFB_Opt1[FB_RATE0][wRate-RATE_18M], bNeedAck);
> else
> @@ -344,27 +339,18 @@ s_uGetDataDuration(
> }
> } else { /* First Frag or Mid Frag */
> if (byFBOption == AUTO_FB_0) {
> - if (wRate < RATE_18M)
> - wRate = RATE_18M;
> - else if (wRate > RATE_54M)
> - wRate = RATE_54M;
> -
> if (uFragIdx == (uMACfragNum - 2))
> uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wFB_Opt0[FB_RATE1][wRate-RATE_18M], bNeedAck);
> else
> uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate-RATE_18M], bNeedAck);
>
> } else { /* (byFBOption == AUTO_FB_1) */
> - if (wRate < RATE_18M)
> - wRate = RATE_18M;
> - else if (wRate > RATE_54M)
> - wRate = RATE_54M;
> -
> if (uFragIdx == (uMACfragNum - 2))
> uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wFB_Opt1[FB_RATE1][wRate-RATE_18M], bNeedAck);
> else
> uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate-RATE_18M], bNeedAck);
> }
> +
This newline is unrelated.
> if (bNeedAck) {
> uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
> } else {
--
Stefano
next prev parent reply other threads:[~2020-03-30 18:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-30 4:47 [PATCH 0/4] staging: vt6655: Simplify statement logic Briana Oursler
2020-03-30 4:47 ` [PATCH 1/4] Staging: vt6655: Limit return statements Briana Oursler
2020-03-30 18:01 ` [Outreachy kernel] " Stefano Brivio
2020-03-30 4:48 ` [PATCH 2/4] Staging: vt6655: Raise rate determination logic Briana Oursler
2020-03-30 18:02 ` Stefano Brivio [this message]
2020-03-30 4:48 ` [PATCH 3/4] Staging: vt6655: Create new variable len Briana Oursler
2020-03-30 18:03 ` [Outreachy kernel] " Stefano Brivio
2020-03-30 4:48 ` [PATCH 4/4] Staging: vt6655: Format spaces Briana Oursler
2020-03-30 18:02 ` [Outreachy kernel] " Stefano Brivio
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=20200330200219.671c57fc@elisabeth \
--to=sbrivio@redhat.com \
--cc=briana.oursler@gmail.com \
--cc=forest@alittletooquiet.net \
--cc=gregkh@linuxfoundation.org \
--cc=julia.lawall@inria.fr \
--cc=outreachy-kernel@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.