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

headers/deps: USB: Optimize <linux/usb/ch9.h> dependencies, remove <linux/device.h>

The <linux/usb/ch9.h> header is used over 1,400 times in a typical distro
build, but few of its users actually need the full <linux/device.h> header.

--------------------------------------------------------------------
| Combined, preprocessed C code size of header, without line markers,
| with comments stripped:
-------------------------
before: | #include <linux/usb/ch9.h> | LOC: 7,078 | headers: 172
after: | #include <linux/usb/ch9.h> | LOC: 812 | headers: 38

Remove it and add it to the places that need it.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ingo Molnar and committed by
Greg Kroah-Hartman
01ec4a2e 66b13ce8

+2 -1
+2 -1
include/linux/usb/ch9.h
··· 33 33 #ifndef __LINUX_USB_CH9_H 34 34 #define __LINUX_USB_CH9_H 35 35 36 - #include <linux/device.h> 37 36 #include <uapi/linux/usb/ch9.h> 38 37 39 38 /* USB 3.2 SuperSpeed Plus phy signaling rate generation and lane count */ ··· 43 44 USB_SSP_GEN_1x2, 44 45 USB_SSP_GEN_2x2, 45 46 }; 47 + 48 + struct device; 46 49 47 50 extern const char *usb_ep_type_string(int ep_type); 48 51 extern const char *usb_speed_string(enum usb_device_speed speed);