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: 392880 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id AD9FA14008F for ; Wed, 24 Sep 2014 21:31:48 +1000 (EST) 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-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=cPxKr9ukRKedHW9vfS1xJGVVZ39AXS3Ie1PboyR1ErM=; b=DzXYb+G6fBUpm01K3SG6zY0/DVdetkSoGrnucTvjFjK+TDI0Ni/c1NHKef54KpnDIL en4gJyccBqujg0EzY5iYgGc2IWUXLaOkSkovDksG6BXMpEvXzBKLafsYx9o6tiHwCcUj Uieg/b53pZYXmdJ3aiWppnwcSTFL8tYUFTdMi+1KI4YO/o9fc7kOBQ3zMUGBpwglNmGE 0ERF3BM0DUBWMnEa1dnFnDR7rfnBdvrvrsOa6mUt1pug5CFknYmU9Q2ky/IKblQLoj1B 4I2l2DYE1H68p35mAtc78+0dsRVevTvRNhRyeJczU6yuzNY/wVRbZ60g24nxnzyQgZSO Swxw== X-Gm-Message-State: ALoCoQnO+abKUv81y9YmTPBsFKZ6mW9jHuzvGohdBObvxeXmjeznSn73A5e7SD377Tcm0ibk2GoO 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: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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);