diff mbox

[04/11] ide/ahci: add missing includes

Message ID 20170508233918.9043-5-f4bug@amsat.org
State Superseded, archived
Headers show

Commit Message

Philippe Mathieu-Daudé May 8, 2017, 11:39 p.m. UTC
qemu/include/hw/ide/ahci.h:260:16: error: field ‘sglist’ has incomplete type
     QEMUSGList sglist;
                ^~~~~~
/qemu/include/hw/ide/ahci.h:272:5: error: unknown type name ‘IDEDMA’
     IDEDMA dma;
     ^~~~~~
qemu/include/hw/ide/ahci.h:273:5: error: unknown type name ‘IDEBus’
     IDEBus port;
     ^~~~~~
qemu/include/hw/ide/ahci.h:305:15: error: field ‘parent_obj’ has incomplete type
     PCIDevice parent_obj;
               ^~~~~~~~~~

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/ide/ahci.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Eric Blake May 8, 2017, 11:58 p.m. UTC | #1
On 05/08/2017 06:39 PM, Philippe Mathieu-Daudé wrote:
> qemu/include/hw/ide/ahci.h:260:16: error: field ‘sglist’ has incomplete type
>      QEMUSGList sglist;
>                 ^~~~~~

What are you doing to get this compilation error (configure options,
platform, compiler, etc)?  I can't reproduce it. Is it something that
pops up later when you remove includes from somewhere else, and you're
just pre-emptively adding includes here to allow removal of includes later?

> /qemu/include/hw/ide/ahci.h:272:5: error: unknown type name ‘IDEDMA’
>      IDEDMA dma;
>      ^~~~~~
> qemu/include/hw/ide/ahci.h:273:5: error: unknown type name ‘IDEBus’
>      IDEBus port;
>      ^~~~~~
> qemu/include/hw/ide/ahci.h:305:15: error: field ‘parent_obj’ has incomplete type
>      PCIDevice parent_obj;
>                ^~~~~~~~~~
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/hw/ide/ahci.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/hw/ide/ahci.h b/include/hw/ide/ahci.h
> index 0ca7c65820..293f9ebcd0 100644
> --- a/include/hw/ide/ahci.h
> +++ b/include/hw/ide/ahci.h
> @@ -25,6 +25,8 @@
>  #define HW_IDE_AHCI_H
>  
>  #include "hw/sysbus.h"
> +#include "hw/ide/internal.h"
> +#include "sysemu/dma.h"
>  
>  #define AHCI_MEM_BAR_SIZE         0x1000
>  #define AHCI_MAX_PORTS            32
>
John Snow May 9, 2017, 1:49 p.m. UTC | #2
On 05/08/2017 07:58 PM, Eric Blake wrote:
> On 05/08/2017 06:39 PM, Philippe Mathieu-Daudé wrote:
>> qemu/include/hw/ide/ahci.h:260:16: error: field ‘sglist’ has incomplete type
>>      QEMUSGList sglist;
>>                 ^~~~~~
> 
> What are you doing to get this compilation error (configure options,
> platform, compiler, etc)?  I can't reproduce it. Is it something that
> pops up later when you remove includes from somewhere else, and you're
> just pre-emptively adding includes here to allow removal of includes later?
> 

"What he said," but if I had to guess, Philippe is testing that each
header can be compiled separately.

>> /qemu/include/hw/ide/ahci.h:272:5: error: unknown type name ‘IDEDMA’
>>      IDEDMA dma;
>>      ^~~~~~
>> qemu/include/hw/ide/ahci.h:273:5: error: unknown type name ‘IDEBus’
>>      IDEBus port;
>>      ^~~~~~
>> qemu/include/hw/ide/ahci.h:305:15: error: field ‘parent_obj’ has incomplete type
>>      PCIDevice parent_obj;
>>                ^~~~~~~~~~
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>  include/hw/ide/ahci.h | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/include/hw/ide/ahci.h b/include/hw/ide/ahci.h
>> index 0ca7c65820..293f9ebcd0 100644
>> --- a/include/hw/ide/ahci.h
>> +++ b/include/hw/ide/ahci.h
>> @@ -25,6 +25,8 @@
>>  #define HW_IDE_AHCI_H
>>  
>>  #include "hw/sysbus.h"
>> +#include "hw/ide/internal.h">> +#include "sysemu/dma.h"
>>  
>>  #define AHCI_MEM_BAR_SIZE         0x1000
>>  #define AHCI_MAX_PORTS            32
>>
>
Philippe Mathieu-Daudé June 9, 2017, 3:05 p.m. UTC | #3
Hi Eric, John.

The patch 07/11 "hw/arm: use defined type name instead of hard-coded string."
triggered this problem.

I split the previous series to only include the 2 commits involved to reproduce.

As you will see, calxeda_init() from highbank.c uses the sysbus type name
"sysbus-ahci" which is already defined in "hw/ide/ahci.h" as TYPE_SYSBUS_AHCI.
As mentioned in HACKING highbank.c first include is "qemu/osdep.h". However
compiling highbank.c fails (as reported in patch "04/11" commit comments).

I don't think appropriate to include "hw/ide/internal.h" and "sysemu/dma.h" in
highbank.c. Eventually another source including "hw/ide/ahci.h" will hit the
same error.

Do you see another place where those includes should go?

I think I did a mistake sending these both patchs in a series thinking they were
unrelated, I should have send them altogether, my bad :/

Regards,

Phil.

Philippe Mathieu-Daudé (2):
  arm/highbank: use defined type name instead of hard-coded string
  ide/ahci: add missing includes

 hw/arm/highbank.c     | 3 ++-
 include/hw/ide/ahci.h | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/include/hw/ide/ahci.h b/include/hw/ide/ahci.h
index 0ca7c65820..293f9ebcd0 100644
--- a/include/hw/ide/ahci.h
+++ b/include/hw/ide/ahci.h
@@ -25,6 +25,8 @@ 
 #define HW_IDE_AHCI_H
 
 #include "hw/sysbus.h"
+#include "hw/ide/internal.h"
+#include "sysemu/dma.h"
 
 #define AHCI_MEM_BAR_SIZE         0x1000
 #define AHCI_MAX_PORTS            32