Skip to contentSkip to conversation

PCI: hv: Remove unused field pci_bus in struct hv_pcibus_device

PATCH In review [email protected] 7 participants 9 messages Jan 11 – Feb 4

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: hv: Remove unused field pci_bus in struct hv_pcibus_device

From: Michael Kelley <[email protected]>

Field pci_bus in struct hv_pcibus_device is unused since commit 418cb6c8e051 ("PCI: hv: Generify PCI probing"). Remove it.

No functional change.

---
 drivers/pci/controller/pci-hyperv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/pci/controller/pci-hyperv.c +0 -1
index 1e237d3538f9..7fcba05cec30 100644
@@ -501,7 +501,6 @@ struct hv_pcibus_device {
 	struct resource *low_mmio_res;
 	struct resource *high_mmio_res;
 	struct completion *survey_event;
-	struct pci_bus *pci_bus;
 	spinlock_t config_lock;	/* Avoid two threads writing index page */
 	spinlock_t device_list_lock;	/* Protect lists below */
 	void __iomem *cfg_addr;
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Michael,

Quoted 5 lines · On Sun, Jan 11, 2026 at 09:00:34AM -0800, [email protected] wrote:

From: Michael Kelley <[email protected]>

Field pci_bus in struct hv_pcibus_device is unused since commit 418cb6c8e051 ("PCI: hv: Generify PCI probing"). Remove it.

Since that commit is several years old (2021), I was curious if this was found by manual inspection or if the compiler was able to flag the unused variable as well.

Quoted 3 lines

No functional change.

Regards,
Srivatsa
Microsoft Linux Systems Group

Quoted 20 lines
---
 drivers/pci/controller/pci-hyperv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/pci/controller/pci-hyperv.c +0 -1
index 1e237d3538f9..7fcba05cec30 100644
@@ -501,7 +501,6 @@ struct hv_pcibus_device {
 	struct resource *low_mmio_res;
 	struct resource *high_mmio_res;
 	struct completion *survey_event;
-	struct pci_bus *pci_bus;
 	spinlock_t config_lock;	/* Avoid two threads writing index page */
 	spinlock_t device_list_lock;	/* Protect lists below */
 	void __iomem *cfg_addr;
Signature · 1 line
2.25.1
#2 lore raw

From: Srivatsa S. Bhat <[email protected]> Sent: Monday, January 12, 2026 6:29 AM

Quoted 5 lines

Hi Michael,

Quoted 2 lines · On Sun, Jan 11, 2026 at 09:00:34AM -0800, [email protected] wrote:

From: Michael Kelley <[email protected]>

Quoted 7 lines
Quoted 3 lines

Field pci_bus in struct hv_pcibus_device is unused since commit 418cb6c8e051 ("PCI: hv: Generify PCI probing"). Remove it.

Since that commit is several years old (2021), I was curious if this was found by manual inspection or if the compiler was able to flag the unused variable as well.

Code inspection. I was brushing up on how the structs defined in pci-hyperv.c relate to the standard Linux PCI struct pci_bus and struct pci_dev. Having a pointer to struct pci_bus in struct hv_pcibus_device makes sense, and I was a bit surprised to find it's not set or used. Instead, the PCI bus is always found through the PCI bridge.

Michael

Quoted 31 lines
Quoted 4 lines

No functional change.

Regards,
Srivatsa
Microsoft Linux Systems Group

Quoted 20 lines
---
 drivers/pci/controller/pci-hyperv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/pci/controller/pci-hyperv.c +0 -2
index 1e237d3538f9..7fcba05cec30 100644
@@ -501,7 +501,6 @@ struct hv_pcibus_device {
 	struct resource *low_mmio_res;
 	struct resource *high_mmio_res;
 	struct completion *survey_event;
-	struct pci_bus *pci_bus;
 	spinlock_t config_lock;	/* Avoid two threads writing index page */
 	spinlock_t device_list_lock;	/* Protect lists below */
 	void __iomem *cfg_addr;
--

2.25.1

#3 lore raw
Quoted 14 lines · Michael Kelley

From: Srivatsa S. Bhat <[email protected]> Sent: Monday, January 12, 2026 6:29 AM

Quoted 5 lines

Hi Michael,

Quoted 2 lines · On Sun, Jan 11, 2026 at 09:00:34AM -0800, [email protected] wrote:

From: Michael Kelley <[email protected]>

Quoted 7 lines
Quoted 3 lines

Field pci_bus in struct hv_pcibus_device is unused since commit 418cb6c8e051 ("PCI: hv: Generify PCI probing"). Remove it.

Since that commit is several years old (2021), I was curious if this was found by manual inspection or if the compiler was able to flag the unused variable as well.

Quoted 7 lines

Code inspection. I was brushing up on how the structs defined in pci-hyperv.c relate to the standard Linux PCI struct pci_bus and struct pci_dev. Having a pointer to struct pci_bus in struct hv_pcibus_device makes sense, and I was a bit surprised to find it's not set or used. Instead, the PCI bus is always found through the PCI bridge.

Ah, I see, thank you for the background!

Regards,
Srivatsa

Quoted 32 lines
Quoted 32 lines
Quoted 5 lines

No functional change.

Regards,
Srivatsa
Microsoft Linux Systems Group

Quoted 20 lines
---
 drivers/pci/controller/pci-hyperv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/pci/controller/pci-hyperv.c +0 -2
index 1e237d3538f9..7fcba05cec30 100644
@@ -501,7 +501,6 @@ struct hv_pcibus_device {
 	struct resource *low_mmio_res;
 	struct resource *high_mmio_res;
 	struct completion *survey_event;
-	struct pci_bus *pci_bus;
 	spinlock_t config_lock;	/* Avoid two threads writing index page */
 	spinlock_t device_list_lock;	/* Protect lists below */
 	void __iomem *cfg_addr;
--

2.25.1

Reviewed-by on v1 1/1
#4 lore raw
In reply to [email protected]
Quoted 5 lines · On 1/11/2026 9:00 AM, [email protected] wrote:

From: Michael Kelley <[email protected]>

Field pci_bus in struct hv_pcibus_device is unused since commit 418cb6c8e051 ("PCI: hv: Generify PCI probing"). Remove it.

Quoted 7 lines

No functional change.

---
 drivers/pci/controller/pci-hyperv.c | 1 -
 1 file changed, 1 deletion(-)
#5 lore raw
In reply to [email protected]

From: [email protected] <[email protected]> Sent: Sunday, January 11, 2026 9:01 AM

Quoted 9 lines

From: Michael Kelley <[email protected]>

Field pci_bus in struct hv_pcibus_device is unused since commit 418cb6c8e051 ("PCI: hv: Generify PCI probing"). Remove it.

No functional change.

Could a PCI maintainer give an Ack for this trivial patch?

Thx, Michael

Quoted 19 lines
---
 drivers/pci/controller/pci-hyperv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/pci/controller/pci-hyperv.c +0 -2
index 1e237d3538f9..7fcba05cec30 100644
@@ -501,7 +501,6 @@ struct hv_pcibus_device {
 	struct resource *low_mmio_res;
 	struct resource *high_mmio_res;
 	struct completion *survey_event;
-	struct pci_bus *pci_bus;
 	spinlock_t config_lock;	/* Avoid two threads writing index page */
 	spinlock_t device_list_lock;	/* Protect lists below */
 	void __iomem *cfg_addr;
--

2.25.1

maintainer Acked-by
#6 lore raw
Quoted 4 lines · Michael Kelley

From: [email protected] <[email protected]> Sent: Sunday, January 11, 2026 9:01 AM

Quoted 3 lines

From: Michael Kelley <[email protected]>

Quoted 9 lines
Quoted 6 lines

Field pci_bus in struct hv_pcibus_device is unused since commit 418cb6c8e051 ("PCI: hv: Generify PCI probing"). Remove it.

No functional change.

Could a PCI maintainer give an Ack for this trivial patch?

I see this got queued by Wei Liu, but FWIW:

- Mani

Quoted 22 lines

Thx, Michael

Quoted 19 lines
---
 drivers/pci/controller/pci-hyperv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/pci/controller/pci-hyperv.c +0 -2
index 1e237d3538f9..7fcba05cec30 100644
@@ -501,7 +501,6 @@ struct hv_pcibus_device {
 	struct resource *low_mmio_res;
 	struct resource *high_mmio_res;
 	struct completion *survey_event;
-	struct pci_bus *pci_bus;
 	spinlock_t config_lock;	/* Avoid two threads writing index page */
 	spinlock_t device_list_lock;	/* Protect lists below */
 	void __iomem *cfg_addr;
--

2.25.1

Signature · 1 line
மணிவண்ணன் சதாசிவம்
Reviewed-by on v1 1/1
#7 lore raw
In reply to [email protected]
Quoted 17 lines · On 11-01-2026 22:30, [email protected] wrote:

From: Michael Kelley <[email protected]>

Field pci_bus in struct hv_pcibus_device is unused since commit 418cb6c8e051 ("PCI: hv: Generify PCI probing"). Remove it.

No functional change.

---
  drivers/pci/controller/pci-hyperv.c | 1 -
  1 file changed, 1 deletion(-)
drivers/pci/controller/pci-hyperv.c +0 -0
index 1e237d3538f9..7fcba05cec30 100644

drivers/pci/controller/pci-hyperv.c struct hv_pcibus_device { · line 506

Quoted 7 lines
drivers/pci/controller/pci-hyperv.c +0 -1
@@ -501,7 +501,6 @@ struct hv_pcibus_device {
  	struct resource *low_mmio_res;
  	struct resource *high_mmio_res;
  	struct completion *survey_event;
-	struct pci_bus *pci_bus;
  	spinlock_t config_lock;	/* Avoid two threads writing index page */
  	spinlock_t device_list_lock;	/* Protect lists below */
  	void __iomem *cfg_addr;

Regards,
Prasanna Kumar

maintainer
#8 lore raw
In reply to [email protected]
Quoted 8 lines · On Sun, Jan 11, 2026 at 09:00:34AM -0800, [email protected] wrote:

From: Michael Kelley <[email protected]>

Field pci_bus in struct hv_pcibus_device is unused since commit 418cb6c8e051 ("PCI: hv: Generify PCI probing"). Remove it.

No functional change.

It looks like this trivial patch is not yet picked up. I've queued it up.

Thanks,
Wei

Quoted 19 lines
---
 drivers/pci/controller/pci-hyperv.c | 1 -
 1 file changed, 1 deletion(-)
drivers/pci/controller/pci-hyperv.c +0 -1
index 1e237d3538f9..7fcba05cec30 100644
@@ -501,7 +501,6 @@ struct hv_pcibus_device {
 	struct resource *low_mmio_res;
 	struct resource *high_mmio_res;
 	struct completion *survey_event;
-	struct pci_bus *pci_bus;
 	spinlock_t config_lock;	/* Avoid two threads writing index page */
 	spinlock_t device_list_lock;	/* Protect lists below */
 	void __iomem *cfg_addr;
Signature · 1 line
2.25.1