diff mbox series

hw/usb: Make "hcd-ehci.h" header public

Message ID 20200504082238.16655-1-f4bug@amsat.org
State New
Headers show
Series hw/usb: Make "hcd-ehci.h" header public | expand

Commit Message

Philippe Mathieu-Daudé May 4, 2020, 8:22 a.m. UTC
As target-specific code use this header, move it to the publicly
accessible include/ folder.

  $ git grep hw/usb/hcd-ehci.h
  hw/arm/allwinner-h3.c:31:#include "hw/usb/hcd-ehci.h"
  hw/arm/exynos4210.c:38:#include "hw/usb/hcd-ehci.h"
  hw/ppc/sam460ex.c:38:#include "hw/usb/hcd-ehci.h"
  include/hw/arm/allwinner-a10.h:13:#include "hw/usb/hcd-ehci.h"
  include/hw/arm/aspeed_soc.h:29:#include "hw/usb/hcd-ehci.h"

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 {hw => include/hw}/usb/hcd-ehci.h | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename {hw => include/hw}/usb/hcd-ehci.h (100%)

Comments

BALATON Zoltan May 4, 2020, 8:48 a.m. UTC | #1
On Mon, 4 May 2020, Philippe Mathieu-Daudé wrote:
> As target-specific code use this header, move it to the publicly
> accessible include/ folder.
>
>  $ git grep hw/usb/hcd-ehci.h
>  hw/arm/allwinner-h3.c:31:#include "hw/usb/hcd-ehci.h"
>  hw/arm/exynos4210.c:38:#include "hw/usb/hcd-ehci.h"
>  hw/ppc/sam460ex.c:38:#include "hw/usb/hcd-ehci.h"
>  include/hw/arm/allwinner-a10.h:13:#include "hw/usb/hcd-ehci.h"
>  include/hw/arm/aspeed_soc.h:29:#include "hw/usb/hcd-ehci.h"

All of these only need either the type #define or EHCISysBusState so 
splitting only those off to a public header should be enough and better 
than making public all of ehci's internal header.

Regards,
BALATON Zoltan
Philippe Mathieu-Daudé May 4, 2020, 10:12 a.m. UTC | #2
On 5/4/20 10:48 AM, BALATON Zoltan wrote:
> On Mon, 4 May 2020, Philippe Mathieu-Daudé wrote:
>> As target-specific code use this header, move it to the publicly
>> accessible include/ folder.
>>
>>  $ git grep hw/usb/hcd-ehci.h
>>  hw/arm/allwinner-h3.c:31:#include "hw/usb/hcd-ehci.h"
>>  hw/arm/exynos4210.c:38:#include "hw/usb/hcd-ehci.h"
>>  hw/ppc/sam460ex.c:38:#include "hw/usb/hcd-ehci.h"
>>  include/hw/arm/allwinner-a10.h:13:#include "hw/usb/hcd-ehci.h"
>>  include/hw/arm/aspeed_soc.h:29:#include "hw/usb/hcd-ehci.h"
> 
> All of these only need either the type #define or EHCISysBusState so 
> splitting only those off to a public header should be enough and better 
> than making public all of ehci's internal header.

Ah you mean forward-declare EHCISysBusState in "qemu/typedefs.h", OK.

> 
> Regards,
> BALATON Zoltan
Philippe Mathieu-Daudé May 4, 2020, 10:21 a.m. UTC | #3
On 5/4/20 12:12 PM, Philippe Mathieu-Daudé wrote:
> On 5/4/20 10:48 AM, BALATON Zoltan wrote:
>> On Mon, 4 May 2020, Philippe Mathieu-Daudé wrote:
>>> As target-specific code use this header, move it to the publicly
>>> accessible include/ folder.
>>>
>>>  $ git grep hw/usb/hcd-ehci.h
>>>  hw/arm/allwinner-h3.c:31:#include "hw/usb/hcd-ehci.h"
>>>  hw/arm/exynos4210.c:38:#include "hw/usb/hcd-ehci.h"
>>>  hw/ppc/sam460ex.c:38:#include "hw/usb/hcd-ehci.h"
>>>  include/hw/arm/allwinner-a10.h:13:#include "hw/usb/hcd-ehci.h"
>>>  include/hw/arm/aspeed_soc.h:29:#include "hw/usb/hcd-ehci.h"
>>
>> All of these only need either the type #define or EHCISysBusState so 
>> splitting only those off to a public header should be enough and 
>> better than making public all of ehci's internal header.
> 
> Ah you mean forward-declare EHCISysBusState in "qemu/typedefs.h", OK.

It won't work because AspeedSoCState and AwA10State use the full 
structure (not a pointer to it).

>>
>> Regards,
>> BALATON Zoltan
>
BALATON Zoltan May 4, 2020, 12:12 p.m. UTC | #4
On Mon, 4 May 2020, Philippe Mathieu-Daudé wrote:
> On 5/4/20 12:12 PM, Philippe Mathieu-Daudé wrote:
>> On 5/4/20 10:48 AM, BALATON Zoltan wrote:
>>> On Mon, 4 May 2020, Philippe Mathieu-Daudé wrote:
>>>> As target-specific code use this header, move it to the publicly
>>>> accessible include/ folder.
>>>> 
>>>>  $ git grep hw/usb/hcd-ehci.h
>>>>  hw/arm/allwinner-h3.c:31:#include "hw/usb/hcd-ehci.h"
>>>>  hw/arm/exynos4210.c:38:#include "hw/usb/hcd-ehci.h"
>>>>  hw/ppc/sam460ex.c:38:#include "hw/usb/hcd-ehci.h"
>>>>  include/hw/arm/allwinner-a10.h:13:#include "hw/usb/hcd-ehci.h"
>>>>  include/hw/arm/aspeed_soc.h:29:#include "hw/usb/hcd-ehci.h"
>>> 
>>> All of these only need either the type #define or EHCISysBusState so 
>>> splitting only those off to a public header should be enough and better 
>>> than making public all of ehci's internal header.
>> 
>> Ah you mean forward-declare EHCISysBusState in "qemu/typedefs.h", OK.
>
> It won't work because AspeedSoCState and AwA10State use the full structure 
> (not a pointer to it).

I've meant splitting the internal header into a public one only containing 
the EHCISysBusState struct definition and TYPE_* #defines (or those could 
be replaced with string value where used as done at several other places 
to reduce dependence on this header). These are the only parts which used 
outside hcd-ehci. All other internal stuff would remain in internal 
header where they belong.

AwA10State also uses OHCISysBusState, why doesn't that have the same 
problem? Why no other models need this? could this be really a problem 
with these two models?

Regards,
BALATON Zoltan
diff mbox series

Patch

diff --git a/hw/usb/hcd-ehci.h b/include/hw/usb/hcd-ehci.h
similarity index 100%
rename from hw/usb/hcd-ehci.h
rename to include/hw/usb/hcd-ehci.h