From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Linus Walleij <linus.walleij@stericsson.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Anmar Oueja <anmar.oueja@linaro.org>,
Linus Walleij <linus.walleij@linaro.org>,
Stephen Warren <swarren@nvidia.com>,
Rob Herring <rob.herring@calxeda.com>
Subject: Re: [PATCH] pinctrl/nomadik: allocate IRQ descriptors dynamically
Date: Thu, 27 Sep 2012 13:53:14 +0100 [thread overview]
Message-ID: <20120927125314.GD14358@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1348679887-2135-1-git-send-email-linus.walleij@stericsson.com>
On Wed, Sep 26, 2012 at 07:18:07PM +0200, Linus Walleij wrote:
> + irq_start = NOMADIK_GPIO_TO_IRQ(pdata->first_gpio);
> + irq_base = irq_alloc_descs(irq_start, 0, NMK_GPIO_PER_CHIP,
> + numa_node_id());
> + if (IS_ERR_VALUE(irq_base)) {
commit 07ab67c8d0d7c1021343b7d5c045033d6bf7be69
Author: Linus Torvalds <torvalds@ppc970.osdl.org>
Date: Thu May 19 22:43:37 2005 -0700
Fix get_unmapped_area sanity tests
As noted by Chris Wright, we need to do the full range of tests regardless
of whether MAP_FIXED is set or not, so re-organize get_unmapped_area()
slightly to do the sanity checks unconditionally.
diff --git a/include/linux/err.h b/include/linux/err.h
index 17c55df..ff71d2a 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -13,6 +13,8 @@
* This should be a per-architecture thing, to allow different
* error and pointer decisions.
*/
+#define IS_ERR_VALUE(x) unlikely((x) > (unsigned long)-1000L)
This is because get_unmapped_area() can return negative numbers which are
not error codes.
My position on this is that IS_ERR_VALUE() should only be used for checking
the return value of a function where some negative numbers are not error
codes, and everywhere else should use "ret < 0".
Just because we have a funky macro is no reason to blindly (ab)use it.
prev parent reply other threads:[~2012-09-27 12:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-26 17:18 [PATCH] pinctrl/nomadik: allocate IRQ descriptors dynamically Linus Walleij
2012-09-27 5:13 ` Stephen Warren
2012-09-27 11:59 ` Linus Walleij
2012-09-27 12:37 ` Rob Herring
2012-09-27 12:48 ` Linus Walleij
2012-09-27 12:53 ` Russell King - ARM Linux [this message]
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=20120927125314.GD14358@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=anmar.oueja@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rob.herring@calxeda.com \
--cc=swarren@nvidia.com \
/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