[PATCH] USB: EHCI: make all debugging depend on CONFIG_DYNAMIC_DEBUG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The debugging facilities in ehci-dbg.c follow an uneven pattern.  Some
of them are protected by "#ifdef CONFIG_DYNAMIC_DEBUG" and some
aren't, presumably in the hope of having some of the debugging output
available in any configuration.

This leads to build problems when dynamic debugging isn't configured.
Rather than try to keep this complicated state of affairs, let's just
make everything dependent on CONFIG_DYNAMIC_DEBUG.

Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
Tested-by: Rafał Miłecki <zajec5@xxxxxxxxx>

---


[as1799]


 drivers/usb/host/ehci-dbg.c |   80 +++++++++++++++++++-------------------------
 drivers/usb/host/ehci.h     |    5 --
 2 files changed, 35 insertions(+), 50 deletions(-)

Index: usb-4.4/drivers/usb/host/ehci.h
===================================================================
--- usb-4.4.orig/drivers/usb/host/ehci.h
+++ usb-4.4/drivers/usb/host/ehci.h
@@ -869,11 +869,6 @@ static inline u32 hc32_to_cpup (const st
 #define ehci_warn(ehci, fmt, args...) \
 	dev_warn(ehci_to_hcd(ehci)->self.controller , fmt , ## args)
 
-
-#ifndef CONFIG_DYNAMIC_DEBUG
-#define STUB_DEBUG_FILES
-#endif
-
 /*-------------------------------------------------------------------------*/
 
 /* Declarations of things exported for use by ehci platform drivers */
Index: usb-4.4/drivers/usb/host/ehci-dbg.c
===================================================================
--- usb-4.4.orig/drivers/usb/host/ehci-dbg.c
+++ usb-4.4/drivers/usb/host/ehci-dbg.c
@@ -56,13 +56,6 @@ static void dbg_hcs_params (struct ehci_
 				label, buf);
 	}
 }
-#else
-
-static inline void dbg_hcs_params (struct ehci_hcd *ehci, char *label) {}
-
-#endif
-
-#ifdef CONFIG_DYNAMIC_DEBUG
 
 /* check the values in the HCCPARAMS register
  * (host controller _Capability_ parameters)
@@ -95,13 +88,6 @@ static void dbg_hcc_params (struct ehci_
 				" 32 periodic list" : "");
 	}
 }
-#else
-
-static inline void dbg_hcc_params (struct ehci_hcd *ehci, char *label) {}
-
-#endif
-
-#ifdef CONFIG_DYNAMIC_DEBUG
 
 static void __maybe_unused
 dbg_qtd (const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd)
@@ -280,29 +266,6 @@ dbg_port_buf (char *buf, unsigned len, c
 		(status & PORT_CONNECT) ? " CONNECT" : "");
 }
 
-#else
-static inline void __maybe_unused
-dbg_qh (char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
-{}
-
-static inline int __maybe_unused
-dbg_status_buf (char *buf, unsigned len, const char *label, u32 status)
-{ return 0; }
-
-static inline int __maybe_unused
-dbg_command_buf (char *buf, unsigned len, const char *label, u32 command)
-{ return 0; }
-
-static inline int __maybe_unused
-dbg_intr_buf (char *buf, unsigned len, const char *label, u32 enable)
-{ return 0; }
-
-static inline int __maybe_unused
-dbg_port_buf (char *buf, unsigned len, const char *label, int port, u32 status)
-{ return 0; }
-
-#endif	/* CONFIG_DYNAMIC_DEBUG */
-
 /* functions have the "wrong" filename when they're output... */
 #define dbg_status(ehci, label, status) { \
 	char _buf [80]; \
@@ -324,13 +287,6 @@ dbg_port_buf (char *buf, unsigned len, c
 
 /*-------------------------------------------------------------------------*/
 
-#ifdef STUB_DEBUG_FILES
-
-static inline void create_debug_files (struct ehci_hcd *bus) { }
-static inline void remove_debug_files (struct ehci_hcd *bus) { }
-
-#else
-
 /* troubleshooting help: expose state in debugfs */
 
 static int debug_async_open(struct inode *, struct file *);
@@ -1089,4 +1045,38 @@ static inline void remove_debug_files (s
 	debugfs_remove_recursive(ehci->debug_dir);
 }
 
-#endif /* STUB_DEBUG_FILES */
+#else /* CONFIG_DYNAMIC_DEBUG */
+
+static inline void dbg_hcs_params(struct ehci_hcd *ehci, char *label) { }
+static inline void dbg_hcc_params(struct ehci_hcd *ehci, char *label) { }
+
+static inline void __maybe_unused dbg_qh(const char *label,
+		struct ehci_hcd *ehci, struct ehci_qh *qh) { }
+
+static inline int __maybe_unused dbg_status_buf(const char *buf,
+		unsigned len, const char *label, u32 status)
+{ return 0; }
+
+static inline int __maybe_unused dbg_command_buf(const char *buf,
+		unsigned len, const char *label, u32 command)
+{ return 0; }
+
+static inline int __maybe_unused dbg_intr_buf(const char *buf,
+		unsigned len, const char *label, u32 enable)
+{ return 0; }
+
+static inline int __maybe_unused dbg_port_buf(char *buf,
+		unsigned len, const char *label, int port, u32 status)
+{ return 0; }
+
+static inline void dbg_status(struct ehci_hcd *ehci, const char *label,
+		u32 status) { }
+static inline void dbg_cmd(struct ehci_hcd *ehci, const char *label,
+		u32 command) { }
+static inline void dbg_port(struct ehci_hcd *ehci, const char *label,
+		int port, u32 status) { }
+
+static inline void create_debug_files(struct ehci_hcd *bus) { }
+static inline void remove_debug_files(struct ehci_hcd *bus) { }
+
+#endif /* CONFIG_DYNAMIC_DEBUG */

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux