[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 6/5] include/hw/cxl: Break inclusion loop
From: |
Jonathan Cameron |
Subject: |
Re: [PATCH 6/5] include/hw/cxl: Break inclusion loop |
Date: |
Thu, 15 Dec 2022 17:45:16 +0000 |
On Thu, 15 Dec 2022 08:34:10 +0100
Markus Armbruster <armbru@redhat.com> wrote:
> Jonathan Cameron <Jonathan.Cameron@Huawei.com> writes:
>
> > On Sat, 10 Dec 2022 08:09:06 +0100
> > Markus Armbruster <armbru@redhat.com> wrote:
> >
> >> Markus Armbruster <armbru@redhat.com> writes:
> >>
> >> > hw/cxl/cxl_pci.h and hw/cxl/cxl_cdat.h include each other. Neither
> >> > header actually needs the other one. Drop both #include directives.
> >> >
> >> > Signed-off-by: Markus Armbruster <armbru@redhat.com>
> >> > ---
> >> > include/hw/cxl/cxl_cdat.h | 1 -
> >> > include/hw/cxl/cxl_pci.h | 1 -
> >> > 2 files changed, 2 deletions(-)
> >> >
> >> > diff --git a/include/hw/cxl/cxl_cdat.h b/include/hw/cxl/cxl_cdat.h
> >> > index 7f67638685..e3fd737f9d 100644
> >> > --- a/include/hw/cxl/cxl_cdat.h
> >> > +++ b/include/hw/cxl/cxl_cdat.h
> >> > @@ -10,7 +10,6 @@
> >> > #ifndef CXL_CDAT_H
> >> > #define CXL_CDAT_H
> >> >
> >> > -#include "hw/cxl/cxl_pci.h"
> >> > #include "hw/pci/pcie_doe.h"
> >
> > The include was to get to CXL_VENDOR_ID which is in hw/cxl/cxl_pci.h
> > Can move that elsewhere perhaps, though I don't think we need to
> > if we break the loop by dropping the other one.
>
> It's used only in a macro. If you use the macro, you need to include
> cxl_pci.h.
>
> Would you like me to keep this #include?
yes. That would be my preference.
>
> >> > /*
> >> > diff --git a/include/hw/cxl/cxl_pci.h b/include/hw/cxl/cxl_pci.h
> >> > index aca14845ab..01e15ed5b4 100644
> >> > --- a/include/hw/cxl/cxl_pci.h
> >> > +++ b/include/hw/cxl/cxl_pci.h
> >> > @@ -11,7 +11,6 @@
> >> > #define CXL_PCI_H
> >> >
> >> > #include "qemu/compiler.h"
> >> > -#include "hw/cxl/cxl_cdat.h"
> > Guess that's a left over of some earlier refactoring. Good to get rid
> > of this one.
> >
> >> >
> >> > #define CXL_VENDOR_ID 0x1e98
> >>
> >> Friday afternoon post with insufficient testing... Everything still
> >> builds fine, but cxl_component.h is no longer self-contained. I'll
> >> squash in the appended patch and revise the commit message.
> >
> > By staring at the code rather than any automation I'm failing to spot
> > what it needs from cxl_pci.h. Can you add that info to the commit message?
> >
>
> It's CXL20_MAX_DVSEC.
ah. Make sense. Thanks.
>
> >> diff --git a/include/hw/cxl/cxl_component.h
> >> b/include/hw/cxl/cxl_component.h
> >> index 5dca21e95b..78f83ed742 100644
> >> --- a/include/hw/cxl/cxl_component.h
> >> +++ b/include/hw/cxl/cxl_component.h
> >> @@ -19,6 +19,7 @@
> >> #include "qemu/range.h"
> >> #include "qemu/typedefs.h"
> >> #include "hw/cxl/cxl_cdat.h"
> >> +#include "hw/cxl/cxl_pci.h"
> >> #include "hw/register.h"
> >> #include "qapi/error.h"
> >>
> >>
>
- Re: [PATCH 1/5] include/hw/pci: Clean up superfluous inclusion of pci*/*.h cxl/*.h, (continued)
[PATCH 4/5] include/hw/pci: Split pci_device.h off pci.h, Markus Armbruster, 2022/12/09
[PATCH 6/5] include/hw/cxl: Break inclusion loop, Markus Armbruster, 2022/12/09
Re: [PATCH 0/5] include/hw/pci include/hw/cxl: Clean up includes, Michael S. Tsirkin, 2022/12/21