lkml.org 
[lkml]   [2013]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/7] drivers: usb: Include appropriate header file in hcd.h
Hello.

On 12/19/2013 06:45 PM, Alan Stern wrote:

>> 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]

Rashika, would it be enough to forward-declare these structures ISO
#include'ing the whole header?

> Where does this problem show up?
>
> Any file that include linux/usb/hcd.h should include linux/usb.h first.
> IMO it would be better to fix the source files that don't do the
> includes properly.

Yeah, let's fix the consequency instead of the cause. :-)

> Of course, people have varying opinions on this issue. As far as I
> know, there is no fixed policy in the kernel about nested includes.

So far, I've only encountered the dubious policy of satisfying header's
dependencies in the files that include them is the USB tree.

> Alan Stern

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2013-12-21 05:41    [W:0.087 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site