* [PATCH] PCI: endpoint: remove redundant initialization of pointer dev
@ 2021-03-26 19:09 Colin King
2021-03-26 22:15 ` Krzysztof Wilczyński
2021-04-13 10:41 ` Lorenzo Pieralisi
0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2021-03-26 19:09 UTC (permalink / raw)
To: Kishon Vijay Abraham I, Lorenzo Pieralisi, Bjorn Helgaas, linux-pci
Cc: kernel-janitors, linux-kernel
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(-)
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;
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] PCI: endpoint: remove redundant initialization of pointer dev
2021-03-26 19:09 [PATCH] PCI: endpoint: remove redundant initialization of pointer dev Colin King
@ 2021-03-26 22:15 ` Krzysztof Wilczyński
2021-04-13 10:41 ` Lorenzo Pieralisi
1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Wilczyński @ 2021-03-26 22:15 UTC (permalink / raw)
To: Colin King
Cc: Kishon Vijay Abraham I, Lorenzo Pieralisi, Bjorn Helgaas,
linux-pci, kernel-janitors, linux-kernel
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] PCI: endpoint: remove redundant initialization of pointer dev
2021-03-26 19:09 [PATCH] PCI: endpoint: remove redundant initialization of pointer dev Colin King
2021-03-26 22:15 ` Krzysztof Wilczyński
@ 2021-04-13 10:41 ` Lorenzo Pieralisi
1 sibling, 0 replies; 3+ messages in thread
From: Lorenzo Pieralisi @ 2021-04-13 10:41 UTC (permalink / raw)
To: Colin King, linux-pci, Bjorn Helgaas, Kishon Vijay Abraham I
Cc: Lorenzo Pieralisi, kernel-janitors, linux-kernel
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-04-13 10:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26 19:09 [PATCH] PCI: endpoint: remove redundant initialization of pointer dev Colin King
2021-03-26 22:15 ` Krzysztof Wilczyński
2021-04-13 10:41 ` Lorenzo Pieralisi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.