From patchwork Mon Sep 29 14:46:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 38084 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3DBE0201F1 for ; Mon, 29 Sep 2014 14:47:32 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id 10sf9967569lbg.1 for ; Mon, 29 Sep 2014 07:47:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe :content-type:content-transfer-encoding; bh=naRepoaOo/m5txSCg+A6kgaNTOW2m4YCz1HcVYYz/K4=; b=WJXxAbPLGhkk2ajYHy37U2winQgSiv3OkWkipCHM+cjZZjp23fd3DDuSDLZjHeGTbx 2NZW1Mhpm4i4lJLUJnRgBIxObA5mO2R65pI3KR8KQqMrHv/3uI01GZmW+Y1mq+GEwBqL 6TH4i1d8QerUph+JctWcWfvXVS7XeGo8jNT5n3XigcPW7lNAPr6/gdLw3Ne2u6bREz90 l7G6OZKvsCMT3GpvX7350UKWbVercGNzlX2OFbui+c4NAvbMrNwemufEzgQSoRPZJKmD 5sZLzSrDKL2i5lMMKA1ySbumu/lExF8WGZQVlnHWYqET9zNkhL7Rh4PBAqKkr+C83QIO Qw1w== X-Gm-Message-State: ALoCoQnS+FI0P+utfJxhR6KE/4UiLwxMllnlF3WUAS/cFj5WFikTSi86+kfQTNu2jwrLAHmsjv1f X-Received: by 10.112.6.138 with SMTP id b10mr456103lba.18.1412002050874; Mon, 29 Sep 2014 07:47:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.41 with SMTP id o9ls625191laa.52.gmail; Mon, 29 Sep 2014 07:47:30 -0700 (PDT) X-Received: by 10.112.34.78 with SMTP id x14mr23253687lbi.38.1412002050703; Mon, 29 Sep 2014 07:47:30 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by mx.google.com with ESMTPS id kf3si18604393lbc.68.2014.09.29.07.47.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 29 Sep 2014 07:47:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id q1so6559985lam.32 for ; Mon, 29 Sep 2014 07:47:30 -0700 (PDT) X-Received: by 10.112.134.229 with SMTP id pn5mr11940607lbb.22.1412002050354; Mon, 29 Sep 2014 07:47:30 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp187366lbb; Mon, 29 Sep 2014 07:47:29 -0700 (PDT) X-Received: by 10.70.90.101 with SMTP id bv5mr77151797pdb.0.1412002048760; Mon, 29 Sep 2014 07:47:28 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gr5si23268902pbc.131.2014.09.29.07.47.28 for ; Mon, 29 Sep 2014 07:47:28 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755164AbaI2OrZ (ORCPT + 27 others); Mon, 29 Sep 2014 10:47:25 -0400 Received: from mail-we0-f182.google.com ([74.125.82.182]:43343 "EHLO mail-we0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755130AbaI2Oqo (ORCPT ); Mon, 29 Sep 2014 10:46:44 -0400 Received: by mail-we0-f182.google.com with SMTP id x48so1959166wes.13 for ; Mon, 29 Sep 2014 07:46:42 -0700 (PDT) X-Received: by 10.180.107.194 with SMTP id he2mr48792316wib.72.1412002002507; Mon, 29 Sep 2014 07:46:42 -0700 (PDT) Received: from [192.168.1.7] (host-2-99-232-3.as13285.net. [2.99.232.3]) by mx.google.com with ESMTPSA id bl9sm8009572wib.24.2014.09.29.07.46.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Sep 2014 07:46:41 -0700 (PDT) Message-ID: <542970CF.6040405@linaro.org> Date: Mon, 29 Sep 2014 15:46:39 +0100 From: Srinivas Kandagatla User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Pramod Gurav , linux-kernel@vger.kernel.org CC: Maxime Coquelin , Patrice Chotard , Linus Walleij Subject: Re: [PATCH] pinctrl: st: Fix Sparse error References: <1411998499-20300-1-git-send-email-pramod.gurav@smartplayin.com> In-Reply-To: <1411998499-20300-1-git-send-email-pramod.gurav@smartplayin.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: srinivas.kandagatla@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On 29/09/14 14:48, Pramod Gurav wrote: > This change fixes below sparse error, > drivers/pinctrl/pinctrl-st.c:1515:31: error: incompatible types for operation (>) > drivers/pinctrl/pinctrl-st.c:1515:31: left side has type void [noderef] *irqmux_base > drivers/pinctrl/pinctrl-st.c:1515:31: right side has type int > > The fix is done by removing a check on info->irqmux_base as > info->irqmux_base has already been checked for error when allocating it. > Hence there is no need to redo the check. > > Cc: Maxime Coquelin > Cc: Patrice Chotard > CC: Linus Walleij > Cc: Srinivas Kandagatla > Signed-off-by: Pramod Gurav > --- > drivers/pinctrl/pinctrl-st.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c > index 5475374..ddeaeda 100644 > --- a/drivers/pinctrl/pinctrl-st.c > +++ b/drivers/pinctrl/pinctrl-st.c > @@ -1512,7 +1512,7 @@ static int st_gpiolib_register_bank(struct st_pinctrl *info, > gpio_irq, st_gpio_irq_handler); > } > > - if (info->irqmux_base > 0 || gpio_irq > 0) { > + if (gpio_irq > 0) { > err = gpiochip_irqchip_add(&bank->gpio_chip, &st_gpio_irqchip, > 0, handle_simple_irq, > IRQ_TYPE_LEVEL_LOW); This is not the correct fix. Please see why irqmux_base and gpio_irq are used in the driver. You are breaking the logic here... please read the below comment from the code. /** * GPIO bank can have one of the two possible types of * interrupt-wirings. * * First type is via irqmux, single interrupt is used by multiple * gpio banks. This reduces number of overall interrupts numbers * required. All these banks belong to a single pincontroller. * _________ * | |----> [gpio-bank (n) ] * | |----> [gpio-bank (n + 1)] * [irqN]-- | irq-mux |----> [gpio-bank (n + 2)] * | |----> [gpio-bank (... )] * |_________|----> [gpio-bank (n + 7)] * * Second type has a dedicated interrupt per each gpio bank. * * [irqN]----> [gpio-bank (n)] */ so irqmux_base is first type and gpio_irq is second type. if you remove check for irqmux_base here you would end up NOT adding irqchip the gpiochip in first type so you break the existing logic here. I think the correct fix is: &st_gpio_irqchip, 0, handle_simple_irq, IRQ_TYPE_LEVEL_LOW); Thanks, srini --- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c index 5475374..4060c30 100644 --- a/drivers/pinctrl/pinctrl-st.c +++ b/drivers/pinctrl/pinctrl-st.c @@ -1512,7 +1512,7 @@ static int st_gpiolib_register_bank(struct st_pinctrl *info, gpio_irq, st_gpio_irq_handler); } - if (info->irqmux_base > 0 || gpio_irq > 0) { + if (!IS_ERR(info->irqmux_base) || gpio_irq > 0) { err = gpiochip_irqchip_add(&bank->gpio_chip,