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 1/4] Staging: vt6655: Limit return statements.
Date: Mon, 30 Mar 2020 20:01:00 +0200 [thread overview]
Message-ID: <20200330200100.76458994@elisabeth> (raw)
In-Reply-To: <d1cfc9acb3edd0b53516211d2c102d73cbee39e4.1585542564.git.briana.oursler@gmail.com>
On Sun, 29 Mar 2020 21:47:59 -0700
Briana Oursler <briana.oursler@gmail.com> wrote:
> Limit return statements within context of switch case to improve
> readability.
>
> Signed-off-by: Briana Oursler <briana.oursler@gmail.com>
> ---
> drivers/staging/vt6655/rxtx.c | 18 ++++++++++--------
> 1 file changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
> index 37fcc42ed000..f9e2087d2242 100644
> --- a/drivers/staging/vt6655/rxtx.c
> +++ b/drivers/staging/vt6655/rxtx.c
> @@ -261,10 +261,11 @@ s_uGetDataDuration(
>
> if (bNeedAck) {
> uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
> - return pDevice->uSIFS + uAckTime + uNextPktTime;
> } else {
> - return pDevice->uSIFS + uNextPktTime;
> + uAckTime = 0;
There's no need anymore to set this to zero (it's initialised already),
hence the else clauses can go away, and also the curly brackets. I
consider these as related changes, others might see it differently (but
I guess here it's a relatively safe assumption).
> }
> +
> + return pDevice->uSIFS + uAckTime + uNextPktTime;
> }
> break;
>
> @@ -284,10 +285,11 @@ s_uGetDataDuration(
>
> if (bNeedAck) {
> uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
> - return pDevice->uSIFS + uAckTime + uNextPktTime;
> } else {
> - return pDevice->uSIFS + uNextPktTime;
> + uAckTime = 0;
> }
> +
> + return pDevice->uSIFS + uAckTime + uNextPktTime;
> }
> break;
>
> @@ -325,10 +327,10 @@ s_uGetDataDuration(
>
> if (bNeedAck) {
> uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
> - return pDevice->uSIFS + uAckTime + uNextPktTime;
> } else {
> - return pDevice->uSIFS + uNextPktTime;
> + uAckTime = 0;
> }
> + return pDevice->uSIFS + uAckTime + uNextPktTime;
> }
> break;
>
> @@ -365,10 +367,10 @@ s_uGetDataDuration(
> }
> if (bNeedAck) {
> uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
> - return pDevice->uSIFS + uAckTime + uNextPktTime;
> } else {
> - return pDevice->uSIFS + uNextPktTime;
> + uAckTime = 0;
> }
> + return pDevice->uSIFS + uAckTime + uNextPktTime;
> }
> break;
>
next prev parent reply other threads:[~2020-03-30 18:01 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 ` Stefano Brivio [this message]
2020-03-30 4:48 ` [PATCH 2/4] Staging: vt6655: Raise rate determination logic Briana Oursler
2020-03-30 18:02 ` [Outreachy kernel] " Stefano Brivio
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=20200330200100.76458994@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.