Skip to content

Commit f4cb410

Browse files
Cao jinawilliam
authored andcommitted
vfio/pci: Drop unnecessary pcibios_err_to_errno()
As of commit d97ffe2 ("PCI: Fix return value from pci_user_{read,write}_config_*()") it's unnecessary to call pcibios_err_to_errno() to fixup the return value from these functions. pcibios_err_to_errno() already does simple passthrough of -errno values, therefore no functional change is expected. [aw: changelog] Signed-off-by: Cao jin <[email protected]> Signed-off-by: Alex Williamson <[email protected]>
1 parent 5188287 commit f4cb410

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/vfio/pci/vfio_pci_config.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ static int vfio_user_config_read(struct pci_dev *pdev, int offset,
152152

153153
*val = cpu_to_le32(tmp_val);
154154

155-
return pcibios_err_to_errno(ret);
155+
return ret;
156156
}
157157

158158
static int vfio_user_config_write(struct pci_dev *pdev, int offset,
@@ -173,7 +173,7 @@ static int vfio_user_config_write(struct pci_dev *pdev, int offset,
173173
break;
174174
}
175175

176-
return pcibios_err_to_errno(ret);
176+
return ret;
177177
}
178178

179179
static int vfio_default_config_read(struct vfio_pci_device *vdev, int pos,
@@ -257,7 +257,7 @@ static int vfio_direct_config_read(struct vfio_pci_device *vdev, int pos,
257257

258258
ret = vfio_user_config_read(vdev->pdev, pos, val, count);
259259
if (ret)
260-
return pcibios_err_to_errno(ret);
260+
return ret;
261261

262262
if (pos >= PCI_CFG_SPACE_SIZE) { /* Extended cap header mangling */
263263
if (offset < 4)
@@ -295,7 +295,7 @@ static int vfio_raw_config_read(struct vfio_pci_device *vdev, int pos,
295295

296296
ret = vfio_user_config_read(vdev->pdev, pos, val, count);
297297
if (ret)
298-
return pcibios_err_to_errno(ret);
298+
return ret;
299299

300300
return count;
301301
}
@@ -1089,7 +1089,7 @@ static int vfio_msi_config_write(struct vfio_pci_device *vdev, int pos,
10891089
start + PCI_MSI_FLAGS,
10901090
flags);
10911091
if (ret)
1092-
return pcibios_err_to_errno(ret);
1092+
return ret;
10931093
}
10941094

10951095
return count;

0 commit comments

Comments
 (0)