linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] ARM: imx legacy: cleanups
@ 2019-04-13  7:14 Nicholas Mc Guire
  2019-04-13  7:14 ` [PATCH 0/3] ARM: hisi: fix of_iomap errors Nicholas Mc Guire
                   ` (14 more replies)
  0 siblings, 15 replies; 22+ messages in thread
From: Nicholas Mc Guire @ 2019-04-13  7:14 UTC (permalink / raw)
  To: Russell King
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Mark Brown, Linus Walleij, Tony Lindgren,
	Mike Rapoport, Janusz Krzysztofik, linux-arm-kernel,
	linux-kernel, Nicholas Mc Guire

While preparing a proposed fix for a missing check on zmalloc a few
other checkpatch warnings poped up - this little set fixes those
warnings. There is one remaining checkpatch warning but that looks
like a false-positive to me:

ERROR: Use of __initconst requires a separate use of const
#171: FILE: arch/arm/mach-imx/mach-mx27ads.c:171:
+mx27ads_nand_board_info __initconst = {

The false positive seems due to the definition spanning two lines
anyway looks good to me

<snip>
static const struct mxc_nand_platform_data
mx27ads_nand_board_info __initconst = {
        .width = 1,
        .hw_ecc = 1,
};
<snip>

thx!
hofrat

^ permalink raw reply	[flat|nested] 22+ messages in thread
* [PATCH V2] ARM: STi: warn if scu mapping fails
@ 2018-07-16 13:46 Nicholas Mc Guire
  2018-07-18  7:17 ` Patrice CHOTARD
  0 siblings, 1 reply; 22+ messages in thread
From: Nicholas Mc Guire @ 2018-07-16 13:46 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: Patrice Chotard, Russell King, linux-arm-kernel, linux-kernel,
	Nicholas Mc Guire

 If the device node is not found or the of_iomap() failed, calling
scu_enable would not be safe and could lead to an undefined system
state. So warn in both failure paths before returning.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Link: http://lkml.org/lkml/2018/7/16/219
Fixes: commit 65ebcc115889 ("ARM: sti: Add STiH415 SOC support")
---

V2: replacement of WARN_ON() by a meaningful pr_err as suggested by
    Patrice CHOTARD <patrice.chotard@st.com>.

Problem was found by an experimental coccinelle script

Patch was compile tested with: multi_v7_defconfig (implies
CONFIG_ARCH_STI=y, CONFIG_SMP=y)
(with one sparse warning unrelated to the proposed change)

Patch is against 4.18-rc4 (localversion-next is next-20180716)

 arch/arm/mach-sti/platsmp.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-sti/platsmp.c b/arch/arm/mach-sti/platsmp.c
index 231f19e..530e9a5 100644
--- a/arch/arm/mach-sti/platsmp.c
+++ b/arch/arm/mach-sti/platsmp.c
@@ -107,12 +107,22 @@ static void __init sti_smp_prepare_cpus(unsigned int max_cpus)
 
 	np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
 
-	if (np) {
-		scu_base = of_iomap(np, 0);
-		scu_enable(scu_base);
-		of_node_put(np);
+	if (!np) {
+		pr_err("SCU not found at %s:%s():%d\n",
+		       __FILE__, __func__, __LINE__);
+		return;
 	}
 
+	scu_base = of_iomap(np, 0);
+	of_node_put(np);
+	if (!scu_base) {
+		pr_err("SCU remap failed at %s:%s():%d\n",
+		       __FILE__, __func__, __LINE__);
+		return;
+	}
+
+	scu_enable(scu_base);
+
 	if (max_cpus <= 1)
 		return;
 
-- 
2.1.4


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

end of thread, other threads:[~2019-04-23 10:26 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-13  7:14 [PATCH 0/4] ARM: imx legacy: cleanups Nicholas Mc Guire
2019-04-13  7:14 ` [PATCH 0/3] ARM: hisi: fix of_iomap errors Nicholas Mc Guire
2019-04-13  7:14 ` [PATCH] ARM: add missing of_node_put() Nicholas Mc Guire
2019-04-13  7:14 ` [PATCH 1/3] ARM: hisi: fix error handling and missing of_node_put Nicholas Mc Guire
2019-04-13  7:14 ` [PATCH] ARM: imx: flag failure of of_iomap Nicholas Mc Guire
2019-04-13  7:14 ` [PATCH 1/4 RFC] ARM: imx legacy: warn on failed allocation Nicholas Mc Guire
2019-04-13  7:14 ` [PATCH] ARM: STi: at least warn if of_iomap fails Nicholas Mc Guire
2019-04-13  7:14 ` [PATCH V2] ARM: STi: warn if scu mapping fails Nicholas Mc Guire
2019-04-13  7:14 ` [PATCH] ARM: u300: add missing check for kmalloc Nicholas Mc Guire
2019-04-23 10:26   ` Linus Walleij
2019-04-13  7:14 ` [PATCH] ARM: ux500: add missing of_node_put() Nicholas Mc Guire
2019-04-15  9:52   ` Ulf Hansson
2019-04-16 11:49   ` Linus Walleij
2019-04-13  7:14 ` [PATCH 2/3] ARM: hisi: check of_iomap and fix missing of_node_put Nicholas Mc Guire
2019-04-16 16:09   ` [2/3] " Markus Elfring
2019-04-13  7:14 ` [PATCH 2/4] ARM: imx legacy: declare unsigned int rather than unsigned Nicholas Mc Guire
2019-04-13  7:14 ` [PATCH 3/3] ARM: hisi: handle of_iomap and fix missing of_node_put Nicholas Mc Guire
2019-04-13  7:14 ` [PATCH 3/4 RFC] ARM: imx legacy: wrap complex macro in () Nicholas Mc Guire
2019-04-13  7:14 ` [PATCH 4/4] ARM: imx legacy: add an SPDX license identifier Nicholas Mc Guire
2019-04-13  7:58 ` [PATCH 0/4] ARM: imx legacy: cleanups Joe Perches
  -- strict thread matches above, loose matches on Subject: below --
2018-07-16 13:46 [PATCH V2] ARM: STi: warn if scu mapping fails Nicholas Mc Guire
2018-07-18  7:17 ` Patrice CHOTARD

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