Skip to content

Commit 5dc07a2

Browse files
committed
Merge branch 'pci/misc'
- Check pcie_find_root_port() return in x86 fixups to avoid NULL pointer dereferences (Samasth Norway Ananda) - Make pci_bus_type constant (Kunwu Chan) - Remove unused declarations of __pci_pme_wakeup() and pci_vpd_release() (Yue Haibing) - Remove any leftover .*.cmd files with make clean (zhang jiao) * pci/misc: PCI: Fix typos PCI/VPD: Remove pci_vpd_release() unused declarations PCI/PM: Remove __pci_pme_wakeup() unused declarations PCI: Make pci_bus_type constant x86/PCI: Check pcie_find_root_port() return for NULL
2 parents ca5c656 + 5c7bdac commit 5dc07a2

File tree

9 files changed

+10
-12
lines changed

9 files changed

+10
-12
lines changed

arch/x86/pci/fixup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ static void amd_rp_pme_suspend(struct pci_dev *dev)
980980
return;
981981

982982
rp = pcie_find_root_port(dev);
983-
if (!rp->pm_cap)
983+
if (!rp || !rp->pm_cap)
984984
return;
985985

986986
rp->pme_support &= ~((PCI_PM_CAP_PME_D3hot|PCI_PM_CAP_PME_D3cold) >>
@@ -994,7 +994,7 @@ static void amd_rp_pme_resume(struct pci_dev *dev)
994994
u16 pmc;
995995

996996
rp = pcie_find_root_port(dev);
997-
if (!rp->pm_cap)
997+
if (!rp || !rp->pm_cap)
998998
return;
999999

10001000
pci_read_config_word(rp, rp->pm_cap + PCI_PM_PMC, &pmc);

drivers/pci/ats.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,8 @@ void pci_restore_pasid_state(struct pci_dev *pdev)
455455
* pci_pasid_features - Check which PASID features are supported
456456
* @pdev: PCI device structure
457457
*
458-
* Returns a negative value when no PASI capability is present.
459-
* Otherwise is returns a bitmask with supported features. Current
458+
* Return a negative value when no PASID capability is present.
459+
* Otherwise return a bitmask with supported features. Current
460460
* features reported are:
461461
* PCI_PASID_CAP_EXEC - Execute permission supported
462462
* PCI_PASID_CAP_PRIV - Privileged mode supported

drivers/pci/controller/cadence/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ config PCIE_CADENCE_PLAT_EP
3838
select PCIE_CADENCE_EP
3939
select PCIE_CADENCE_PLAT
4040
help
41-
Say Y here if you want to support the Cadence PCIe platform controller in
41+
Say Y here if you want to support the Cadence PCIe platform controller in
4242
endpoint mode. This PCIe controller may be embedded into many
4343
different vendors SoCs.
4444

drivers/pci/hotplug/cpqphp_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ get_slot_mapping(struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *slot)
328328
} else {
329329
/* Did not get a match on the target PCI device. Check
330330
* if the current IRQ table entry is a PCI-to-PCI
331-
* bridge device. If so, and it's secondary bus
331+
* bridge device. If so, and its secondary bus
332332
* matches the bus number for the target device, I need
333333
* to save the bridge's slot number. If I can not find
334334
* an entry for the target device, I will have to

drivers/pci/hotplug/s390_pci_hpc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
112112

113113
static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
114114
{
115-
/* if the slot exits it always contains a function */
115+
/* if the slot exists it always contains a function */
116116
*value = 1;
117117
return 0;
118118
}

drivers/pci/iomap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ EXPORT_SYMBOL_GPL(pci_iomap_wc);
156156
* the different IOMAP ranges.
157157
*
158158
* But if the architecture does not use the generic iomap code, and if
159-
* it has _not_ defined it's own private pci_iounmap function, we define
159+
* it has _not_ defined its own private pci_iounmap function, we define
160160
* it here.
161161
*
162162
* NOTE! This default implementation assumes that if the architecture

drivers/pci/pci-driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,7 @@ static void pci_dma_cleanup(struct device *dev)
16701670
iommu_device_unuse_default_domain(dev);
16711671
}
16721672

1673-
struct bus_type pci_bus_type = {
1673+
const struct bus_type pci_bus_type = {
16741674
.name = "pci",
16751675
.match = pci_bus_match,
16761676
.uevent = pci_uevent,

drivers/pci/pci.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ void pcie_clear_device_status(struct pci_dev *dev);
139139
void pcie_clear_root_pme_status(struct pci_dev *dev);
140140
bool pci_check_pme_status(struct pci_dev *dev);
141141
void pci_pme_wakeup_bus(struct pci_bus *bus);
142-
int __pci_pme_wakeup(struct pci_dev *dev, void *ign);
143142
void pci_pme_restore(struct pci_dev *dev);
144143
bool pci_dev_need_resume(struct pci_dev *dev);
145144
void pci_dev_adjust_pme(struct pci_dev *dev);
@@ -189,7 +188,6 @@ static inline bool pcie_downstream_port(const struct pci_dev *dev)
189188
}
190189

191190
void pci_vpd_init(struct pci_dev *dev);
192-
void pci_vpd_release(struct pci_dev *dev);
193191
extern const struct attribute_group pci_dev_vpd_attr_group;
194192

195193
/* PCI Virtual Channel */

include/linux/pci.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,7 @@ enum pcie_bus_config_types {
11021102

11031103
extern enum pcie_bus_config_types pcie_bus_config;
11041104

1105-
extern struct bus_type pci_bus_type;
1105+
extern const struct bus_type pci_bus_type;
11061106

11071107
/* Do NOT directly access these two variables, unless you are arch-specific PCI
11081108
* code, or PCI core code. */

0 commit comments

Comments
 (0)