From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S940146AbcKQLYb (ORCPT ); Thu, 17 Nov 2016 06:24:31 -0500 Received: from mga09.intel.com ([134.134.136.24]:54410 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752037AbcKQLYa (ORCPT ); Thu, 17 Nov 2016 06:24:30 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,653,1473145200"; d="asc'?scan'208";a="1069742681" From: Felipe Balbi To: Arnd Bergmann , Greg Kroah-Hartman Cc: Arnd Bergmann , John Youn , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: dwc3: avoid empty-body warning In-Reply-To: <20161116153742.3663212-1-arnd@arndb.de> References: <20161116153742.3663212-1-arnd@arndb.de> Date: Thu, 17 Nov 2016 13:23:43 +0200 Message-ID: <877f82tkn4.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Arnd Bergmann writes: > Building with W=3D1, 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=3Dempty-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 > --- > 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=3D1 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: 8<------------------------------------------------------------------------ From=20ea97b854e5c4437975c5d0e887488390410cfb30 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Wed, 16 Nov 2016 16:37:30 +0100 Subject: [PATCH] usb: dwc3: ep0: avoid empty-body warning Building with W=3D1, 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=3Dempty-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 Signed-off-by: Felipe Balbi =2D-- drivers/usb/dwc3/ep0.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 2b22ea7263d8..4c0664640862 100644 =2D-- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -486,12 +486,13 @@ static int dwc3_ep0_handle_intf(struct dwc3 *dwc, =20 switch (wValue) { case USB_INTRF_FUNC_SUSPEND: =2D if (wIndex & USB_INTRF_FUNC_SUSPEND_LP) =2D /* XXX enable Low power suspend */ =2D ; =2D if (wIndex & USB_INTRF_FUNC_SUSPEND_RW) =2D /* XXX enable remote wakeup */ =2D ; + /* + * REVISIT: Ideally we would enable some low power mode here, + * however it's unclear what we should be doing here. + * + * For now, we're not doing anything, just making sure we return + * 0 so USB Command Verifier tests pass without any errors. + */ break; default: ret =3D -EINVAL; =2D-=20 2.10.1 =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAlgtkz8ACgkQzL64meEa mQaK7xAAhEW755Di+PJa2+7+9y589VB8C69EwO+TOp4QalgGRRIhz8zYfxnuZqSv Ye6EiZgBoTz4XCRDlNxq4ixSbLE5lNSS2cD4h2TZWqLDcQm9WD7/T/SlFa8q5c/E px5NJDm8OFr1m5WgiIIWoDZovfqiJqoC2Vlqk12F7AMhdTf1LrgJWj3MW2u8wy0O zXwOsYHYnsec6teMXrg2hHKOJqD69bfwg365nyCliRM8k+yXNkZcdT2Ha0VYkdvE MyQ2tjqON8r6UX8ZotuVkICP6mv1kABC/07mdyZL03vU92eHFAN1XyS+Qf58XCkj 0WDUPUVCeI0o0Hx46MGAexPBaFZbHTJpHIngjrHZrzYTC3Tr3OiSv5gA/sjKsrzM lW6+SC5lBWZYAH1Nkyqhi9oJDOU7FJ8UD88crQZCnTAOrF+Q4bGrvLizparzs4Q8 ykykBd3GzOYt+Xuzp8arnt/BcY3BxxdH0HYMNBwWdXFvSSjmfu+wP5FvwHjJ1cb/ hU1bTbYoCiQ8WocZz1z5JNByc0wUXVMIURj/UTEMCJMb6HcrsO8EwV6NIt2CaZ79 CBdL3azRn6SGacEUYk8rDFzXp0C5oeyx3N9c0G4+YzfV7rcGfE52sUmbHtdVaJfm BjSVIDiK6dEpwsUMkPBltJ2SvgmZan+Nn5tSlKxklBcfsCWfans= =RNbg -----END PGP SIGNATURE----- --=-=-=--