lkml.org 
[lkml]   [2018]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] usb: Replace empty define with do while
Date
It's dangerous to use empty code define.
Furthermore it lead to the following warning:
"suggest braces around empty body in an « else » statement"

So let's replace emptyness by "do {} while(0)"

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
---
drivers/usb/host/ehci.h | 2 +-
drivers/usb/host/fotg210.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index c8e9a48e1d51..a60d91eac771 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -237,7 +237,7 @@ struct ehci_hcd { /* one per controller */
struct ehci_stats stats;
# define COUNT(x) ((x)++)
#else
-# define COUNT(x)
+# define COUNT(x) do {} while (0)
#endif

/* debug files */
diff --git a/drivers/usb/host/fotg210.h b/drivers/usb/host/fotg210.h
index 7fcd785c7bc8..dca46d04e288 100644
--- a/drivers/usb/host/fotg210.h
+++ b/drivers/usb/host/fotg210.h
@@ -179,7 +179,7 @@ struct fotg210_hcd { /* one per controller */
struct fotg210_stats stats;
# define COUNT(x) ((x)++)
#else
-# define COUNT(x)
+# define COUNT(x) do {} while (0)
#endif

/* debug files */
--
2.16.4
\
 
 \ /
  Last update: 2018-06-07 22:06    [W:0.064 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site