mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Felipe Balbi <balbi@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	John Youn <johnyoun@synopsys.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: dwc3: avoid empty-body warning
Date: Thu, 17 Nov 2016 14:53:26 +0100	[thread overview]
Message-ID: <7107752.ZjMOJo9Nt7@wuerfel> (raw)
In-Reply-To: <877f82tkn4.fsf@linux.intel.com>

On Thursday, November 17, 2016 1:23:43 PM CET Felipe Balbi wrote:
> Arnd Bergmann <arnd@arndb.de> writes:
> > Building with W=1, we get a warning about harmless empty statements:
> >
> > drivers/usb/dwc3/ep0.c: In function 'dwc3_ep0_handle_intf':
> > drivers/usb/dwc3/ep0.c:491:4: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
> >
> > gcc does not warn about {} here, so maybe use that instead.
> > Alternatively, the code could be removed entirely as it does
> > nothing.
> >
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> > This has been present in the driver for a while, but the code
> > just moved around, so it showed up as a new warning for me.
> > I hope to eventually address all W=1 warnings as they tend to
> > find real bugs elsewhere and we may as well fix it now that the
> > code has changed.
> 
> Thank you, the only problem is that now checkpatch.pl warns. I'll just
> remove the code and turn it into a comment. Authorship kept, let me know
> if you're okay with me adding your S-o-b:

Ah, good point. The same problem exists in other places too,
I have to remember this when sending patches. Maybe I can
add something like

#define do_nothing() do {} while (0) 

> 8<------------------------------------------------------------------------
> 
> From ea97b854e5c4437975c5d0e887488390410cfb30 Mon Sep 17 00:00:00 2001
> From: Arnd Bergmann <arnd@arndb.de>
> Date: Wed, 16 Nov 2016 16:37:30 +0100
> Subject: [PATCH] usb: dwc3: ep0: avoid empty-body warning
> 
> Building with W=1, we get a warning about harmless empty statements:
> 
> drivers/usb/dwc3/ep0.c: In function 'dwc3_ep0_handle_intf':
> drivers/usb/dwc3/ep0.c:491:4: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
> 
> Instead of adding empty braces which would introduce checkpatch.pl
> warnings, we're just removing the code which doesn't do anything and
> making sure we return 0 so USBCV tool is happy.
> 
> NYET-Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

Looks good to me.

	Arnd

      reply	other threads:[~2016-11-17 18:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-16 15:37 Arnd Bergmann
2016-11-17 11:23 ` Felipe Balbi
2016-11-17 13:53   ` Arnd Bergmann [this message]

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=7107752.ZjMOJo9Nt7@wuerfel \
    --to=arnd@arndb.de \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=johnyoun@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@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 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®