archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <>
To: Joe Perches <>
	Linux Kernel Mailing List <>,
	linux-arm-kernel <>,
	Wolfram Sang <>
Subject: Re: [PATCH] i2c: uniphier[-f]: fix bool logic calculation
Date: Thu, 22 Dec 2016 00:39:21 +0900	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Hi Joe,

2016-12-21 2:55 GMT+09:00 Joe Perches <>:
> On Wed, 2016-12-21 at 01:20 +0900, Masahiro Yamada wrote:
>> Hi.
>> I have not got any comment, but does this seem
>> a right thing to do?
>> This code is working, but it should not depend on how "bool" is
>> typedef'ed, or the bit position of I2C_M_RD.
> <shrug>
> I think bool can be guaranteed to be _Bool.
> So a change not necessary as the original code
> has a c90 guarantee of the same result.
> Boolean type
> 1
> When any scalar value is converted to _Bool, the result is 0 if the value compares equal
> to 0; otherwise, the result is 1.

Thanks for your comments!

_Bool works very nicely.

I have seen some (not very nice) projects
that define like "typedef char bool;"

So, I was wondering if I should write code
that works regardless how bool is defined.
Just my two cents.

Best Regards
Masahiro Yamada

      reply	other threads:[~2016-12-21 15:39 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
2016-12-20 17:55   ` Joe Perches
2016-12-21 15:39     ` Masahiro Yamada [this message]

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:

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

  git send-email \
    --in-reply-to='' \ \ \ \ \ \ \
    --subject='Re: [PATCH] i2c: uniphier[-f]: fix bool logic calculation' \

* 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).