From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/7] ARM: mx25: Retrieve IIM base from dt
Date: Wed, 11 Mar 2015 13:24:56 +0000 [thread overview]
Message-ID: <20150311132456.GD8656@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1426077835-31081-4-git-send-email-festevam@gmail.com>
On Wed, Mar 11, 2015 at 09:43:52AM -0300, Fabio Estevam wrote:
> + void __iomem *iim_base;
> + struct device_node *np;
> +
> + np = of_find_compatible_node(NULL, NULL, "fsl,imx25-iim");
> + iim_base = of_iomap(np, 0);
> + WARN_ON(!iim_base);
> + rev = readl(iim_base + MXC_IIMSREV);
> + iounmap(iim_base);
Is there much point to that WARN_ON()? Are you avoiding the political
BUG_ON(!iim_base) ? :)
Since a NULL pointer there will lead to a NULL pointer dereference, it's
silly to use WARN_ON() there - we'll get a backtrace etc from the WARN_ON
followed immediately by an oops dump due to the readl(), crashing the
kernel.
Better to just use BUG_ON() and only get one set of diagnostics.
--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
next prev parent reply other threads:[~2015-03-11 13:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-11 12:43 [PATCH 1/7] ARM: mx25: Remove mx25_clocks_init() Fabio Estevam
2015-03-11 12:43 ` [PATCH 2/7] ARM: mx25: Remove mm-imx25.c Fabio Estevam
2015-03-11 12:43 ` [PATCH 3/7] ARM: mx25: Remove static memory mapping Fabio Estevam
2015-03-11 12:43 ` [PATCH 4/7] ARM: mx25: Retrieve IIM base from dt Fabio Estevam
2015-03-11 13:24 ` Russell King - ARM Linux [this message]
2015-03-11 14:20 ` Fabio Estevam
2015-03-11 12:43 ` [PATCH 5/7] ARM: mx25: Remove "mx25.h" header file Fabio Estevam
2015-03-11 12:58 ` Fabio Estevam
2015-03-11 12:43 ` [PATCH 6/7] ARM: mx25: Remove imxdi_rtc platform code Fabio Estevam
2015-03-11 12:43 ` [PATCH 7/7] ARM: imx_v4_v5_defconfig: Remove CONFIG_MACH_MX25_3DS Fabio Estevam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150311132456.GD8656@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).