Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1417117

[PATCH v9 02/14] usb: otg-fsm: Prevent build warning "VDBG" redefined

From Roger Quadros <rogerq@ti.com>
Newsgroups linux.kernel
Subject [PATCH v9 02/14] usb: otg-fsm: Prevent build warning "VDBG" redefined
Date 2016-06-08 11:10 +0200
Message-ID <rHHES-6Fd-35@gated-at.bofh.it> (permalink)
References <rHHER-6Fd-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


If usb/otg-fsm.h and usb/composite.h are included together
then it results in the build warning [1].

Prevent that by defining VDBG locally.

Also get rid of MPC_LOC which doesn't seem to be used
by anyone.

[1] - warning fixed by this patch:

In file included from drivers/usb/dwc3/core.h:33,
   from drivers/usb/dwc3/ep0.c:33:
   include/linux/usb/otg-fsm.h:30:1: warning: "VDBG" redefined
   In file included from drivers/usb/dwc3/ep0.c:31:
   include/linux/usb/composite.h:615:1: warning: this is the location
   of the previous definition

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Peter Chen <peter.chen@nxp.com>
---
 drivers/usb/common/usb-otg-fsm.c |  7 +++++++
 drivers/usb/phy/phy-fsl-usb.c    |  7 +++++++
 include/linux/usb/otg-fsm.h      | 15 ---------------
 3 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb-otg-fsm.c
index 9059b7d..199dee0 100644
--- a/drivers/usb/common/usb-otg-fsm.c
+++ b/drivers/usb/common/usb-otg-fsm.c
@@ -30,6 +30,13 @@
 #include <linux/usb/otg.h>
 #include <linux/usb/otg-fsm.h>
 
+#ifdef VERBOSE
+#define VDBG(fmt, args...) pr_debug("[%s]  " fmt, \
+				 __func__, ## args)
+#else
+#define VDBG(stuff...)	do {} while (0)
+#endif
+
 /* Change USB protocol when there is a protocol change */
 static int otg_set_protocol(struct otg_fsm *fsm, int protocol)
 {
diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c
index 94eb292..a8784ec 100644
--- a/drivers/usb/phy/phy-fsl-usb.c
+++ b/drivers/usb/phy/phy-fsl-usb.c
@@ -44,6 +44,13 @@
 
 #include "phy-fsl-usb.h"
 
+#ifdef VERBOSE
+#define VDBG(fmt, args...) pr_debug("[%s]  " fmt, \
+				 __func__, ## args)
+#else
+#define VDBG(stuff...)	do {} while (0)
+#endif
+
 #define DRIVER_VERSION "Rev. 1.55"
 #define DRIVER_AUTHOR "Jerry Huang/Li Yang"
 #define DRIVER_DESC "Freescale USB OTG Transceiver Driver"
diff --git a/include/linux/usb/otg-fsm.h b/include/linux/usb/otg-fsm.h
index 7a03505..a0a8f87 100644
--- a/include/linux/usb/otg-fsm.h
+++ b/include/linux/usb/otg-fsm.h
@@ -21,21 +21,6 @@
 #include <linux/mutex.h>
 #include <linux/errno.h>
 
-#undef VERBOSE
-
-#ifdef VERBOSE
-#define VDBG(fmt, args...) pr_debug("[%s]  " fmt , \
-				 __func__, ## args)
-#else
-#define VDBG(stuff...)	do {} while (0)
-#endif
-
-#ifdef VERBOSE
-#define MPC_LOC printk("Current Location [%s]:[%d]\n", __FILE__, __LINE__)
-#else
-#define MPC_LOC do {} while (0)
-#endif
-
 #define PROTO_UNDEF	(0)
 #define PROTO_HOST	(1)
 #define PROTO_GADGET	(2)
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v9 00/14] USB OTG/dual-role framework Roger Quadros <rogerq@ti.com> - 2016-06-08 11:10 +0200
  [PATCH v9 10/14] usb: otg: add hcd companion support Roger Quadros <rogerq@ti.com> - 2016-06-08 11:10 +0200
  [PATCH v9 11/14] usb: otg: use dev_dbg() instead of VDBG() Roger Quadros <rogerq@ti.com> - 2016-06-08 11:10 +0200
    Re: [PATCH v9 11/14] usb: otg: use dev_dbg() instead of VDBG() Joe Perches <joe@perches.com> - 2016-06-08 17:20 +0200
      Re: [PATCH v9 11/14] usb: otg: use dev_dbg() instead of VDBG() Roger Quadros <rogerq@ti.com> - 2016-06-09 09:30 +0200
    [PATCH v10 11/14] usb: otg: use dev_dbg() instead of VDBG() Roger Quadros <rogerq@ti.com> - 2016-06-09 10:00 +0200
      Re: [PATCH v10 11/14] usb: otg: use dev_dbg() instead of VDBG() Joe Perches <joe@perches.com> - 2016-06-09 17:50 +0200
        Re: [PATCH v10 11/14] usb: otg: use dev_dbg() instead of VDBG() Roger Quadros <rogerq@ti.com> - 2016-06-10 09:10 +0200
  [PATCH v9 02/14] usb: otg-fsm: Prevent build warning "VDBG" redefined Roger Quadros <rogerq@ti.com> - 2016-06-08 11:10 +0200
  [PATCH v9 09/14] usb: of: add an API to get OTG device from USB controller node Roger Quadros <rogerq@ti.com> - 2016-06-08 11:10 +0200
  [PATCH v9 14/14] usb: host: xhci-plat: Add otg device to platform data Roger Quadros <rogerq@ti.com> - 2016-06-08 11:10 +0200
  [PATCH v9 08/14] usb: otg: add OTG/dual-role core Roger Quadros <rogerq@ti.com> - 2016-06-08 11:10 +0200
    Re: [PATCH v9 08/14] usb: otg: add OTG/dual-role core Peter Chen <hzpeterchen@gmail.com> - 2016-06-08 12:00 +0200
      Re: [PATCH v9 08/14] usb: otg: add OTG/dual-role core Roger Quadros <rogerq@ti.com> - 2016-06-08 12:20 +0200
        Re: [PATCH v9 08/14] usb: otg: add OTG/dual-role core Peter Chen <hzpeterchen@gmail.com> - 2016-06-08 14:50 +0200
          Re: [PATCH v9 08/14] usb: otg: add OTG/dual-role core Roger Quadros <rogerq@ti.com> - 2016-06-09 09:30 +0200
    [PATCH v10 08/14] usb: otg: add OTG/dual-role core Roger Quadros <rogerq@ti.com> - 2016-06-09 10:00 +0200
      Re: [PATCH v10 08/14] usb: otg: add OTG/dual-role core Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-06-09 14:40 +0200
        Re: [PATCH v10 08/14] usb: otg: add OTG/dual-role core Roger Quadros <rogerq@ti.com> - 2016-06-10 09:10 +0200
        Re: [PATCH v10 08/14] usb: otg: add OTG/dual-role core Roger Quadros <rogerq@ti.com> - 2016-06-10 12:20 +0200
          Re: [PATCH v10 08/14] usb: otg: add OTG/dual-role core Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-06-10 12:50 +0200
            Re: [PATCH v10 08/14] usb: otg: add OTG/dual-role core Roger Quadros <rogerq@ti.com> - 2016-06-10 13:00 +0200
              Re: [PATCH v10 08/14] usb: otg: add OTG/dual-role core Felipe Balbi <balbi@kernel.org> - 2016-06-10 13:10 +0200
  [PATCH v9 13/14] usb: gadget: udc: adapt to OTG core Roger Quadros <rogerq@ti.com> - 2016-06-08 11:10 +0200
    RE: [PATCH v9 13/14] usb: gadget: udc: adapt to OTG core Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> - 2016-06-09 12:50 +0200
      Re: [PATCH v9 13/14] usb: gadget: udc: adapt to OTG core Roger Quadros <rogerq@ti.com> - 2016-06-10 09:10 +0200
  [PATCH v9 07/14] usb: otg: get rid of CONFIG_USB_OTG_FSM in favour of CONFIG_USB_OTG Roger Quadros <rogerq@ti.com> - 2016-06-08 11:20 +0200
  [PATCH v9 01/14] usb: hcd: Initialize hcd->flags to 0 Roger Quadros <rogerq@ti.com> - 2016-06-08 11:20 +0200
  [PATCH v9 05/14] usb: otg-fsm: move host controller operations into usb_otg->hcd_ops Roger Quadros <rogerq@ti.com> - 2016-06-08 11:20 +0200
  [PATCH v9 06/14] usb: gadget.h: Add OTG to gadget interface Roger Quadros <rogerq@ti.com> - 2016-06-08 11:20 +0200
  Re: [PATCH v9 00/14] USB OTG/dual-role framework Peter Chen <hzpeterchen@gmail.com> - 2016-06-09 07:30 +0200
    Re: [PATCH v9 00/14] USB OTG/dual-role framework Roger Quadros <rogerq@ti.com> - 2016-06-09 09:40 +0200
      RE: [PATCH v9 00/14] USB OTG/dual-role framework Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> - 2016-06-09 12:20 +0200

csiph-web