RE: [PATCH 3/7] drivers: usb: Include appropriate header file in hcd.h
From: David Laight
Date: Thu Dec 19 2013 - 11:22:44 EST
> From: Rashika Kheria
> Include header file include/linux/usb.h in include/linux/usb/hcd.h
> because structures usb_device, usb_host_config and usb_interface have
> their definitions in include/linux/usb.h.
>
> This eliminates the following warning in include/linux/usb/hcd.h:
> include/linux/usb/hcd.h:311:44: warning: âstruct usb_deviceâ declared inside parameter list [enabled
> by default]
> include/linux/usb/hcd.h:412:10: warning: âstruct usb_host_configâ declared inside parameter list
> [enabled by default]
> include/linux/usb/hcd.h:614:9: warning: âstruct usb_interfaceâ declared inside parameter list [enabled
> by default]
All it is necessary to do is add a declaration of the struct before the function definition.
There is no need to include the definition of the structure.
It is a shame that gcc doesn't defer this warning to any call site
(where an incorrect type would get passed).
David
N§²æìr¸yúèØb²X¬¶ÇvØ^)Þ{.nÇ+·¥{±êçzX§¶¡Ü}©²ÆzÚ&j:+v¨¾«êçzZ+Ê+zf£¢·h§~Ûiÿûàz¹®w¥¢¸?¨èÚ&¢)ßfù^jÇy§m
á@A«a¶Úÿ0¶ìh®åi