* [PATCH] q35: Remove unused mch_mcfg_base
@ 2024-09-18 0:51 dave
2024-09-19 18:28 ` Bernhard Beschow
2024-10-02 10:28 ` Thomas Huth
0 siblings, 2 replies; 4+ messages in thread
From: dave @ 2024-09-18 0:51 UTC (permalink / raw)
To: mst, marcel.apfelbaum, qemu-devel; +Cc: Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <dave@treblig.org>
mch_mcfg_base has been unused since it was added by
6f1426ab0f ("ich9: APIs for pc guest info")
back in 2013.
Remove it.
Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
---
hw/pci-host/q35.c | 10 ----------
include/hw/pci-host/q35.h | 2 --
2 files changed, 12 deletions(-)
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index d5a657a02a..f3e713318e 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -662,16 +662,6 @@ static void mch_realize(PCIDevice *d, Error **errp)
OBJECT(&mch->smram));
}
-uint64_t mch_mcfg_base(void)
-{
- bool ambiguous;
- Object *o = object_resolve_path_type("", TYPE_MCH_PCI_DEVICE, &ambiguous);
- if (!o) {
- return 0;
- }
- return MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT;
-}
-
static Property mch_props[] = {
DEFINE_PROP_UINT16("extended-tseg-mbytes", MCHPCIState, ext_tseg_mbytes,
16),
diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h
index 22fadfa3ed..ddafc3f2e3 100644
--- a/include/hw/pci-host/q35.h
+++ b/include/hw/pci-host/q35.h
@@ -181,8 +181,6 @@ struct Q35PCIHost {
#define MCH_PCIE_DEV 1
#define MCH_PCIE_FUNC 0
-uint64_t mch_mcfg_base(void);
-
/*
* Arbitrary but unique BNF number for IOAPIC device.
*
--
2.46.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] q35: Remove unused mch_mcfg_base
2024-09-18 0:51 [PATCH] q35: Remove unused mch_mcfg_base dave
@ 2024-09-19 18:28 ` Bernhard Beschow
2024-09-19 19:53 ` Dr. David Alan Gilbert
2024-10-02 10:28 ` Thomas Huth
1 sibling, 1 reply; 4+ messages in thread
From: Bernhard Beschow @ 2024-09-19 18:28 UTC (permalink / raw)
To: qemu-devel, dave, mst, marcel.apfelbaum; +Cc: Dr. David Alan Gilbert
Am 18. September 2024 00:51:32 UTC schrieb dave@treblig.org:
>From: "Dr. David Alan Gilbert" <dave@treblig.org>
>
>mch_mcfg_base has been unused since it was added by
> 6f1426ab0f ("ich9: APIs for pc guest info")
>back in 2013.
Indeed.
>
>Remove it.
>
>Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Reviewed-by: Bernhard Beschow <shentey@gmail.com>
I'm curious: How do you detect such unused code?
>---
> hw/pci-host/q35.c | 10 ----------
> include/hw/pci-host/q35.h | 2 --
> 2 files changed, 12 deletions(-)
>
>diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
>index d5a657a02a..f3e713318e 100644
>--- a/hw/pci-host/q35.c
>+++ b/hw/pci-host/q35.c
>@@ -662,16 +662,6 @@ static void mch_realize(PCIDevice *d, Error **errp)
> OBJECT(&mch->smram));
> }
>
>-uint64_t mch_mcfg_base(void)
>-{
>- bool ambiguous;
>- Object *o = object_resolve_path_type("", TYPE_MCH_PCI_DEVICE, &ambiguous);
>- if (!o) {
>- return 0;
>- }
>- return MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT;
>-}
>-
> static Property mch_props[] = {
> DEFINE_PROP_UINT16("extended-tseg-mbytes", MCHPCIState, ext_tseg_mbytes,
> 16),
>diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h
>index 22fadfa3ed..ddafc3f2e3 100644
>--- a/include/hw/pci-host/q35.h
>+++ b/include/hw/pci-host/q35.h
>@@ -181,8 +181,6 @@ struct Q35PCIHost {
> #define MCH_PCIE_DEV 1
> #define MCH_PCIE_FUNC 0
>
>-uint64_t mch_mcfg_base(void);
>-
> /*
> * Arbitrary but unique BNF number for IOAPIC device.
> *
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] q35: Remove unused mch_mcfg_base
2024-09-19 18:28 ` Bernhard Beschow
@ 2024-09-19 19:53 ` Dr. David Alan Gilbert
0 siblings, 0 replies; 4+ messages in thread
From: Dr. David Alan Gilbert @ 2024-09-19 19:53 UTC (permalink / raw)
To: Bernhard Beschow; +Cc: qemu-devel, mst, marcel.apfelbaum
* Bernhard Beschow (shentey@gmail.com) wrote:
>
>
> Am 18. September 2024 00:51:32 UTC schrieb dave@treblig.org:
> >From: "Dr. David Alan Gilbert" <dave@treblig.org>
> >
> >mch_mcfg_base has been unused since it was added by
> > 6f1426ab0f ("ich9: APIs for pc guest info")
> >back in 2013.
>
> Indeed.
>
> >
> >Remove it.
> >
> >Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
>
> Reviewed-by: Bernhard Beschow <shentey@gmail.com>
Thanks!
> I'm curious: How do you detect such unused code?
I've got a very hacky script that looks for symbols that
are defined but nothing else uses; it generates a lot of
false positives so takes a lot of handholding to find
real cases.
See: https://lore.kernel.org/lkml/ZugliLgw5VFb9yau@gallifrey/
Dave
> >---
> > hw/pci-host/q35.c | 10 ----------
> > include/hw/pci-host/q35.h | 2 --
> > 2 files changed, 12 deletions(-)
> >
> >diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
> >index d5a657a02a..f3e713318e 100644
> >--- a/hw/pci-host/q35.c
> >+++ b/hw/pci-host/q35.c
> >@@ -662,16 +662,6 @@ static void mch_realize(PCIDevice *d, Error **errp)
> > OBJECT(&mch->smram));
> > }
> >
> >-uint64_t mch_mcfg_base(void)
> >-{
> >- bool ambiguous;
> >- Object *o = object_resolve_path_type("", TYPE_MCH_PCI_DEVICE, &ambiguous);
> >- if (!o) {
> >- return 0;
> >- }
> >- return MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT;
> >-}
> >-
> > static Property mch_props[] = {
> > DEFINE_PROP_UINT16("extended-tseg-mbytes", MCHPCIState, ext_tseg_mbytes,
> > 16),
> >diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h
> >index 22fadfa3ed..ddafc3f2e3 100644
> >--- a/include/hw/pci-host/q35.h
> >+++ b/include/hw/pci-host/q35.h
> >@@ -181,8 +181,6 @@ struct Q35PCIHost {
> > #define MCH_PCIE_DEV 1
> > #define MCH_PCIE_FUNC 0
> >
> >-uint64_t mch_mcfg_base(void);
> >-
> > /*
> > * Arbitrary but unique BNF number for IOAPIC device.
> > *
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ dave @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] q35: Remove unused mch_mcfg_base
2024-09-18 0:51 [PATCH] q35: Remove unused mch_mcfg_base dave
2024-09-19 18:28 ` Bernhard Beschow
@ 2024-10-02 10:28 ` Thomas Huth
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2024-10-02 10:28 UTC (permalink / raw)
To: dave, mst, marcel.apfelbaum, qemu-devel, QEMU Trivial
On 18/09/2024 02.51, dave@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <dave@treblig.org>
>
> mch_mcfg_base has been unused since it was added by
> 6f1426ab0f ("ich9: APIs for pc guest info")
> back in 2013.
>
> Remove it.
>
> Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
> ---
> hw/pci-host/q35.c | 10 ----------
> include/hw/pci-host/q35.h | 2 --
> 2 files changed, 12 deletions(-)
>
> diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
> index d5a657a02a..f3e713318e 100644
> --- a/hw/pci-host/q35.c
> +++ b/hw/pci-host/q35.c
> @@ -662,16 +662,6 @@ static void mch_realize(PCIDevice *d, Error **errp)
> OBJECT(&mch->smram));
> }
>
> -uint64_t mch_mcfg_base(void)
> -{
> - bool ambiguous;
> - Object *o = object_resolve_path_type("", TYPE_MCH_PCI_DEVICE, &ambiguous);
> - if (!o) {
> - return 0;
> - }
> - return MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT;
> -}
> -
> static Property mch_props[] = {
> DEFINE_PROP_UINT16("extended-tseg-mbytes", MCHPCIState, ext_tseg_mbytes,
> 16),
> diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h
> index 22fadfa3ed..ddafc3f2e3 100644
> --- a/include/hw/pci-host/q35.h
> +++ b/include/hw/pci-host/q35.h
> @@ -181,8 +181,6 @@ struct Q35PCIHost {
> #define MCH_PCIE_DEV 1
> #define MCH_PCIE_FUNC 0
>
> -uint64_t mch_mcfg_base(void);
> -
> /*
> * Arbitrary but unique BNF number for IOAPIC device.
> *
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-02 10:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-18 0:51 [PATCH] q35: Remove unused mch_mcfg_base dave
2024-09-19 18:28 ` Bernhard Beschow
2024-09-19 19:53 ` Dr. David Alan Gilbert
2024-10-02 10:28 ` Thomas Huth
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).