From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965044AbcKQSGL (ORCPT ); Thu, 17 Nov 2016 13:06:11 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:54932 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941170AbcKQSGJ (ORCPT ); Thu, 17 Nov 2016 13:06:09 -0500 From: Arnd Bergmann To: Felipe Balbi Cc: Greg Kroah-Hartman , John Youn , 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 Message-ID: <7107752.ZjMOJo9Nt7@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <877f82tkn4.fsf@linux.intel.com> References: <20161116153742.3663212-1-arnd@arndb.de> <877f82tkn4.fsf@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:H6Bzxv0cqKq9qNK5Nh9VfFrK4hWwuzT7DEbCJdGUpJL9/Jz06zt 0Zy6sog//Q2Hc4+DuR75K2zAnuAPpPk0xgVYnj+Hk/IG+hUQ3kCLXvdWpGq4mLNTmO1QOwd eNjbwAgqReHsjNuFRZfrqGKlOX1GzxSmjfQ1vjoANDSSIFzSab21i94A0SWNqTQxtZ79XSB 0IufjD4jI24GvXnB+DgyA== X-UI-Out-Filterresults: notjunk:1;V01:K0:DnOW+kUstT4=:pMUk5pdSZHDxaJBFYWVHdE MJ2I+lvTDPlgQsZCWEtNCxuPTc+qnRFWk8Huufqr4M2nsexas10MiSaXTgWK+qtg6JN1V8+a4 mtxpt8jJXfLiar9E5YJSe8fM8T0QO06TSL5MHpTQk2ZAvXkuVqPntisCuFs/JgmC2YjBf+ETa BUN/ioR6BJYRvVleeWQSB51Hq9/KUxcSp+Ed/mrd/uxgrZBuiXpKoji1zrg55Sr2zMPJ8slc3 AUW7w1Mx1wfnJdpIJzlqhbaLWFM88p9Eq39UZFprsegyW4Vcw4CS9mixNWs4b4qjFBqfveBE7 5Trf5HlOmJMcifKeQDtHhvNt61W31ygqIRs9s9qHHdJr0d5QtY/vg0SY1YYHtwgSWYLyHNtt7 mOD3MBHVcXa/Gh6u3D8w1GAeXrCmaUAqaYOjQGkTyyRMZbmu93mT0mxEzMnLpYxeeVD7k8PP7 tyQvLYY4l6Qrv5xdReJwNUc+CMEPdjhD0C6SEfDF5dQ+lIogfCXTApwZj1hzxn5xJDrcc0Dzt xJreWhqMI7uyMF8omRJxxmQUPbh7oxoooDqiXb7A1St/6fowQ63eiydir7fYkk6mydjiqbw9v Inma5NdftdhBJNulQDcu44PSpumL1K8v5+df9Xa3W8PmlpamLNQ0Fg9ROxzc2dmYbWjChrYMT NMklzHGindWryMtSj4g/ANGcjcPtSa6dEFiOlv0WWibPaiG4lKjogiHbcN0KZ1+QzwN7APMa+ Y6Cz+KkrZuOFXd6E Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, November 17, 2016 1:23:43 PM CET Felipe Balbi wrote: > Arnd Bergmann 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 > > --- > > 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 > 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 > Signed-off-by: Felipe Balbi Looks good to me. Arnd