[U-Boot] [PATCH] usb: xhci: add struct devrequest declaration
Marek Vasut
marex at denx.de
Thu May 12 13:42:00 CEST 2016
On 05/12/2016 05:36 AM, Masahiro Yamada wrote:
> Hi Marek,
>
>
> 2016-05-11 20:22 GMT+09:00 Marek Vasut <marex at denx.de>:
>
>>>> Because you want to have definition of every symbol you use in your
>>>> headers when you include that header. I am not a big fan of huge stack
>>>> of #include statements in a driver.
>>>
>>> Agree. That's why this patch is here.
>>>
>>> See this patch.
>>> http://patchwork.ozlabs.org/patch/620989/
>>>
>>>
>>> xhci-dwc3.c needs to include xhci.h, but not usb.h
>>> because this driver just wants to register the xHCI controller.
>>> It need not know complicated USB protocol things in the first place.
>>
>> In that case, shouldn't the xhci_register() be in xhci.h instead ?
>
> Ah, right.
>
> That will make APIs clearer, but I cannot touch it
> because I do not have either time or skill to refactor it.
Ha, ok.
>>> Your way adds #include <include/usb.h> to xhci.h,
>>> so xhci-dwc3.c is compelled to include unnecessary usb.h
>>>
>>> It means huge stack of includes you do not like, isn't it?
>>
>> It does add possibly unused symbols to the namespace, yes.
>> I don't think I really mind this though, since the symbol
>> definition is available when I include xhci.h somewhere.
>
> Right.
>
> But, what I can tell at least is that
> it would make the compiler to parse additional headers for nothing.
Right.
--
Best regards,
Marek Vasut
More information about the U-Boot
mailing list