From patchwork Thu Apr 28 12:35:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 66895 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp188270qge; Thu, 28 Apr 2016 05:36:10 -0700 (PDT) X-Received: by 10.66.171.75 with SMTP id as11mr20089733pac.36.1461846969942; Thu, 28 Apr 2016 05:36:09 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1si15945816pas.37.2016.04.28.05.36.09; Thu, 28 Apr 2016 05:36:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752286AbcD1MgB (ORCPT + 4 others); Thu, 28 Apr 2016 08:36:01 -0400 Received: from mail-lf0-f48.google.com ([209.85.215.48]:34226 "EHLO mail-lf0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752049AbcD1MgA (ORCPT ); Thu, 28 Apr 2016 08:36:00 -0400 Received: by mail-lf0-f48.google.com with SMTP id j11so93327560lfb.1 for ; Thu, 28 Apr 2016 05:35:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=f3KC69QCP7A5+nrnZ3bvQR2b9TXTnlCHeXRkWGwHq/Q=; b=cz06tjEZzoPUtBYKCVrT3lU+x4NZ4TgnwjpmqKXkOHhQUER1Q4AH9OLZFBnpyd7RlF mQy94gZHada1a/zSZ7W5Lf3LrMSC9bHphZw+D6zLf6Ps6gdr/I3+DrOttVka686Ykn5E e/GiBscZbVBYbZep/boLxACKlrNg/ZLlr27bI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=f3KC69QCP7A5+nrnZ3bvQR2b9TXTnlCHeXRkWGwHq/Q=; b=LcHWtcEsjIfonWk7KxAN4lwe9okwHgTiw8StokeCAIj5fd33Ep4Wdzi+eANUpWTe+N wsK4JJsL7JHhE3xZc4v5YOnaQuOU+IktJI3zMZpN4gtcIRTKzx2OqW/yWIsRbO0u6x9D JjLdO4gPxGFp3mX+QbvH96uk3wZcng3u3YQkxU5z2akwuEQMECk42TFpwrs6bUX3LMGk Anio3P272mDSvXhEVbI7NXtdvjMVxoFlhUsOY1ApQExx2LZsB+s1Nhz6RQXQCa19U6HQ F4R8/muyRsqVxTwVrm4R7ng6bBS3wskpBLi83Qna3nMTvZKp0Wl/HPaYLolpZPotDN51 9bVw== X-Gm-Message-State: AOPr4FW1EL1VFBFDABV/VbZYc6wxUJhSrCCPQHdlP3ncXas9gVk/I/LxdClUzw+2se69z1qx X-Received: by 10.112.163.135 with SMTP id yi7mr5829112lbb.122.1461846958499; Thu, 28 Apr 2016 05:35:58 -0700 (PDT) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id jw6sm1648664lbc.13.2016.04.28.05.35.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Apr 2016 05:35:57 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org, Alexandre Courbot Cc: Linus Walleij Subject: [PATCH 1/2] gpio: pl061: remove range check Date: Thu, 28 Apr 2016 14:35:55 +0200 Message-Id: <1461846955-30803-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.11 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The gpiochip calls are already checking that the GPIO line offsets are in range. Signed-off-by: Linus Walleij --- drivers/gpio/gpio-pl061.c | 6 ------ 1 file changed, 6 deletions(-) -- 2.4.11 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 9afb415a5d24..70eb9ada002e 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c @@ -67,9 +67,6 @@ static int pl061_direction_input(struct gpio_chip *gc, unsigned offset) unsigned long flags; unsigned char gpiodir; - if (offset >= gc->ngpio) - return -EINVAL; - spin_lock_irqsave(&chip->lock, flags); gpiodir = readb(chip->base + GPIODIR); gpiodir &= ~(BIT(offset)); @@ -86,9 +83,6 @@ static int pl061_direction_output(struct gpio_chip *gc, unsigned offset, unsigned long flags; unsigned char gpiodir; - if (offset >= gc->ngpio) - return -EINVAL; - spin_lock_irqsave(&chip->lock, flags); writeb(!!value << offset, chip->base + (BIT(offset + 2))); gpiodir = readb(chip->base + GPIODIR);