linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: linux-i2c@vger.kernel.org
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	Wolfram Sang <wsa@the-dreams.de>
Subject: Re: [PATCH] i2c: uniphier[-f]: fix bool logic calculation
Date: Wed, 21 Dec 2016 01:20:28 +0900	[thread overview]
Message-ID: <CAK7LNATrR9dSuuUZR98f=uOZqSGqUBnUNZmrUqUZgubHHE+X4A@mail.gmail.com> (raw)
In-Reply-To: <1476851911-21729-1-git-send-email-yamada.masahiro@socionext.com>

Hi.

I have not got any comment, but does this seem
a right thing to do?

2016-10-19 13:38 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> 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 <yamada.masahiro@socionext.com>
> ---
>
>  drivers/i2c/busses/i2c-uniphier-f.c | 2 +-
>  drivers/i2c/busses/i2c-uniphier.c   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> 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;
>
> --
> 1.9.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



-- 
Best Regards
Masahiro Yamada

  reply	other threads:[~2016-12-20 16:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-19  4:38 Masahiro Yamada
2016-12-20 16:20 ` Masahiro Yamada [this message]
2016-12-20 17:55   ` Joe Perches
2016-12-21 15:39     ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK7LNATrR9dSuuUZR98f=uOZqSGqUBnUNZmrUqUZgubHHE+X4A@mail.gmail.com' \
    --to=yamada.masahiro@socionext.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    --subject='Re: [PATCH] i2c: uniphier[-f]: fix bool logic calculation' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).