From patchwork Wed Oct 19 04:38:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 78169 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp53981qge; Tue, 18 Oct 2016 21:36:50 -0700 (PDT) X-Received: by 10.98.85.135 with SMTP id j129mr7377758pfb.28.1476851810696; Tue, 18 Oct 2016 21:36:50 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sk10si16500228pac.345.2016.10.18.21.36.50; Tue, 18 Oct 2016 21:36:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-i2c-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=@nifty.com; spf=pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755053AbcJSEgt (ORCPT + 1 other); Wed, 19 Oct 2016 00:36:49 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:48140 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753820AbcJSEgs (ORCPT ); Wed, 19 Oct 2016 00:36:48 -0400 Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id u9J4a2mT001937; Wed, 19 Oct 2016 13:36:02 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com u9J4a2mT001937 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1476851762; bh=QknZsy7uSfF8Rs3fW0ED+WqXXZGVHrd+PGbm7a4jfVE=; h=From:To:Cc:Subject:Date:From; b=jYTyLlID8+FvozXSN+/MeJ/y3MMq/wJLAZNEce4rC5IcqcKDx/aL0UMtQwORQVzdJ V2TKSL+/0hJf5IY9BMRg29g9tv+xfgCxXS8Yp9vd/nxV2ZV3K7ne5Je42AXmDQ5Pr2 tjSeeyDs8+pqx08f4lW9qY6i54nUK/1LedUpaSxgn6wwbRNVFGqhvEn3/EKTIGj2Wr 7ubo6Wb7roFz1gKEF4Xslc9gtyjDCZsbI8z08uoHhl13XpRpMg+hcnUEO0lULjzNki EcsYLJ4KGe+PsVoI8RVzW6mYIRMJFdtewHoNMyqXCsSukR+ml/URyGp6wvXLnQ6xLR j4SDXnyQLjowQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-i2c@vger.kernel.org Cc: Masahiro Yamada , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Wolfram Sang Subject: [PATCH] i2c: uniphier[-f]: fix bool logic calculation Date: Wed, 19 Oct 2016 13:38:31 +0900 Message-Id: <1476851911-21729-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org This code is working, but it should not depend on how "bool" is typedef'ed, or the bit position of I2C_M_RD. Signed-off-by: Masahiro Yamada --- drivers/i2c/busses/i2c-uniphier-f.c | 2 +- drivers/i2c/busses/i2c-uniphier.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" 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/i2c/busses/i2c-uniphier-f.c b/drivers/i2c/busses/i2c-uniphier-f.c index db9105e..b54448e 100644 --- a/drivers/i2c/busses/i2c-uniphier-f.c +++ b/drivers/i2c/busses/i2c-uniphier-f.c @@ -309,7 +309,7 @@ static int uniphier_fi2c_master_xfer_one(struct i2c_adapter *adap, struct i2c_msg *msg, bool stop) { struct uniphier_fi2c_priv *priv = i2c_get_adapdata(adap); - bool is_read = msg->flags & I2C_M_RD; + bool is_read = !!(msg->flags & I2C_M_RD); unsigned long time_left; dev_dbg(&adap->dev, "%s: addr=0x%02x, len=%d, stop=%d\n", diff --git a/drivers/i2c/busses/i2c-uniphier.c b/drivers/i2c/busses/i2c-uniphier.c index 56e92af..cc80bb2 100644 --- a/drivers/i2c/busses/i2c-uniphier.c +++ b/drivers/i2c/busses/i2c-uniphier.c @@ -177,7 +177,7 @@ static int uniphier_i2c_stop(struct i2c_adapter *adap) static int uniphier_i2c_master_xfer_one(struct i2c_adapter *adap, struct i2c_msg *msg, bool stop) { - bool is_read = msg->flags & I2C_M_RD; + bool is_read = !!(msg->flags & I2C_M_RD); bool recovery = false; int ret;