PCI: endpoint: remove redundant initialization of pointer dev
Subsystems (3)
PATCH 1/1 PCI: endpoint: remove redundant initialization of pointer dev
From: Colin Ian King <[email protected]>
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")
--- drivers/pci/endpoint/pci-epf-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/endpoint/pci-epf-core.c +1 -1
@@ -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;
Signature · 1 line
2.30.2
Hi Colin,
Quoted 3 lines
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.
[...]
drivers/pci/endpoint/pci-epf-core.c EXPORT_SYMBOL_GPL(pci_epf_bind); · line 118
Quoted 4 lines
drivers/pci/endpoint/pci-epf-core.c +1
-1-struct device *dev = epf->epc->dev.parent; +struct device *dev;struct pci_epf_bar *epf_bar;struct pci_epc *epc;
Thank you!
Krzysztof
Lorenzo Pieralisi
AppliedQuoted 3 lines · Colin King
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