qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 1/5] include/hw/pci: Clean up superfluous inclusion of pci*/*


From: Markus Armbruster
Subject: Re: [PATCH 1/5] include/hw/pci: Clean up superfluous inclusion of pci*/*.h cxl/*.h
Date: Sat, 10 Dec 2022 08:25:28 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

"Michael S. Tsirkin" <mst@redhat.com> writes:

> On Fri, Dec 09, 2022 at 02:47:58PM +0100, Markus Armbruster wrote:
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>
> Thanks!
> How can I verify this is correct, i.e. that none
> of the headers that we remove is actually needed?

I think the pragmatic way forward is to let the compiler check.

"But how can we be confident the compiler's check is complete?" you
might ask.  So let's consider how it could be incomplete.

Any .c that (transitively) includes one of the headers that now include
less could be affected.

* Test builds fail to compile such a .c.

  To actually miss a problem, the code not covered must use something
  from a header that is no longer included.

* Test builds compile such a .c, but fail to cover all build
  configurations.

  To actually miss a problem, the conditional code not covered must use
  something from a header that is no longer included.

* Test builds silently miscompile such a .c, i.e. the build succeeds,
  "make check" passes, but the generated code is wrong.

  For this, the code must use something from a header that is no longer
  included *and* it still needs to make sense to the compiler.  Seems
  far-fetched to me, except for #ifdef FOO where FOO comes from such a
  header.

In my opinion, breaking something not covered by CI and in a way that is
trivial to fix doesn't really matter.

In addition to building various configurations, I tested that each
affected header compiles on its own, by compiling

    #include "qemu/osdep.h"
    #include THE_HEADER

There are two failures, hw/cxl/cxl_device.h and include/hw/pci/pcie.h,
but they both fail before this patch as well, and they don't fail
anymore at the end of this series.

Anything else you'd like me to do?




reply via email to

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