Commit 2075ec98 authored by Oliver O'Halloran's avatar Oliver O'Halloran Committed by Michael Ellerman

powerpc/powernv/sriov: Fix use of uninitialised variable

Initialising the value before using it is generally regarded as a good
idea so do that.

Fixes: 4c51f3e1 ("powerpc/powernv/sriov: Make single PE mode a per-BAR setting")
Reported-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Signed-off-by: default avatarOliver O'Halloran <oohall@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200803075408.132601-1-oohall@gmail.com
parent 872d11bc
...@@ -253,9 +253,9 @@ void pnv_pci_ioda_fixup_iov(struct pci_dev *pdev) ...@@ -253,9 +253,9 @@ void pnv_pci_ioda_fixup_iov(struct pci_dev *pdev)
resource_size_t pnv_pci_iov_resource_alignment(struct pci_dev *pdev, resource_size_t pnv_pci_iov_resource_alignment(struct pci_dev *pdev,
int resno) int resno)
{ {
resource_size_t align = pci_iov_resource_size(pdev, resno);
struct pnv_phb *phb = pci_bus_to_pnvhb(pdev->bus); struct pnv_phb *phb = pci_bus_to_pnvhb(pdev->bus);
struct pnv_iov_data *iov = pnv_iov_get(pdev); struct pnv_iov_data *iov = pnv_iov_get(pdev);
resource_size_t align;
/* /*
* iov can be null if we have an SR-IOV device with IOV BAR that can't * iov can be null if we have an SR-IOV device with IOV BAR that can't
...@@ -266,8 +266,6 @@ resource_size_t pnv_pci_iov_resource_alignment(struct pci_dev *pdev, ...@@ -266,8 +266,6 @@ resource_size_t pnv_pci_iov_resource_alignment(struct pci_dev *pdev,
if (!iov) if (!iov)
return align; return align;
align = pci_iov_resource_size(pdev, resno);
/* /*
* If we're using single mode then we can just use the native VF BAR * If we're using single mode then we can just use the native VF BAR
* alignment. We validated that it's possible to use a single PE * alignment. We validated that it's possible to use a single PE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment