qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/arm/virt: remove unused header files
@ 2018-10-19 10:18 Hongbo Zhang
  2018-10-19 11:59 ` Peter Maydell
  0 siblings, 1 reply; 7+ messages in thread
From: Hongbo Zhang @ 2018-10-19 10:18 UTC (permalink / raw)
  To: peter.maydell, alex.bennee, qemu-devel, qemu-arm; +Cc: Hongbo Zhang

Remove the unused herder files, 'virt' can be compiled and run without
including them.

Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
---
 hw/arm/virt.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 9f67782..f0066cb 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -30,9 +30,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "hw/sysbus.h"
-#include "hw/arm/arm.h"
-#include "hw/arm/primecell.h"
 #include "hw/arm/virt.h"
 #include "hw/vfio/vfio-calxeda-xgmac.h"
 #include "hw/vfio/vfio-amd-xgbe.h"
@@ -41,12 +38,9 @@
 #include "net/net.h"
 #include "sysemu/device_tree.h"
 #include "sysemu/numa.h"
-#include "sysemu/sysemu.h"
 #include "sysemu/kvm.h"
 #include "hw/compat.h"
 #include "hw/loader.h"
-#include "exec/address-spaces.h"
-#include "qemu/bitops.h"
 #include "qemu/error-report.h"
 #include "hw/pci-host/gpex.h"
 #include "hw/arm/sysbus-fdt.h"
@@ -56,9 +50,7 @@
 #include "hw/intc/arm_gicv3_common.h"
 #include "kvm_arm.h"
 #include "hw/smbios/smbios.h"
-#include "qapi/visitor.h"
 #include "standard-headers/linux/input.h"
-#include "hw/arm/smmuv3.h"
 
 #define DEFINE_VIRT_MACHINE_LATEST(major, minor, latest) \
     static void virt_##major##_##minor##_class_init(ObjectClass *oc, \
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/arm/virt: remove unused header files
  2018-10-19 10:18 [Qemu-devel] [PATCH] hw/arm/virt: remove unused header files Hongbo Zhang
@ 2018-10-19 11:59 ` Peter Maydell
  2018-10-22  1:37   ` Hongbo Zhang
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Maydell @ 2018-10-19 11:59 UTC (permalink / raw)
  To: Hongbo Zhang; +Cc: Alex Bennée, QEMU Developers, qemu-arm

On 19 October 2018 at 11:18, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
> Remove the unused herder files, 'virt' can be compiled and run without
> including them.
>
> Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
> ---
>  hw/arm/virt.c | 8 --------
>  1 file changed, 8 deletions(-)
>
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 9f67782..f0066cb 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -30,9 +30,6 @@
>
>  #include "qemu/osdep.h"
>  #include "qapi/error.h"
> -#include "hw/sysbus.h"
> -#include "hw/arm/arm.h"
> -#include "hw/arm/primecell.h"

Dropping primecell.h makes sense, we don't use what it provides.
But I suspect the others are "unused" only because some other
header we include drags them in implicitly. I think it's better
to explicitly include what we need, in case that other header
changes in future.

How did you determine which #includes to drop here?

thanks
-- PMM

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/arm/virt: remove unused header files
  2018-10-19 11:59 ` Peter Maydell
@ 2018-10-22  1:37   ` Hongbo Zhang
  2018-10-22 10:17     ` Hongbo Zhang
  0 siblings, 1 reply; 7+ messages in thread
From: Hongbo Zhang @ 2018-10-22  1:37 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Alex Bennée, QEMU Developers, qemu-arm

On 19 October 2018 at 19:59, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 19 October 2018 at 11:18, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
>> Remove the unused herder files, 'virt' can be compiled and run without
>> including them.
>>
>> Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
>> ---
>>  hw/arm/virt.c | 8 --------
>>  1 file changed, 8 deletions(-)
>>
>> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
>> index 9f67782..f0066cb 100644
>> --- a/hw/arm/virt.c
>> +++ b/hw/arm/virt.c
>> @@ -30,9 +30,6 @@
>>
>>  #include "qemu/osdep.h"
>>  #include "qapi/error.h"
>> -#include "hw/sysbus.h"
>> -#include "hw/arm/arm.h"
>> -#include "hw/arm/primecell.h"
>
> Dropping primecell.h makes sense, we don't use what it provides.
> But I suspect the others are "unused" only because some other
> header we include drags them in implicitly. I think it's better
> to explicitly include what we need, in case that other header
> changes in future.
>
> How did you determine which #includes to drop here?
>
Well, while I was working on the 'sbsa-ref' machine, I believed I
could remove some header files because I deleted some functions for
that platform, so I did.
And later, I thought I can try to test to remove part of what I did
for 'sbsa-ref' for 'virt' too, tests showed me that 'virt'  can be
compiled and run without them.

> thanks
> -- PMM

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/arm/virt: remove unused header files
  2018-10-22  1:37   ` Hongbo Zhang
@ 2018-10-22 10:17     ` Hongbo Zhang
  2018-10-23 10:21       ` Hongbo Zhang
  0 siblings, 1 reply; 7+ messages in thread
From: Hongbo Zhang @ 2018-10-22 10:17 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Alex Bennée, QEMU Developers, qemu-arm

On 22 October 2018 at 09:37, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
> On 19 October 2018 at 19:59, Peter Maydell <peter.maydell@linaro.org> wrote:
>> On 19 October 2018 at 11:18, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
>>> Remove the unused herder files, 'virt' can be compiled and run without
>>> including them.
>>>
>>> Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
>>> ---
>>>  hw/arm/virt.c | 8 --------
>>>  1 file changed, 8 deletions(-)
>>>
>>> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
>>> index 9f67782..f0066cb 100644
>>> --- a/hw/arm/virt.c
>>> +++ b/hw/arm/virt.c
>>> @@ -30,9 +30,6 @@
>>>
>>>  #include "qemu/osdep.h"
>>>  #include "qapi/error.h"
>>> -#include "hw/sysbus.h"
>>> -#include "hw/arm/arm.h"
>>> -#include "hw/arm/primecell.h"
>>
>> Dropping primecell.h makes sense, we don't use what it provides.
>> But I suspect the others are "unused" only because some other
>> header we include drags them in implicitly. I think it's better
>> to explicitly include what we need, in case that other header
>> changes in future.
>>
I think at least another "hw/arm/smmuv3.h" can be removed too, even if
we want to explicit including.
Will check others one by one.

>> How did you determine which #includes to drop here?
>>
> Well, while I was working on the 'sbsa-ref' machine, I believed I
> could remove some header files because I deleted some functions for
> that platform, so I did.
> And later, I thought I can try to test to remove part of what I did
> for 'sbsa-ref' for 'virt' too, tests showed me that 'virt'  can be
> compiled and run without them.
>
>> thanks
>> -- PMM

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/arm/virt: remove unused header files
  2018-10-22 10:17     ` Hongbo Zhang
@ 2018-10-23 10:21       ` Hongbo Zhang
  2018-11-05 13:26         ` Auger Eric
  0 siblings, 1 reply; 7+ messages in thread
From: Hongbo Zhang @ 2018-10-23 10:21 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Alex Bennée, QEMU Developers, qemu-arm

Well, after checking manually, the header files
"hw/arm/primecell.h"
"qapi/visitor.h"
"hw/arm/smmuv3.h"
are really not used in virt.c, still can be removed.

On 22 October 2018 at 18:17, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
> On 22 October 2018 at 09:37, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
>> On 19 October 2018 at 19:59, Peter Maydell <peter.maydell@linaro.org> wrote:
>>> On 19 October 2018 at 11:18, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
>>>> Remove the unused herder files, 'virt' can be compiled and run without
>>>> including them.
>>>>
>>>> Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
>>>> ---
>>>>  hw/arm/virt.c | 8 --------
>>>>  1 file changed, 8 deletions(-)
>>>>
>>>> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
>>>> index 9f67782..f0066cb 100644
>>>> --- a/hw/arm/virt.c
>>>> +++ b/hw/arm/virt.c
>>>> @@ -30,9 +30,6 @@
>>>>
>>>>  #include "qemu/osdep.h"
>>>>  #include "qapi/error.h"
>>>> -#include "hw/sysbus.h"
>>>> -#include "hw/arm/arm.h"
>>>> -#include "hw/arm/primecell.h"
>>>
>>> Dropping primecell.h makes sense, we don't use what it provides.
>>> But I suspect the others are "unused" only because some other
>>> header we include drags them in implicitly. I think it's better
>>> to explicitly include what we need, in case that other header
>>> changes in future.
>>>
> I think at least another "hw/arm/smmuv3.h" can be removed too, even if
> we want to explicit including.
> Will check others one by one.
>
>>> How did you determine which #includes to drop here?
>>>
>> Well, while I was working on the 'sbsa-ref' machine, I believed I
>> could remove some header files because I deleted some functions for
>> that platform, so I did.
>> And later, I thought I can try to test to remove part of what I did
>> for 'sbsa-ref' for 'virt' too, tests showed me that 'virt'  can be
>> compiled and run without them.
>>
>>> thanks
>>> -- PMM

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/arm/virt: remove unused header files
  2018-10-23 10:21       ` Hongbo Zhang
@ 2018-11-05 13:26         ` Auger Eric
  2018-11-06 10:26           ` Hongbo Zhang
  0 siblings, 1 reply; 7+ messages in thread
From: Auger Eric @ 2018-11-05 13:26 UTC (permalink / raw)
  To: Hongbo Zhang, Peter Maydell; +Cc: qemu-arm, Alex Bennée, QEMU Developers

Hi Hongbo,

On 10/23/18 12:21 PM, Hongbo Zhang wrote:
> Well, after checking manually, the header files
> "hw/arm/primecell.h"
> "qapi/visitor.h"
> "hw/arm/smmuv3.h"
> are really not used in virt.c, still can be removed.
> 
> On 22 October 2018 at 18:17, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
>> On 22 October 2018 at 09:37, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
>>> On 19 October 2018 at 19:59, Peter Maydell <peter.maydell@linaro.org> wrote:
>>>> On 19 October 2018 at 11:18, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
>>>>> Remove the unused herder files, 'virt' can be compiled and run without
>>>>> including them.
>>>>>
>>>>> Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
>>>>> ---
>>>>>  hw/arm/virt.c | 8 --------
>>>>>  1 file changed, 8 deletions(-)
>>>>>
>>>>> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
>>>>> index 9f67782..f0066cb 100644
>>>>> --- a/hw/arm/virt.c
>>>>> +++ b/hw/arm/virt.c
>>>>> @@ -30,9 +30,6 @@
>>>>>
>>>>>  #include "qemu/osdep.h"
>>>>>  #include "qapi/error.h"
>>>>> -#include "hw/sysbus.h"
>>>>> -#include "hw/arm/arm.h"
>>>>> -#include "hw/arm/primecell.h"
>>>>
>>>> Dropping primecell.h makes sense, we don't use what it provides.
>>>> But I suspect the others are "unused" only because some other
>>>> header we include drags them in implicitly. I think it's better
>>>> to explicitly include what we need, in case that other header
>>>> changes in future.
>>>>
>> I think at least another "hw/arm/smmuv3.h" can be removed too, even if
>> we want to explicit including.
Yes I think you can safely remove this one.

Thanks

Eric
>> Will check others one by one.
>>
>>>> How did you determine which #includes to drop here?
>>>>
>>> Well, while I was working on the 'sbsa-ref' machine, I believed I
>>> could remove some header files because I deleted some functions for
>>> that platform, so I did.
>>> And later, I thought I can try to test to remove part of what I did
>>> for 'sbsa-ref' for 'virt' too, tests showed me that 'virt'  can be
>>> compiled and run without them.
>>>
>>>> thanks
>>>> -- PMM
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/arm/virt: remove unused header files
  2018-11-05 13:26         ` Auger Eric
@ 2018-11-06 10:26           ` Hongbo Zhang
  0 siblings, 0 replies; 7+ messages in thread
From: Hongbo Zhang @ 2018-11-06 10:26 UTC (permalink / raw)
  To: Auger Eric; +Cc: Peter Maydell, qemu-arm, Alex Bennée, QEMU Developers

On 5 November 2018 at 21:26, Auger Eric <eric.auger@redhat.com> wrote:
> Hi Hongbo,
>
> On 10/23/18 12:21 PM, Hongbo Zhang wrote:
>> Well, after checking manually, the header files
>> "hw/arm/primecell.h"
>> "qapi/visitor.h"
>> "hw/arm/smmuv3.h"
>> are really not used in virt.c, still can be removed.
>>
>> On 22 October 2018 at 18:17, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
>>> On 22 October 2018 at 09:37, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
>>>> On 19 October 2018 at 19:59, Peter Maydell <peter.maydell@linaro.org> wrote:
>>>>> On 19 October 2018 at 11:18, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
>>>>>> Remove the unused herder files, 'virt' can be compiled and run without
>>>>>> including them.
>>>>>>
>>>>>> Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
>>>>>> ---
>>>>>>  hw/arm/virt.c | 8 --------
>>>>>>  1 file changed, 8 deletions(-)
>>>>>>
>>>>>> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
>>>>>> index 9f67782..f0066cb 100644
>>>>>> --- a/hw/arm/virt.c
>>>>>> +++ b/hw/arm/virt.c
>>>>>> @@ -30,9 +30,6 @@
>>>>>>
>>>>>>  #include "qemu/osdep.h"
>>>>>>  #include "qapi/error.h"
>>>>>> -#include "hw/sysbus.h"
>>>>>> -#include "hw/arm/arm.h"
>>>>>> -#include "hw/arm/primecell.h"
>>>>>
>>>>> Dropping primecell.h makes sense, we don't use what it provides.
>>>>> But I suspect the others are "unused" only because some other
>>>>> header we include drags them in implicitly. I think it's better
>>>>> to explicitly include what we need, in case that other header
>>>>> changes in future.
>>>>>
>>> I think at least another "hw/arm/smmuv3.h" can be removed too, even if
>>> we want to explicit including.
> Yes I think you can safely remove this one.
>
Thanks.

As my summary, I think these three can be removed,
"hw/arm/primecell.h"
"qapi/visitor.h"
"hw/arm/smmuv3.h"
Peter confirmed the first, Auger confirmed the third, anybody has
comments for the second? so that I can send out a v2 for this.

> Thanks
>
> Eric
>>> Will check others one by one.
>>>
>>>>> How did you determine which #includes to drop here?
>>>>>
>>>> Well, while I was working on the 'sbsa-ref' machine, I believed I
>>>> could remove some header files because I deleted some functions for
>>>> that platform, so I did.
>>>> And later, I thought I can try to test to remove part of what I did
>>>> for 'sbsa-ref' for 'virt' too, tests showed me that 'virt'  can be
>>>> compiled and run without them.
>>>>
>>>>> thanks
>>>>> -- PMM
>>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-11-06 10:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-19 10:18 [Qemu-devel] [PATCH] hw/arm/virt: remove unused header files Hongbo Zhang
2018-10-19 11:59 ` Peter Maydell
2018-10-22  1:37   ` Hongbo Zhang
2018-10-22 10:17     ` Hongbo Zhang
2018-10-23 10:21       ` Hongbo Zhang
2018-11-05 13:26         ` Auger Eric
2018-11-06 10:26           ` Hongbo Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).