From patchwork Wed Sep 24 11:31:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 37810 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 855BC202FD for ; Wed, 24 Sep 2014 11:31:51 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id k14sf1683984wgh.11 for ; Wed, 24 Sep 2014 04:31:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=8OFj4He6NBOciNLtfsQJs6OhCooOnMOxWfReLDuCX74=; b=jMdYtwPspQEHK17xX1vhaln3iN+757nv844oz8wKi/yk8eHucnZZ5jqS441tdUFtGG Ais4JRkChxuyV9yRYzeG2AjWjPcgcpRSlm3GqMEiVNLOvuiRAqjt/RAy9GC2Gyr766bk xLFOne1YaE7pfxs3QzbTZsFHm8IjMg2mV5TExiiFJsPR5q+EcJbMQTNORl1GZV63/MyX kh5ucAQHtnFVZlHlxj2DFgDao8Yq+BpP9EPLf+osWZkkbdCU2HcCeZ0SJF9ievlCU1mX 8AvemaJVWmMr+wCajem88I1tf0vfuJ++i8AXVPuaUQH+9tOJTMOh0eeNIvLgWoh+Dncd CBTw== X-Gm-Message-State: ALoCoQle94il7VrQ3uh/ikXxrQz1GX6qgYZN1DdLjfCO5Tnv7dQbUWbs2Ew6iKYx8X3zjfbHRUCh X-Received: by 10.152.18.199 with SMTP id y7mr333612lad.9.1411558310642; Wed, 24 Sep 2014 04:31:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.130 with SMTP id m2ls162552laf.89.gmail; Wed, 24 Sep 2014 04:31:50 -0700 (PDT) X-Received: by 10.112.62.200 with SMTP id a8mr5593535lbs.34.1411558310512; Wed, 24 Sep 2014 04:31:50 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com [209.85.215.49]) by mx.google.com with ESMTPS id cr11si22475230lad.61.2014.09.24.04.31.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Sep 2014 04:31:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id pn19so10475422lab.36 for ; Wed, 24 Sep 2014 04:31:50 -0700 (PDT) X-Received: by 10.112.4.33 with SMTP id h1mr5347807lbh.67.1411558310155; Wed, 24 Sep 2014 04:31:50 -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 of9csp565342lbb; Wed, 24 Sep 2014 04:31:49 -0700 (PDT) X-Received: by 10.68.134.72 with SMTP id pi8mr8420485pbb.86.1411558308610; Wed, 24 Sep 2014 04:31:48 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qb4si25819528pdb.151.2014.09.24.04.31.48 for ; Wed, 24 Sep 2014 04:31:48 -0700 (PDT) Received-SPF: none (google.com: linux-gpio-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 S1751509AbaIXLbr (ORCPT ); Wed, 24 Sep 2014 07:31:47 -0400 Received: from mail-wg0-f46.google.com ([74.125.82.46]:36855 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750783AbaIXLbr (ORCPT ); Wed, 24 Sep 2014 07:31:47 -0400 Received: by mail-wg0-f46.google.com with SMTP id a1so5780280wgh.29 for ; Wed, 24 Sep 2014 04:31:45 -0700 (PDT) X-Received: by 10.180.35.134 with SMTP id h6mr11176820wij.0.1411558305580; Wed, 24 Sep 2014 04:31:45 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id ny6sm5449914wic.22.2014.09.24.04.31.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Sep 2014 04:31:44 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Alexandre Courbot , Linus Walleij Subject: [PATCH] gpio: dwapb: fix pointer to integer cast Date: Wed, 24 Sep 2014 13:31:40 +0200 Message-Id: <1411558300-20555-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 Sender: linux-gpio-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-gpio@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@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.49 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: , The statements BUG_ON(ctx == 0) was implicitly casting a pointer to an integer for comparison. Do this with a bool test instead to get away from sparse warnings. Signed-off-by: Linus Walleij --- drivers/gpio/gpio-dwapb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index 7feaf9d3f3ca..b43cd84b61f1 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c @@ -626,7 +626,7 @@ static int dwapb_gpio_suspend(struct device *dev) unsigned int idx = gpio->ports[i].idx; struct dwapb_context *ctx = gpio->ports[i].ctx; - BUG_ON(ctx == 0); + BUG_ON(!ctx); offset = GPIO_SWPORTA_DDR + idx * GPIO_SWPORT_DDR_SIZE; ctx->dir = dwapb_read(gpio, offset); @@ -668,7 +668,7 @@ static int dwapb_gpio_resume(struct device *dev) unsigned int idx = gpio->ports[i].idx; struct dwapb_context *ctx = gpio->ports[i].ctx; - BUG_ON(ctx == 0); + BUG_ON(!ctx); offset = GPIO_SWPORTA_DR + idx * GPIO_SWPORT_DR_SIZE; dwapb_write(gpio, offset, ctx->data);