linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: imx: flag failure of of_iomap
@ 2018-07-08  8:32 Nicholas Mc Guire
  2018-07-11 12:47 ` Shawn Guo
  0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Mc Guire @ 2018-07-08  8:32 UTC (permalink / raw)
  To: Steffen Trumtrar
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Russell King, linux-arm-kernel, linux-kernel,
	Nicholas Mc Guire

 imx_set_aips is assuming that the address returned from of_iomap is
valid which it probably is in the normal case - as the call site
is void error propagation is not possible but never the less at least
a WARN_ON() seems warranted here.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Fixes: commit e57e4ab5fc2e ("ARM: i.MX: allow disabling supervisor protect via DT")
---

Problem found by experimental coccinelle script

Patch was compiletested with: multi_v7_defconfig

Patch is against 4.18-rc3 (localversion-next is next-20180706)

 arch/arm/mach-imx/cpu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c
index 32969f3..c6b1bf9 100644
--- a/arch/arm/mach-imx/cpu.c
+++ b/arch/arm/mach-imx/cpu.c
@@ -68,6 +68,7 @@ void __init imx_aips_allow_unprivileged_access(
 
 	for_each_compatible_node(np, NULL, compat) {
 		aips_base_addr = of_iomap(np, 0);
+		WARN_ON(!aips_base_addr);
 		imx_set_aips(aips_base_addr);
 	}
 }
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [PATCH 0/4] ARM: imx legacy: cleanups
@ 2019-04-13  7:14 Nicholas Mc Guire
  2019-04-13  7:14 ` [PATCH] ARM: imx: flag failure of of_iomap Nicholas Mc Guire
  0 siblings, 1 reply; 3+ 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] 3+ messages in thread

end of thread, other threads:[~2019-04-13  7:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-08  8:32 [PATCH] ARM: imx: flag failure of of_iomap Nicholas Mc Guire
2018-07-11 12:47 ` Shawn Guo
2019-04-13  7:14 [PATCH 0/4] ARM: imx legacy: cleanups Nicholas Mc Guire
2019-04-13  7:14 ` [PATCH] ARM: imx: flag failure of of_iomap Nicholas Mc Guire

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