Skip to content

Commit 3984ca1

Browse files
shemmingerbjorn-helgaas
authored andcommitted
PCI: Remove unused pci_vpd_truncate()
My philosophy is unused code is dead code. And dead code is subject to bit rot and is a likely source of bugs. Use it or lose it. This reverts db56794 ("PCI: add interface to set visible size of VPD"), removing this interface: pci_vpd_truncate() [bhelgaas: split to separate patch, also remove prototype from pci.h] Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent 7c2dd2d commit 3984ca1

2 files changed

Lines changed: 0 additions & 25 deletions

File tree

‎drivers/pci/access.c‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -380,30 +380,6 @@ int pci_vpd_pci22_init(struct pci_dev *dev)
380380
return 0;
381381
}
382382

383-
/**
384-
* pci_vpd_truncate - Set available Vital Product Data size
385-
* @dev: pci device struct
386-
* @size: available memory in bytes
387-
*
388-
* Adjust size of available VPD area.
389-
*/
390-
int pci_vpd_truncate(struct pci_dev *dev, size_t size)
391-
{
392-
if (!dev->vpd)
393-
return -EINVAL;
394-
395-
/* limited by the access method */
396-
if (size > dev->vpd->len)
397-
return -EINVAL;
398-
399-
dev->vpd->len = size;
400-
if (dev->vpd->attr)
401-
dev->vpd->attr->size = size;
402-
403-
return 0;
404-
}
405-
EXPORT_SYMBOL(pci_vpd_truncate);
406-
407383
/**
408384
* pci_cfg_access_lock - Lock PCI config reads/writes
409385
* @dev: pci device struct

‎include/linux/pci.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,6 @@ unsigned int pci_rescan_bus(struct pci_bus *bus);
10091009
/* Vital product data routines */
10101010
ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf);
10111011
ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf);
1012-
int pci_vpd_truncate(struct pci_dev *dev, size_t size);
10131012

10141013
/* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */
10151014
resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx);

0 commit comments

Comments
 (0)