[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/6] hw/arm: Remove unused include
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH 2/6] hw/arm: Remove unused include |
Date: |
Mon, 10 Dec 2018 10:14:01 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 |
Hi Michael, Peter.
On 12/7/18 6:57 PM, Michael S. Tsirkin wrote:
> On Fri, Dec 07, 2018 at 06:03:56PM +0100, Philippe Mathieu-Daudé wrote:
>> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
>> ---
>> hw/arm/virt-acpi-build.c | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
>> index 5785fb697c..98d7f7cf20 100644
>> --- a/hw/arm/virt-acpi-build.c
>> +++ b/hw/arm/virt-acpi-build.c
>> @@ -35,7 +35,6 @@
>> #include "target/arm/cpu.h"
>> #include "hw/acpi/acpi-defs.h"
>> #include "hw/acpi/acpi.h"
>> -#include "hw/nvram/fw_cfg.h"
>> #include "hw/acpi/bios-linker-loader.h"
>> #include "hw/loader.h"
>> #include "hw/hw.h"
>
>
> This file uses fw_cfg_add_file, looks wrong.
Previously I thought if another include (here hw/loader.h) already pulls
this header, we can drop it, but Peter Maydell explained me this not
safe for refactors:
Generally I think that if a .c file directly uses function X declared
in header Y it should #include Y, even if it happens that it already
includes other header Z that includes Y. Otherwise if we refactor Z
later such that it no longer needs to include Y, it will break
compilation of the .c file. (That is, Z including Y is a detail of
the implementation of Z, not a guarantee made by Z to its users.)
https://lists.gnu.org/archive/html/qemu-devel/2018-11/msg02460.html
I'm sorry I forgot to update this in the series :/
Regards,
Phil.
- [Qemu-devel] [PATCH 0/6] fw_cfg: add HMP 'info fw_cfg' and add_file_from_host(), Philippe Mathieu-Daudé, 2018/12/07
- [Qemu-devel] [PATCH 1/6] hw/arm/virt: Remove null-check in virt_build_smbios(), Philippe Mathieu-Daudé, 2018/12/07
- [Qemu-devel] [PATCH 2/6] hw/arm: Remove unused include, Philippe Mathieu-Daudé, 2018/12/07
- [Qemu-devel] [PATCH 3/6] hw/i386: Remove unused include, Philippe Mathieu-Daudé, 2018/12/07
- [Qemu-devel] [PATCH 4/6] hw/nvram/fw_cfg: Add trace events, Philippe Mathieu-Daudé, 2018/12/07
- [Qemu-devel] [PATCH 6/6] hw/nvram/fw_cfg: Add fw_cfg_add_file_from_host(), Philippe Mathieu-Daudé, 2018/12/07