PCI/VPD: Remove pci_vpd_find_tag() 'offset' argument
authorHeiner Kallweit <hkallweit1@gmail.com>
Thu, 1 Apr 2021 16:43:15 +0000 (18:43 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 30 Apr 2021 19:38:32 +0000 (14:38 -0500)
All callers pass 0 as offset. Therefore remove the parameter and use a
fixed offset 0 in pci_vpd_find_tag().

Link: https://lore.kernel.org/r/f62e6e19-5423-2ead-b2bd-62844b23ef8f@gmail.com
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/net/ethernet/broadcom/bnx2.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/tg3.c
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
drivers/net/ethernet/sfc/efx.c
drivers/net/ethernet/sfc/falcon/efx.c
drivers/pci/vpd.c
drivers/scsi/cxlflash/main.c
include/linux/pci.h

index 3e8a179f39db48c8d7f92ab34703636ac5b07d1d..c0986096c701d368952ae3a8148e0a045ed89be1 100644 (file)
@@ -8057,7 +8057,7 @@ bnx2_read_vpd_fw_ver(struct bnx2 *bp)
                data[i + 3] = data[i + BNX2_VPD_LEN];
        }
 
-       i = pci_vpd_find_tag(data, 0, BNX2_VPD_LEN, PCI_VPD_LRDT_RO_DATA);
+       i = pci_vpd_find_tag(data, BNX2_VPD_LEN, PCI_VPD_LRDT_RO_DATA);
        if (i < 0)
                goto vpd_done;
 
index b652ed72a621a30f1edea2a956704f978f531289..d267e45a0518992c7f1811694ec0f8d149736114 100644 (file)
@@ -12207,8 +12207,7 @@ static void bnx2x_read_fwinfo(struct bnx2x *bp)
        /* VPD RO tag should be first tag after identifier string, hence
         * we should be able to find it in first BNX2X_VPD_LEN chars
         */
-       i = pci_vpd_find_tag(vpd_start, 0, BNX2X_VPD_LEN,
-                            PCI_VPD_LRDT_RO_DATA);
+       i = pci_vpd_find_tag(vpd_start, BNX2X_VPD_LEN, PCI_VPD_LRDT_RO_DATA);
        if (i < 0)
                goto out_not_found;
 
index a680fd9c68ea909c8e4a0618123010a615014907..2bccdac28a24fe9be3b804aafd831c5dac61852a 100644 (file)
@@ -12668,7 +12668,7 @@ static void bnxt_vpd_read_info(struct bnxt *bp)
                goto exit;
        }
 
-       i = pci_vpd_find_tag(vpd_data, 0, vpd_size, PCI_VPD_LRDT_RO_DATA);
+       i = pci_vpd_find_tag(vpd_data, vpd_size, PCI_VPD_LRDT_RO_DATA);
        if (i < 0) {
                netdev_err(bp->dev, "VPD READ-Only not found\n");
                goto exit;
index d2381929931b6336605c47e80f427b40326df321..b0e49643f483210b961b00a5022b72357fda74e5 100644 (file)
@@ -13016,7 +13016,7 @@ static int tg3_test_nvram(struct tg3 *tp)
        if (!buf)
                return -ENOMEM;
 
-       i = pci_vpd_find_tag((u8 *)buf, 0, len, PCI_VPD_LRDT_RO_DATA);
+       i = pci_vpd_find_tag((u8 *)buf, len, PCI_VPD_LRDT_RO_DATA);
        if (i > 0) {
                j = pci_vpd_lrdt_size(&((u8 *)buf)[i]);
                if (j < 0)
@@ -15629,7 +15629,7 @@ static void tg3_read_vpd(struct tg3 *tp)
        if (!vpd_data)
                goto out_no_vpd;
 
-       i = pci_vpd_find_tag(vpd_data, 0, vpdlen, PCI_VPD_LRDT_RO_DATA);
+       i = pci_vpd_find_tag(vpd_data, vpdlen, PCI_VPD_LRDT_RO_DATA);
        if (i < 0)
                goto out_not_found;
 
index 98829e482bfa95f15b464122906a1a2201c32357..ef5d10e1cce6e2692e996860cab3b665c999bd06 100644 (file)
@@ -2774,7 +2774,7 @@ int t4_get_raw_vpd_params(struct adapter *adapter, struct vpd_params *p)
        if (id_len > ID_LEN)
                id_len = ID_LEN;
 
-       i = pci_vpd_find_tag(vpd, 0, VPD_LEN, PCI_VPD_LRDT_RO_DATA);
+       i = pci_vpd_find_tag(vpd, VPD_LEN, PCI_VPD_LRDT_RO_DATA);
        if (i < 0) {
                dev_err(adapter->pdev_dev, "missing VPD-R section\n");
                ret = -EINVAL;
index 36c8625a6fd7259642284aa465a4e7fdecee708d..c746ca7235f1cb18a863b6334ba1a7f95fff589c 100644 (file)
@@ -920,7 +920,7 @@ static void efx_probe_vpd_strings(struct efx_nic *efx)
        }
 
        /* Get the Read only section */
-       ro_start = pci_vpd_find_tag(vpd_data, 0, vpd_size, PCI_VPD_LRDT_RO_DATA);
+       ro_start = pci_vpd_find_tag(vpd_data, vpd_size, PCI_VPD_LRDT_RO_DATA);
        if (ro_start < 0) {
                netif_err(efx, drv, efx->net_dev, "VPD Read-only not found\n");
                return;
index f8979991970ef828976e24f14170addabf21d565..5e7a57b680cabb6f15293544c9e59f6845b74625 100644 (file)
@@ -2800,7 +2800,7 @@ static void ef4_probe_vpd_strings(struct ef4_nic *efx)
        }
 
        /* Get the Read only section */
-       ro_start = pci_vpd_find_tag(vpd_data, 0, vpd_size, PCI_VPD_LRDT_RO_DATA);
+       ro_start = pci_vpd_find_tag(vpd_data, vpd_size, PCI_VPD_LRDT_RO_DATA);
        if (ro_start < 0) {
                netif_err(efx, drv, efx->net_dev, "VPD Read-only not found\n");
                return;
index c1c4f7d80a048ee363def4bf9e4e9cc8e8e48753..79d4313c91a304b2af3dfaccdf4aa01537fdf662 100644 (file)
@@ -410,11 +410,11 @@ void pcie_vpd_remove_sysfs_dev_files(struct pci_dev *dev)
        }
 }
 
-int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt)
+int pci_vpd_find_tag(const u8 *buf, unsigned int len, u8 rdt)
 {
        int i;
 
-       for (i = off; i < len; ) {
+       for (i = 0; i < len; ) {
                u8 val = buf[i];
 
                if (val & PCI_VPD_LRDT) {
index e72440d919d2aab61657ac7e27873c576a0b18e7..ae0963cec2228069a7a2809e474e50e0d3564d90 100644 (file)
@@ -1649,8 +1649,7 @@ static int read_vpd(struct cxlflash_cfg *cfg, u64 wwpn[])
        }
 
        /* Get the read only section offset */
-       ro_start = pci_vpd_find_tag(vpd_data, 0, vpd_size,
-                                   PCI_VPD_LRDT_RO_DATA);
+       ro_start = pci_vpd_find_tag(vpd_data, vpd_size, PCI_VPD_LRDT_RO_DATA);
        if (unlikely(ro_start < 0)) {
                dev_err(dev, "%s: VPD Read-only data not found\n", __func__);
                rc = -ENODEV;
index edadc62ae058896fefa195e878c1a38015c83d34..1eb35c09674e83fce26870eb7782f17d2a62e9b8 100644 (file)
@@ -2310,14 +2310,13 @@ static inline u8 pci_vpd_info_field_size(const u8 *info_field)
 /**
  * pci_vpd_find_tag - Locates the Resource Data Type tag provided
  * @buf: Pointer to buffered vpd data
- * @off: The offset into the buffer at which to begin the search
  * @len: The length of the vpd buffer
  * @rdt: The Resource Data Type to search for
  *
  * Returns the index where the Resource Data Type was found or
  * -ENOENT otherwise.
  */
-int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt);
+int pci_vpd_find_tag(const u8 *buf, unsigned int len, u8 rdt);
 
 /**
  * pci_vpd_find_info_keyword - Locates an information field keyword in the VPD