lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 17 Nov 2016 14:53:26 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Felipe Balbi <balbi@...nel.org>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        John Youn <johnyoun@...opsys.com>, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: dwc3: avoid empty-body warning

On Thursday, November 17, 2016 1:23:43 PM CET Felipe Balbi wrote:
> Arnd Bergmann <arnd@...db.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@...db.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@...db.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@...db.de>
> Signed-off-by: Felipe Balbi <felipe.balbi@...ux.intel.com>

Looks good to me.

	Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ