[v3,01/41] hw: Clean "hw/devices.h" includes

Message ID 20180415234307.28132-2-f4bug@amsat.org
State New
Headers show
Series
  • hw: Use the BYTE-based definitions when useful
Related show

Commit Message

Philippe Mathieu-Daudé April 15, 2018, 11:42 p.m.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/devices.h | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Thomas Huth April 16, 2018, 4:53 a.m. | #1
On 16.04.2018 01:42, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/hw/devices.h | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/include/hw/devices.h b/include/hw/devices.h
> index 861ddea8af..0e27feb0c2 100644
> --- a/include/hw/devices.h
> +++ b/include/hw/devices.h
> @@ -1,13 +1,10 @@
>  #ifndef QEMU_DEVICES_H
>  #define QEMU_DEVICES_H
>  
> -#include "hw/irq.h"
> -
> -/* ??? Not all users of this file can include cpu-common.h.  */
> -struct MemoryRegion;
> -
>  /* Devices that have nowhere better to go.  */
>  
> +#include "hw/hw.h"
> +
>  /* smc91c111.c */
>  void smc91c111_init(NICInfo *, uint32_t, qemu_irq);

IMHO we should rather get rid of devices.h (in a separate patch series)
and introduce proper small headers à la smc91c111.h for the single
sections in here... Just my 0.02 €.

 Thomas
Philippe Mathieu-Daudé April 16, 2018, 10:06 a.m. | #2
Hi Thomas,

On 04/16/2018 01:53 AM, Thomas Huth wrote:
> On 16.04.2018 01:42, Philippe Mathieu-Daudé wrote:
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>  include/hw/devices.h | 7 ++-----
>>  1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/include/hw/devices.h b/include/hw/devices.h
>> index 861ddea8af..0e27feb0c2 100644
>> --- a/include/hw/devices.h
>> +++ b/include/hw/devices.h
>> @@ -1,13 +1,10 @@
>>  #ifndef QEMU_DEVICES_H
>>  #define QEMU_DEVICES_H
>>  
>> -#include "hw/irq.h"
>> -
>> -/* ??? Not all users of this file can include cpu-common.h.  */
>> -struct MemoryRegion;
>> -
>>  /* Devices that have nowhere better to go.  */
>>  
>> +#include "hw/hw.h"
>> +
>>  /* smc91c111.c */
>>  void smc91c111_init(NICInfo *, uint32_t, qemu_irq);
> 
> IMHO we should rather get rid of devices.h (in a separate patch series)
> and introduce proper small headers à la smc91c111.h for the single
> sections in here... Just my 0.02 €.

Yes, the idea is to QOM'ify those devices and drop this file.

Patch

diff --git a/include/hw/devices.h b/include/hw/devices.h
index 861ddea8af..0e27feb0c2 100644
--- a/include/hw/devices.h
+++ b/include/hw/devices.h
@@ -1,13 +1,10 @@ 
 #ifndef QEMU_DEVICES_H
 #define QEMU_DEVICES_H
 
-#include "hw/irq.h"
-
-/* ??? Not all users of this file can include cpu-common.h.  */
-struct MemoryRegion;
-
 /* Devices that have nowhere better to go.  */
 
+#include "hw/hw.h"
+
 /* smc91c111.c */
 void smc91c111_init(NICInfo *, uint32_t, qemu_irq);