summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2021-02-03 11:48:03 +0300
committerBjorn Helgaas <bhelgaas@google.com>2021-03-31 00:50:42 +0300
commit26c0cf2a603d4ebf00d8c1baf714763fca31dba4 (patch)
treef2d916e1170f9f92e2774c66a7d02d56151cda4f
parenta7bf66ff3d945db9dd2079265ce9cc5c374cecc3 (diff)
downloadlinux-26c0cf2a603d4ebf00d8c1baf714763fca31dba4.tar.xz
PCI/VPD: Remove sysfs accessor size checking dead code
Since 104daa71b396 ("PCI: Determine actual VPD size on first access") attribute size is set to 0 (unlimited). Remove the dead code that checks for "bin_attr->size > 0". Link: https://lore.kernel.org/r/267eae86-f8a6-6792-a7f8-2c4fd51beedc@gmail.com Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Krzysztof WilczyƄski <kw@linux.com>
-rw-r--r--drivers/pci/vpd.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c
index ef5165eb3b62..ab81c7a5185f 100644
--- a/drivers/pci/vpd.c
+++ b/drivers/pci/vpd.c
@@ -403,13 +403,6 @@ static ssize_t read_vpd_attr(struct file *filp, struct kobject *kobj,
{
struct pci_dev *dev = to_pci_dev(kobj_to_dev(kobj));
- if (bin_attr->size > 0) {
- if (off > bin_attr->size)
- count = 0;
- else if (count > bin_attr->size - off)
- count = bin_attr->size - off;
- }
-
return pci_read_vpd(dev, off, count, buf);
}
@@ -419,13 +412,6 @@ static ssize_t write_vpd_attr(struct file *filp, struct kobject *kobj,
{
struct pci_dev *dev = to_pci_dev(kobj_to_dev(kobj));
- if (bin_attr->size > 0) {
- if (off > bin_attr->size)
- count = 0;
- else if (count > bin_attr->size - off)
- count = bin_attr->size - off;
- }
-
return pci_write_vpd(dev, off, count, buf);
}