mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 23:24:50 +00:00
usb: dwc3: don't compile dwc3_trace() unless CONFIG_FTRACE=y
We don't need dwc3_trace() unless we're building a kernel with CONFIG_FTRACE. This patch reduces dwc3.ko text size a bit while also removing overhead of dwc3_trace() calls. text data bss dec hex filename 50796 581 0 51377 c8b1 drivers/usb/dwc3/dwc3.o 43961 581 0 44542 adfe drivers/usb/dwc3/dwc3.o.patched Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
This commit is contained in:
parent
a97ea99460
commit
57b14da562
2 changed files with 11 additions and 1 deletions
|
@ -3,7 +3,11 @@ CFLAGS_trace.o := -I$(src)
|
||||||
|
|
||||||
obj-$(CONFIG_USB_DWC3) += dwc3.o
|
obj-$(CONFIG_USB_DWC3) += dwc3.o
|
||||||
|
|
||||||
dwc3-y := core.o debug.o trace.o
|
dwc3-y := core.o
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_FTRACE),)
|
||||||
|
dwc3-y += debug.o trace.o
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(filter y,$(CONFIG_USB_DWC3_HOST) $(CONFIG_USB_DWC3_DUAL_ROLE)),)
|
ifneq ($(filter y,$(CONFIG_USB_DWC3_HOST) $(CONFIG_USB_DWC3_DUAL_ROLE)),)
|
||||||
dwc3-y += host.o
|
dwc3-y += host.o
|
||||||
|
|
|
@ -344,7 +344,13 @@ static inline const char *dwc3_gadget_generic_cmd_status_string(int status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_FTRACE)
|
||||||
void dwc3_trace(void (*trace)(struct va_format *), const char *fmt, ...);
|
void dwc3_trace(void (*trace)(struct va_format *), const char *fmt, ...);
|
||||||
|
#else
|
||||||
|
static inline void dwc3_trace(void (*trace)(struct va_format *), const char *fmt, ...)
|
||||||
|
{ }
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
extern void dwc3_debugfs_init(struct dwc3 *);
|
extern void dwc3_debugfs_init(struct dwc3 *);
|
||||||
|
|
Loading…
Reference in a new issue