Skip to content

Commit

Permalink
PCI: Remove unused pci_vpd_truncate()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Hemminger authored and Bjorn Helgaas committed Jan 13, 2014
1 parent 7c2dd2d commit 3984ca1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
24 changes: 0 additions & 24 deletions drivers/pci/access.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,30 +380,6 @@ int pci_vpd_pci22_init(struct pci_dev *dev)
return 0;
}

/**
* pci_vpd_truncate - Set available Vital Product Data size
* @dev: pci device struct
* @size: available memory in bytes
*
* Adjust size of available VPD area.
*/
int pci_vpd_truncate(struct pci_dev *dev, size_t size)
{
if (!dev->vpd)
return -EINVAL;

/* limited by the access method */
if (size > dev->vpd->len)
return -EINVAL;

dev->vpd->len = size;
if (dev->vpd->attr)
dev->vpd->attr->size = size;

return 0;
}
EXPORT_SYMBOL(pci_vpd_truncate);

/**
* pci_cfg_access_lock - Lock PCI config reads/writes
* @dev: pci device struct
Expand Down
1 change: 0 additions & 1 deletion include/linux/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,6 @@ unsigned int pci_rescan_bus(struct pci_bus *bus);
/* Vital product data routines */
ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf);
ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf);
int pci_vpd_truncate(struct pci_dev *dev, size_t size);

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

0 comments on commit 3984ca1

Please sign in to comment.