linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ARM-OMAP3: Fine-tuning for omap3xxx_hwmod_init()
@ 2017-10-20 15:15 SF Markus Elfring
  2017-10-20 15:16 ` [PATCH 1/2] ARM: OMAP3: Use common error handling code in omap3xxx_hwmod_init() SF Markus Elfring
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: SF Markus Elfring @ 2017-10-20 15:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 20 Oct 2017 17:08:09 +0200

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
  Use common error handling code
  Delete an unnecessary variable initialisation

 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

-- 
2.14.2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] ARM: OMAP3: Use common error handling code in omap3xxx_hwmod_init()
  2017-10-20 15:15 [PATCH 0/2] ARM-OMAP3: Fine-tuning for omap3xxx_hwmod_init() SF Markus Elfring
@ 2017-10-20 15:16 ` SF Markus Elfring
  2017-10-20 15:17 ` [PATCH 2/2] ARM: OMAP3: Delete an unnecessary variable initialisation " SF Markus Elfring
  2017-10-25 16:54 ` [PATCH 0/2] ARM-OMAP3: Fine-tuning for omap3xxx_hwmod_init() Tony Lindgren
  2 siblings, 0 replies; 4+ messages in thread
From: SF Markus Elfring @ 2017-10-20 15:16 UTC (permalink / raw)
  To: linux-arm-kernel

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 20 Oct 2017 16:30:23 +0200

Add a jump target 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/arm/mach-omap2/omap_hwmod_3xxx_data.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index c3276436b0ae..bb6eb1efb1b7 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -3208,18 +3208,14 @@ int __init omap3xxx_hwmod_init(void)
 
 	if (h_sham && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "sham")) {
 		r = omap_hwmod_register_links(h_sham);
-		if (r < 0) {
-			of_node_put(bus);
-			return r;
-		}
+		if (r < 0)
+			goto put_node;
 	}
 
 	if (h_aes && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "aes")) {
 		r = omap_hwmod_register_links(h_aes);
-		if (r < 0) {
-			of_node_put(bus);
-			return r;
-		}
+		if (r < 0)
+			goto put_node;
 	}
 	of_node_put(bus);
 
@@ -3270,4 +3266,8 @@ int __init omap3xxx_hwmod_init(void)
 	r = omap_hwmod_register_links(omap3xxx_dss_hwmod_ocp_ifs);
 
 	return r;
+
+put_node:
+	of_node_put(bus);
+	return r;
 }
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ARM: OMAP3: Delete an unnecessary variable initialisation in omap3xxx_hwmod_init()
  2017-10-20 15:15 [PATCH 0/2] ARM-OMAP3: Fine-tuning for omap3xxx_hwmod_init() SF Markus Elfring
  2017-10-20 15:16 ` [PATCH 1/2] ARM: OMAP3: Use common error handling code in omap3xxx_hwmod_init() SF Markus Elfring
@ 2017-10-20 15:17 ` SF Markus Elfring
  2017-10-25 16:54 ` [PATCH 0/2] ARM-OMAP3: Fine-tuning for omap3xxx_hwmod_init() Tony Lindgren
  2 siblings, 0 replies; 4+ messages in thread
From: SF Markus Elfring @ 2017-10-20 15:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 20 Oct 2017 16:37:07 +0200

The local variable "bus" will eventually be set to an appropriate pointer
a bit later. Thus omit the explicit initialisation at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index bb6eb1efb1b7..fd7db429e02b 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -3148,7 +3148,7 @@ int __init omap3xxx_hwmod_init(void)
 	int r;
 	struct omap_hwmod_ocp_if **h = NULL, **h_gp = NULL, **h_sham = NULL;
 	struct omap_hwmod_ocp_if **h_aes = NULL;
-	struct device_node *bus = NULL;
+	struct device_node *bus;
 	unsigned int rev;
 
 	omap_hwmod_init();
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 0/2] ARM-OMAP3: Fine-tuning for omap3xxx_hwmod_init()
  2017-10-20 15:15 [PATCH 0/2] ARM-OMAP3: Fine-tuning for omap3xxx_hwmod_init() SF Markus Elfring
  2017-10-20 15:16 ` [PATCH 1/2] ARM: OMAP3: Use common error handling code in omap3xxx_hwmod_init() SF Markus Elfring
  2017-10-20 15:17 ` [PATCH 2/2] ARM: OMAP3: Delete an unnecessary variable initialisation " SF Markus Elfring
@ 2017-10-25 16:54 ` Tony Lindgren
  2 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2017-10-25 16:54 UTC (permalink / raw)
  To: linux-arm-kernel

* SF Markus Elfring <elfring@users.sourceforge.net> [171020 08:17]:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 20 Oct 2017 17:08:09 +0200
> 
> Two update suggestions were taken into account
> from static source code analysis.

Thanks applying into omap-for-v4.15/coccinelle.

Regards,

Tony

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-25 16:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-20 15:15 [PATCH 0/2] ARM-OMAP3: Fine-tuning for omap3xxx_hwmod_init() SF Markus Elfring
2017-10-20 15:16 ` [PATCH 1/2] ARM: OMAP3: Use common error handling code in omap3xxx_hwmod_init() SF Markus Elfring
2017-10-20 15:17 ` [PATCH 2/2] ARM: OMAP3: Delete an unnecessary variable initialisation " SF Markus Elfring
2017-10-25 16:54 ` [PATCH 0/2] ARM-OMAP3: Fine-tuning for omap3xxx_hwmod_init() Tony Lindgren

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).