Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: EHCI: make all debugging depend on CONFIG_DYNAMIC_DEBUG

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@rowland.harvard.edu>
Tested-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Alan Stern and committed by
Greg Kroah-Hartman
128f8b3d 442ee366

+34 -52
+34 -52
drivers/usb/host/ehci-dbg.c
··· 52 52 ehci_dbg(ehci, "%s portroute %s\n", label, buf); 53 53 } 54 54 } 55 - #else 56 - 57 - static inline void dbg_hcs_params(struct ehci_hcd *ehci, char *label) {} 58 - 59 - #endif 60 - 61 - #ifdef CONFIG_DYNAMIC_DEBUG 62 55 63 56 /* 64 57 * check the values in the HCCPARAMS register ··· 85 92 " 32 periodic list" : ""); 86 93 } 87 94 } 88 - #else 89 - 90 - static inline void dbg_hcc_params(struct ehci_hcd *ehci, char *label) {} 91 - 92 - #endif 93 - 94 - #ifdef CONFIG_DYNAMIC_DEBUG 95 95 96 96 static void __maybe_unused 97 97 dbg_qtd(const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd) ··· 267 281 (status & PORT_CONNECT) ? " CONNECT" : ""); 268 282 } 269 283 270 - #else 271 - static inline void __maybe_unused 272 - dbg_qh(char *label, struct ehci_hcd *ehci, struct ehci_qh *qh) 273 - {} 274 - 275 - static inline int __maybe_unused 276 - dbg_status_buf(char *buf, unsigned len, const char *label, u32 status) 277 - { 278 - return 0; 279 - } 280 - 281 - static inline int __maybe_unused 282 - dbg_command_buf(char *buf, unsigned len, const char *label, u32 command) 283 - { 284 - return 0; 285 - } 286 - 287 - static inline int __maybe_unused 288 - dbg_intr_buf(char *buf, unsigned len, const char *label, u32 enable) 289 - { 290 - return 0; 291 - } 292 - 293 - static inline int __maybe_unused 294 - dbg_port_buf(char *buf, unsigned len, const char *label, int port, u32 status) 295 - { 296 - return 0; 297 - } 298 - 299 - #endif /* CONFIG_DYNAMIC_DEBUG */ 300 - 301 284 static inline void 302 285 dbg_status(struct ehci_hcd *ehci, const char *label, u32 status) 303 286 { ··· 295 340 } 296 341 297 342 /*-------------------------------------------------------------------------*/ 298 - 299 - #ifndef CONFIG_DYNAMIC_DEBUG 300 - 301 - static inline void create_debug_files(struct ehci_hcd *bus) { } 302 - static inline void remove_debug_files(struct ehci_hcd *bus) { } 303 - 304 - #else 305 343 306 344 /* troubleshooting help: expose state in debugfs */ 307 345 ··· 1067 1119 { 1068 1120 debugfs_remove_recursive(ehci->debug_dir); 1069 1121 } 1122 + 1123 + #else /* CONFIG_DYNAMIC_DEBUG */ 1124 + 1125 + static inline void dbg_hcs_params(struct ehci_hcd *ehci, char *label) { } 1126 + static inline void dbg_hcc_params(struct ehci_hcd *ehci, char *label) { } 1127 + 1128 + static inline void __maybe_unused dbg_qh(const char *label, 1129 + struct ehci_hcd *ehci, struct ehci_qh *qh) { } 1130 + 1131 + static inline int __maybe_unused dbg_status_buf(const char *buf, 1132 + unsigned int len, const char *label, u32 status) 1133 + { return 0; } 1134 + 1135 + static inline int __maybe_unused dbg_command_buf(const char *buf, 1136 + unsigned int len, const char *label, u32 command) 1137 + { return 0; } 1138 + 1139 + static inline int __maybe_unused dbg_intr_buf(const char *buf, 1140 + unsigned int len, const char *label, u32 enable) 1141 + { return 0; } 1142 + 1143 + static inline int __maybe_unused dbg_port_buf(char *buf, 1144 + unsigned int len, const char *label, int port, u32 status) 1145 + { return 0; } 1146 + 1147 + static inline void dbg_status(struct ehci_hcd *ehci, const char *label, 1148 + u32 status) { } 1149 + static inline void dbg_cmd(struct ehci_hcd *ehci, const char *label, 1150 + u32 command) { } 1151 + static inline void dbg_port(struct ehci_hcd *ehci, const char *label, 1152 + int port, u32 status) { } 1153 + 1154 + static inline void create_debug_files(struct ehci_hcd *bus) { } 1155 + static inline void remove_debug_files(struct ehci_hcd *bus) { } 1070 1156 1071 1157 #endif /* CONFIG_DYNAMIC_DEBUG */