diff mbox series

PCI: endpoint: remove redundant initialization of pointer dev

Message ID 20210326190909.622369-1-colin.king@canonical.com
State New
Headers show
Series PCI: endpoint: remove redundant initialization of pointer dev | expand

Commit Message

Colin Ian King March 26, 2021, 7:09 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The pointer dev is being initialized with a value that is
never read and it is being updated later with a new value.  The
initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/pci/endpoint/pci-epf-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Krzysztof Wilczy��ski March 26, 2021, 10:15 p.m. UTC | #1
Hi Colin,

> The pointer dev is being initialized with a value that is
> never read and it is being updated later with a new value.  The
> initialization is redundant and can be removed.
[...]
> -	struct device *dev = epf->epc->dev.parent;
> +	struct device *dev;
>  	struct pci_epf_bar *epf_bar;
>  	struct pci_epc *epc;

Thank you!

Reviewed-by: Krzysztof Wilczyński <kw@linux.com>

Krzysztof
Lorenzo Pieralisi April 13, 2021, 10:41 a.m. UTC | #2
On Fri, 26 Mar 2021 19:09:09 +0000, Colin King wrote:
> The pointer dev is being initialized with a value that is
> never read and it is being updated later with a new value.  The
> initialization is redundant and can be removed.

Applied to pci/endpoint, thanks!

[1/1] PCI: endpoint: Remove redundant initialization of pointer dev
      https://git.kernel.org/lpieralisi/pci/c/80c253bd7f

Thanks,
Lorenzo
diff mbox series

Patch

diff --git a/drivers/pci/endpoint/pci-epf-core.c b/drivers/pci/endpoint/pci-epf-core.c
index 7646c8660d42..e9289d10f822 100644
--- a/drivers/pci/endpoint/pci-epf-core.c
+++ b/drivers/pci/endpoint/pci-epf-core.c
@@ -113,7 +113,7 @@  EXPORT_SYMBOL_GPL(pci_epf_bind);
 void pci_epf_free_space(struct pci_epf *epf, void *addr, enum pci_barno bar,
 			enum pci_epc_interface_type type)
 {
-	struct device *dev = epf->epc->dev.parent;
+	struct device *dev;
 	struct pci_epf_bar *epf_bar;
 	struct pci_epc *epc;