[Top][All Lists]

[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.)


I'm sorry I forgot to update this in the series :/



reply via email to

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