qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw: Do not include hw/sysbus.h if it is not necessary


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] hw: Do not include hw/sysbus.h if it is not necessary
Date: Sat, 27 Mar 2021 19:35:36 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0


On 3/27/21 7:19 PM, Thomas Huth wrote:
> On 27/03/2021 15.54, Philippe Mathieu-Daudé wrote:
>> Hi Thomas,
>>
>> On 3/27/21 9:28 AM, Thomas Huth wrote:
>>> Many files include hw/sysbus.h without needing it. Remove the
>>> superfluous
>>> include statements.
>>>
>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>> ---
>>>   hw/arm/cubieboard.c         | 1 -
>>>   hw/arm/orangepi.c           | 1 -
>>>   hw/char/riscv_htif.c        | 1 -
>>>   hw/char/sifive_uart.c       | 1 -
>>>   hw/char/virtio-serial-bus.c | 1 -
>>>   hw/core/generic-loader.c    | 1 -
>>>   hw/core/guest-loader.c      | 1 -
>>>   hw/ide/ahci_internal.h      | 1 -
>>>   hw/input/lasips2.c          | 1 -
>>>   hw/intc/arm_gic_kvm.c       | 1 -
>>>   hw/intc/arm_gicv3.c         | 1 -
>>>   hw/intc/arm_gicv3_kvm.c     | 1 -
>>>   hw/intc/s390_flic_kvm.c     | 1 -
>>>   hw/isa/lpc_ich9.c           | 1 -
>>>   hw/isa/piix4.c              | 1 -
>>>   hw/moxie/moxiesim.c         | 1 -
>>>   hw/nios2/generic_nommu.c    | 1 -
>>>   hw/nubus/nubus-bus.c        | 1 -
>>>   hw/nvram/spapr_nvram.c      | 1 -
>>>   hw/rx/rx-gdbsim.c           | 1 -
>>>   hw/s390x/s390-ccw.c         | 1 -
>>>   hw/s390x/virtio-ccw.c       | 1 -
>>>   hw/timer/mips_gictimer.c    | 1 -
>>>   hw/usb/xen-usb.c            | 1 -
>>>   hw/vfio/ap.c                | 1 -
>>>   hw/vfio/ccw.c               | 1 -
>>>   hw/xen/xen-bus-helper.c     | 1 -
>>>   27 files changed, 27 deletions(-)
>>
>> $ git grep -l '#include "hw/sysbus.h"' hw \
>>    | xargs git grep -L sysbus_ \
>>    | xargs git grep -L 'SysBusDevice\s\+\w'
>>
>> hw/arm/cubieboard.c
>> hw/arm/orangepi.c
>> hw/char/riscv_htif.c
>> hw/char/sifive_uart.c
>> hw/char/virtio-serial-bus.c
>> hw/core/generic-loader.c
>> hw/core/guest-loader.c
>> hw/hyperv/vmbus.c
>> hw/i386/x86-iommu.c
>> hw/ide/ahci_internal.h
>> hw/input/lasips2.c
>> hw/intc/arm_gic_kvm.c
>> hw/intc/arm_gicv3.c
>> hw/intc/arm_gicv3_kvm.c
>> hw/intc/s390_flic_kvm.c
>> hw/isa/lpc_ich9.c
>> hw/isa/piix4.c
>> hw/moxie/moxiesim.c
>> hw/nios2/generic_nommu.c
>> hw/nubus/nubus-bridge.c
>> hw/nubus/nubus-bus.c
>> hw/nvram/spapr_nvram.c
>> hw/ppc/spapr_pci.c
>> hw/riscv/riscv_hart.c
>> hw/rx/rx-gdbsim.c
>> hw/s390x/s390-ccw.c
>> hw/s390x/virtio-ccw.c
>> hw/timer/mips_gictimer.c
>> hw/tricore/tc27x_soc.c
>> hw/usb/xen-usb.c
>> hw/vfio/ap.c
>> hw/vfio/ccw.c
>> hw/xen/xen-bus-helper.c
>>
>> diff with your set:
>>
>> @@ -5,6 +5,8 @@
>>   hw/char/virtio-serial-bus.c
>>   hw/core/generic-loader.c
>>   hw/core/guest-loader.c
>> +hw/hyperv/vmbus.c
>> +hw/i386/x86-iommu.c
>>   hw/ide/ahci_internal.h
>>   hw/input/lasips2.c
>>   hw/intc/arm_gic_kvm.c
>> @@ -15,12 +17,16 @@
>>   hw/isa/piix4.c
>>   hw/moxie/moxiesim.c
>>   hw/nios2/generic_nommu.c
>> +hw/nubus/nubus-bridge.c
>>   hw/nubus/nubus-bus.c
>>   hw/nvram/spapr_nvram.c
>> +hw/ppc/spapr_pci.c
>> +hw/riscv/riscv_hart.c
>>   hw/rx/rx-gdbsim.c
>>   hw/s390x/s390-ccw.c
>>   hw/s390x/virtio-ccw.c
>>   hw/timer/mips_gictimer.c
>> +hw/tricore/tc27x_soc.c
>>   hw/usb/xen-usb.c
>>   hw/vfio/ap.c
>>   hw/vfio/ccw.c
>>
>> 6 more candidates?
> 
> No, since those use TYPE_SYS_BUS_DEVICE and thus require hw/sysbus.h.

Ah indeed, this line matches your patch changes:

$ git grep -l '#include "hw/sysbus.h"' hw \
   | xargs git grep -L sysbus_ \
   | xargs git grep -L 'SysBusDevice\s\+\w' \
   | xargs grep -L SYS_BUS_DEVICE

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]