From: Malcolm Priestley <tvboxspy@gmail.com>
To: Derrick Greenspan <derrick.greenspan@knights.ucf.edu>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Forest Bond <forest@alittletooquiet.net>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCHv3] staging: vt6656: removed erroneous else statement
Date: Sat, 31 Jan 2015 22:31:59 +0000 [thread overview]
Message-ID: <54CD57DF.3020903@gmail.com> (raw)
In-Reply-To: <1422731121-5560-1-git-send-email-derrick.greenspan@knights.ucf.edu>
On 31/01/15 19:05, Derrick Greenspan wrote:
> This patch fixes the checkpatch.pl warning:
>
> WARNING: else is not generally useful after a break or return
> 559: FILE: drivers/staging/vt6656/rxtx.c:559:
Checkpatch does not check that the if and else has different function scope.
It isn't erroneous but now looks a little odd.
If it really bothers people split the function into two.
Malcolm
> return vnt_rxtx_datahead_g_fb(tx_context, &buf->data_head);
> } else {
>
> Signed-off-by: Derrick Greenspan <derrick.greenspan@knights.ucf.edu>
> ---
> Changes in v2:
> - Hopefully fixed whitespace!
> Changes in v3:
> - Fixed GCC compiler warning
> ---
> drivers/staging/vt6656/rxtx.c | 33 ++++++++++++++++-----------------
> 1 file changed, 16 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
> index b74f672..cb5d5ca 100644
> --- a/drivers/staging/vt6656/rxtx.c
> +++ b/drivers/staging/vt6656/rxtx.c
> @@ -556,25 +556,24 @@ static u16 vnt_fill_cts_head(struct vnt_usb_send_context *tx_context,
> ether_addr_copy(buf->data.ra, priv->current_net_addr);
>
> return vnt_rxtx_datahead_g_fb(tx_context, &buf->data_head);
> - } else {
> - struct vnt_cts *buf = &head->cts_g;
> - /* Get SignalField,ServiceField,Length */
> - vnt_get_phy_field(priv, cts_frame_len,
> - priv->top_cck_basic_rate, PK_TYPE_11B, &buf->b);
> - /* Get CTSDuration_ba */
> - buf->duration_ba =
> - vnt_get_rtscts_duration_le(tx_context, CTSDUR_BA,
> - tx_context->pkt_type,
> - current_rate);
> - /*Get CTS Frame body*/
> - buf->data.duration = buf->duration_ba;
> - buf->data.frame_control =
> - cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS);
> + }
> + struct vnt_cts *buf = &head->cts_g;
> + /* Get SignalField,ServiceField,Length */
> + vnt_get_phy_field(priv, cts_frame_len,
> + priv->top_cck_basic_rate, PK_TYPE_11B, &buf->b);
> + /* Get CTSDuration_ba */
> + buf->duration_ba =
> + vnt_get_rtscts_duration_le(tx_context, CTSDUR_BA,
> + tx_context->pkt_type,
> + current_rate);
> + /*Get CTS Frame body*/
> + buf->data.duration = buf->duration_ba;
> + buf->data.frame_control =
> + cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS);
>
> - ether_addr_copy(buf->data.ra, priv->current_net_addr);
> + ether_addr_copy(buf->data.ra, priv->current_net_addr);
>
> - return vnt_rxtx_datahead_g(tx_context, &buf->data_head);
> - }
> + return vnt_rxtx_datahead_g(tx_context, &buf->data_head);
> }
>
> static u16 vnt_rxtx_rts(struct vnt_usb_send_context *tx_context,
>
next prev parent reply other threads:[~2015-01-31 22:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-31 19:05 [PATCHv3] staging: vt6656: removed erroneous else statement Derrick Greenspan
2015-01-31 22:31 ` Malcolm Priestley [this message]
2015-02-01 1:09 ` Greg Kroah-Hartman
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=54CD57DF.3020903@gmail.com \
--to=tvboxspy@gmail.com \
--cc=derrick.greenspan@knights.ucf.edu \
--cc=devel@driverdev.osuosl.org \
--cc=forest@alittletooquiet.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/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.