linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drivers: clk: st: warn on iomap failure
@ 2018-07-15 10:18 Nicholas Mc Guire
  2018-07-15 10:18 ` [PATCH 2/2] drivers: clk: st: address sparse warnings Nicholas Mc Guire
  2018-07-25 20:41 ` [PATCH 1/2] drivers: clk: st: warn on iomap failure Stephen Boyd
  0 siblings, 2 replies; 6+ messages in thread
From: Nicholas Mc Guire @ 2018-07-15 10:18 UTC (permalink / raw)
  To: Michael Turquette
  Cc: Stephen Boyd, Kees Cook, linux-clk, linux-kernel,
	Nicholas Mc Guire

 While the return value of clkgen_get_register_base() is being checked
at the call site, there is no indication of failure cause thus making
diagnosis of the issues hard. The WARN_ON() allows to determine the
cause of failure.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

Problem found by an experimental coccinelle script

Patch was compile tested with: multi_v7_defconfig (implies
CONFIG_ARCH_STI=y)

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

 drivers/clk/st/clkgen-pll.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/st/clkgen-pll.c b/drivers/clk/st/clkgen-pll.c
index cbb5184..aeb30ab 100644
--- a/drivers/clk/st/clkgen-pll.c
+++ b/drivers/clk/st/clkgen-pll.c
@@ -647,6 +647,7 @@ static void __iomem * __init clkgen_get_register_base(
 		return NULL;
 
 	reg = of_iomap(pnode, 0);
+	WARN_ON(!reg);
 
 	of_node_put(pnode);
 	return reg;
-- 
2.1.4


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

end of thread, other threads:[~2018-07-26  5:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-15 10:18 [PATCH 1/2] drivers: clk: st: warn on iomap failure Nicholas Mc Guire
2018-07-15 10:18 ` [PATCH 2/2] drivers: clk: st: address sparse warnings Nicholas Mc Guire
2018-07-25 20:40   ` Stephen Boyd
2018-07-26  5:50     ` Nicholas Mc Guire
2018-07-25 20:41 ` [PATCH 1/2] drivers: clk: st: warn on iomap failure Stephen Boyd
2018-07-26  5:43   ` 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).