From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 12 May 2016 13:42:00 +0200 Subject: [U-Boot] [PATCH] usb: xhci: add struct devrequest declaration In-Reply-To: References: <1462530989-28434-1-git-send-email-yamada.masahiro@socionext.com> <572C76E2.2020003@denx.de> <572CC8F1.30808@denx.de> <57331600.4030404@denx.de> Message-ID: <57346C08.9070903@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 05/12/2016 05:36 AM, Masahiro Yamada wrote: > Hi Marek, > > > 2016-05-11 20:22 GMT+09:00 Marek Vasut : > >>>> 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 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