* [PATCH 0/2] powerpc/82xx: Adjustments for pq2ads_pci_init_irq()
@ 2019-08-27 8:23 Markus Elfring
2019-08-27 8:26 ` [PATCH 1/2] powerpc/82xx: Delete an unnecessary of_node_put() call in pq2ads_pci_init_irq() Markus Elfring
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Markus Elfring @ 2019-08-27 8:23 UTC (permalink / raw)
To: linuxppc-dev, Benjamin Herrenschmidt, Greg Kroah-Hartman,
Enrico Weigelt, Kate Stewart, Michael Ellerman, Paul Mackerras,
Thomas Gleixner
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 27 Aug 2019 10:16:32 +0200
Two update suggestions were taken into account
from static source code analysis.
Markus Elfring (2):
Delete an unnecessary of_node_put() call
Use common error handling code
arch/powerpc/platforms/82xx/pq2ads-pci-pic.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
--
2.23.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] powerpc/82xx: Delete an unnecessary of_node_put() call in pq2ads_pci_init_irq()
2019-08-27 8:23 [PATCH 0/2] powerpc/82xx: Adjustments for pq2ads_pci_init_irq() Markus Elfring
@ 2019-08-27 8:26 ` Markus Elfring
2019-08-27 8:28 ` [PATCH 2/2] powerpc/82xx: Use common error handling code " Markus Elfring
2021-02-03 11:40 ` [PATCH 0/2] powerpc/82xx: Adjustments for pq2ads_pci_init_irq() Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2019-08-27 8:26 UTC (permalink / raw)
To: linuxppc-dev, Benjamin Herrenschmidt, Greg Kroah-Hartman,
Enrico Weigelt, Kate Stewart, Michael Ellerman, Paul Mackerras,
Thomas Gleixner
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 27 Aug 2019 08:44:20 +0200
A null pointer would be passed to a call of the function “of_node_put”
immediately after a call of the function “of_find_compatible_node” failed
at one place.
Remove this superfluous function call.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
arch/powerpc/platforms/82xx/pq2ads-pci-pic.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
index 096cc0d59fd8..6cc054db7043 100644
--- a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
+++ b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
@@ -123,7 +123,6 @@ int __init pq2ads_pci_init_irq(void)
np = of_find_compatible_node(NULL, NULL, "fsl,pq2ads-pci-pic");
if (!np) {
printk(KERN_ERR "No pci pic node in device tree.\n");
- of_node_put(np);
goto out;
}
--
2.23.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] powerpc/82xx: Use common error handling code in pq2ads_pci_init_irq()
2019-08-27 8:23 [PATCH 0/2] powerpc/82xx: Adjustments for pq2ads_pci_init_irq() Markus Elfring
2019-08-27 8:26 ` [PATCH 1/2] powerpc/82xx: Delete an unnecessary of_node_put() call in pq2ads_pci_init_irq() Markus Elfring
@ 2019-08-27 8:28 ` Markus Elfring
2021-02-03 11:40 ` [PATCH 0/2] powerpc/82xx: Adjustments for pq2ads_pci_init_irq() Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2019-08-27 8:28 UTC (permalink / raw)
To: linuxppc-dev, Benjamin Herrenschmidt, Greg Kroah-Hartman,
Enrico Weigelt, Kate Stewart, Michael Ellerman, Paul Mackerras,
Thomas Gleixner
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 27 Aug 2019 09:19:32 +0200
Adjust jump targets so that a bit of exception handling can be better
reused at the end of this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
arch/powerpc/platforms/82xx/pq2ads-pci-pic.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
index 6cc054db7043..f82f75a6085c 100644
--- a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
+++ b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
@@ -129,13 +129,11 @@ int __init pq2ads_pci_init_irq(void)
irq = irq_of_parse_and_map(np, 0);
if (!irq) {
printk(KERN_ERR "No interrupt in pci pic node.\n");
- of_node_put(np);
- goto out;
+ goto out_put_node;
}
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv) {
- of_node_put(np);
ret = -ENOMEM;
goto out_unmap_irq;
}
@@ -160,17 +158,17 @@ int __init pq2ads_pci_init_irq(void)
priv->host = host;
irq_set_handler_data(irq, priv);
irq_set_chained_handler(irq, pq2ads_pci_irq_demux);
-
- of_node_put(np);
- return 0;
+ ret = 0;
+ goto out_put_node;
out_unmap_regs:
iounmap(priv->regs);
out_free_kmalloc:
kfree(priv);
- of_node_put(np);
out_unmap_irq:
irq_dispose_mapping(irq);
+out_put_node:
+ of_node_put(np);
out:
return ret;
}
--
2.23.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] powerpc/82xx: Adjustments for pq2ads_pci_init_irq()
2019-08-27 8:23 [PATCH 0/2] powerpc/82xx: Adjustments for pq2ads_pci_init_irq() Markus Elfring
2019-08-27 8:26 ` [PATCH 1/2] powerpc/82xx: Delete an unnecessary of_node_put() call in pq2ads_pci_init_irq() Markus Elfring
2019-08-27 8:28 ` [PATCH 2/2] powerpc/82xx: Use common error handling code " Markus Elfring
@ 2021-02-03 11:40 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2021-02-03 11:40 UTC (permalink / raw)
To: linuxppc-dev, Benjamin Herrenschmidt, Kate Stewart,
Thomas Gleixner, Michael Ellerman, Markus Elfring,
Greg Kroah-Hartman, Paul Mackerras, Enrico Weigelt
Cc: LKML, kernel-janitors
On Tue, 27 Aug 2019 10:23:29 +0200, Markus Elfring wrote:
> Two update suggestions were taken into account
> from static source code analysis.
>
> Markus Elfring (2):
> Delete an unnecessary of_node_put() call
> Use common error handling code
>
> [...]
Applied to powerpc/next.
[1/2] powerpc/82xx: Delete an unnecessary of_node_put() call in pq2ads_pci_init_irq()
https://git.kernel.org/powerpc/c/60aece416483fdf7e51728a3518438e0458bdabb
[2/2] powerpc/82xx: Use common error handling code in pq2ads_pci_init_irq()
https://git.kernel.org/powerpc/c/c0cff7a17781f8b02b4837a9fc434a7eed322a14
cheers
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-02-03 11:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-27 8:23 [PATCH 0/2] powerpc/82xx: Adjustments for pq2ads_pci_init_irq() Markus Elfring
2019-08-27 8:26 ` [PATCH 1/2] powerpc/82xx: Delete an unnecessary of_node_put() call in pq2ads_pci_init_irq() Markus Elfring
2019-08-27 8:28 ` [PATCH 2/2] powerpc/82xx: Use common error handling code " Markus Elfring
2021-02-03 11:40 ` [PATCH 0/2] powerpc/82xx: Adjustments for pq2ads_pci_init_irq() Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).