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

usb: gadget: uvc: Minimize #include in headers

In order to speed up compilation, only include the headers that are
strictly required within other headers. To that end, use forward
structure declaration and move #include statements to .c file as
appropriate.

While at it, sort headers alphabetically, and remove unneeded __KERNEL__
guards.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

authored by

Laurent Pinchart and committed by
Felipe Balbi
284eb166 d396e47f

+25 -18
+3 -2
drivers/usb/gadget/function/f_uvc.c
··· 6 6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com) 7 7 */ 8 8 9 - #include <linux/kernel.h> 10 - #include <linux/module.h> 11 9 #include <linux/device.h> 12 10 #include <linux/errno.h> 13 11 #include <linux/fs.h> 12 + #include <linux/kernel.h> 14 13 #include <linux/list.h> 14 + #include <linux/module.h> 15 15 #include <linux/mutex.h> 16 16 #include <linux/string.h> 17 17 #include <linux/usb/ch9.h> 18 18 #include <linux/usb/gadget.h> 19 + #include <linux/usb/g_uvc.h> 19 20 #include <linux/usb/video.h> 20 21 #include <linux/vmalloc.h> 21 22 #include <linux/wait.h>
+1 -5
drivers/usb/gadget/function/f_uvc.h
··· 9 9 #ifndef _F_UVC_H_ 10 10 #define _F_UVC_H_ 11 11 12 - #include <linux/usb/composite.h> 13 - #include <linux/usb/video.h> 14 - 15 - #include "uvc.h" 12 + struct uvc_device; 16 13 17 14 void uvc_function_setup_continue(struct uvc_device *uvc); 18 15 ··· 18 21 void uvc_function_disconnect(struct uvc_device *uvc); 19 22 20 23 #endif /* _F_UVC_H_ */ 21 -
+1
drivers/usb/gadget/function/u_uvc.h
··· 13 13 #ifndef U_UVC_H 14 14 #define U_UVC_H 15 15 16 + #include <linux/mutex.h> 16 17 #include <linux/usb/composite.h> 17 18 #include <linux/usb/video.h> 18 19
+10 -4
drivers/usb/gadget/function/uvc.h
··· 9 9 #ifndef _UVC_GADGET_H_ 10 10 #define _UVC_GADGET_H_ 11 11 12 - #include <linux/usb.h> /* For usb_endpoint_* */ 12 + #include <linux/list.h> 13 + #include <linux/mutex.h> 14 + #include <linux/spinlock.h> 13 15 #include <linux/usb/composite.h> 14 - #include <linux/usb/gadget.h> 15 - #include <linux/usb/g_uvc.h> 16 16 #include <linux/videodev2.h> 17 - #include <media/v4l2-fh.h> 17 + 18 18 #include <media/v4l2-device.h> 19 + #include <media/v4l2-dev.h> 20 + #include <media/v4l2-fh.h> 19 21 20 22 #include "uvc_queue.h" 23 + 24 + struct usb_ep; 25 + struct usb_request; 26 + struct uvc_descriptor_header; 21 27 22 28 /* ------------------------------------------------------------------------ 23 29 * Debugging, printing and logging
+6 -6
drivers/usb/gadget/function/uvc_queue.h
··· 2 2 #ifndef _UVC_QUEUE_H_ 3 3 #define _UVC_QUEUE_H_ 4 4 5 - #ifdef __KERNEL__ 6 - 7 - #include <linux/kernel.h> 5 + #include <linux/list.h> 8 6 #include <linux/poll.h> 9 - #include <linux/videodev2.h> 7 + #include <linux/spinlock.h> 8 + 10 9 #include <media/videobuf2-v4l2.h> 10 + 11 + struct file; 12 + struct mutex; 11 13 12 14 /* Maximum frame size in bytes, for sanity checking. */ 13 15 #define UVC_MAX_FRAME_SIZE (16*1024*1024) ··· 92 90 struct uvc_buffer *buf); 93 91 94 92 struct uvc_buffer *uvcg_queue_head(struct uvc_video_queue *queue); 95 - 96 - #endif /* __KERNEL__ */ 97 93 98 94 #endif /* _UVC_QUEUE_H_ */ 99 95
+2 -1
drivers/usb/gadget/function/uvc_v4l2.c
··· 6 6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com) 7 7 */ 8 8 9 - #include <linux/kernel.h> 10 9 #include <linux/device.h> 11 10 #include <linux/errno.h> 11 + #include <linux/kernel.h> 12 12 #include <linux/list.h> 13 + #include <linux/usb/g_uvc.h> 13 14 #include <linux/videodev2.h> 14 15 #include <linux/vmalloc.h> 15 16 #include <linux/wait.h>
+2
drivers/usb/gadget/function/uvc_video.h
··· 12 12 #ifndef __UVC_VIDEO_H__ 13 13 #define __UVC_VIDEO_H__ 14 14 15 + struct uvc_video; 16 + 15 17 int uvcg_video_pump(struct uvc_video *video); 16 18 17 19 int uvcg_video_enable(struct uvc_video *video, int enable);