From: Greg KH <gregkh@linuxfoundation.org>
To: Emrys Bayliss <emrys@paradise.net.nz>
Cc: forest@alittletooquiet.net, tvboxspy@gmail.com,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Staging: vt6656: Checkpatch fix: else after break or return
Date: Tue, 13 Jan 2015 09:14:29 -0800 [thread overview]
Message-ID: <20150113171429.GC12822@kroah.com> (raw)
In-Reply-To: <1421168604-29857-1-git-send-email-emrys@paradise.net.nz>
On Wed, Jan 14, 2015 at 04:03:24AM +1100, Emrys Bayliss wrote:
> This patch fixes the following checkpatch.pl error:
> rxtx.c:558: WARNING: else is not generally useful after a break or return
>
> Signed-off-by: Emrys Bayliss <emrys@paradise.net.nz>
> ---
> The else statement was replaced with a block to avoid the following
> compiler error:
> "warning: ISO C90 forbids mixed declarations and code"
> due to this declaration:
> struct vnt_cts *buf = &head->cts_g; (line 559)
>
> Is there a better way such as using head (a union) directly instead?
>
> The last patch I sent removed the return 0. Since this isn't related to
> the error in the title I left it for a separate patch.
>
> drivers/staging/vt6656/rxtx.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
> index ea5140a..831a051 100644
> --- a/drivers/staging/vt6656/rxtx.c
> +++ b/drivers/staging/vt6656/rxtx.c
> @@ -555,7 +555,9 @@ static u16 vnt_fill_cts_head(struct vnt_usb_send_context *tx_context,
> memcpy(buf->data.ra, priv->current_net_addr, ETH_ALEN);
>
> 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,
This doesn't look correct at all, please fix up properly.
greg k-h
next prev parent reply other threads:[~2015-01-13 17:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-13 17:03 [PATCH] Staging: vt6656: Checkpatch fix: else after break or return Emrys Bayliss
2015-01-13 17:12 ` Joe Perches
2015-01-13 17:14 ` Greg KH [this message]
2015-01-13 17:15 ` Emrys Bayliss
-- strict thread matches above, loose matches on Subject: below --
2015-01-11 16:19 Emrys Bayliss
2015-01-11 16:42 ` Joe Perches
2015-01-11 21:30 ` Malcolm Priestley
2015-01-11 23:38 ` Emrys Bayliss
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=20150113171429.GC12822@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=devel@driverdev.osuosl.org \
--cc=emrys@paradise.net.nz \
--cc=forest@alittletooquiet.net \
--cc=linux-kernel@vger.kernel.org \
--cc=tvboxspy@gmail.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.