From patchwork Thu Sep 27 12:53:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 1513931 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id CE3A23FC71 for ; Thu, 27 Sep 2012 12:56:40 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1THDbt-0004ho-KX; Thu, 27 Sep 2012 12:54:33 +0000 Received: from caramon.arm.linux.org.uk ([78.32.30.218]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1THDbp-0004ha-Sy for linux-arm-kernel@lists.infradead.org; Thu, 27 Sep 2012 12:54:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=caramon; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=KwqkbJsdnPOBvIR9/YCcGsrcvaJ4a6egAkNHu9ApHv0=; b=j/BFsM1LgScbaJo2ZN1R3IQu85pqsOyiNzdQPnkeAv+yaXo4MMzURUZh1ugd237RhotkyNtjDCyHyGKDZ21HD+87IosFpGytq7Z1kLHEcHolZHodBRpbDmBXX+LqxyjhgPMciXl52aklmYUeMEW/KfKGNcAp2qw+msrqcE5wUzk=; Received: from n2100.arm.linux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:56545) by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1THDad-0000B7-Rc; Thu, 27 Sep 2012 13:53:16 +0100 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1THDac-0008Lq-T3; Thu, 27 Sep 2012 13:53:14 +0100 Date: Thu, 27 Sep 2012 13:53:14 +0100 From: Russell King - ARM Linux To: Linus Walleij Subject: Re: [PATCH] pinctrl/nomadik: allocate IRQ descriptors dynamically Message-ID: <20120927125314.GD14358@n2100.arm.linux.org.uk> References: <1348679887-2135-1-git-send-email-linus.walleij@stericsson.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1348679887-2135-1-git-send-email-linus.walleij@stericsson.com> User-Agent: Mutt/1.5.19 (2009-01-05) X-Spam-Note: CRM114 invocation failed X-Spam-Score: -5.1 (-----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-5.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [78.32.30.218 listed in list.dnswl.org] -0.8 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Stephen Warren , Linus Walleij , linux-kernel@vger.kernel.org, Rob Herring , Anmar Oueja , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 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. 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. 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.