From: Tejun Heo <tj@kernel.org>
To: zijun_hu <zijun_hu@zoho.com>
Cc: zijun_hu@htc.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
jiangshanlai@gmail.com
Subject: Re: [PATCH 1/1] workqueue: use type int instead of bool to index array
Date: Wed, 6 Sep 2017 09:40:15 -0700 [thread overview]
Message-ID: <20170906164015.GQ1774378@devbig577.frc2.facebook.com> (raw)
In-Reply-To: <c795e42f-8355-b79b-3239-15c4ea8fede7@zoho.com>
On Thu, Sep 07, 2017 at 12:04:59AM +0800, zijun_hu wrote:
> On 2017/9/6 22:33, Tejun Heo wrote:
> > Hello,
> >
> > On Wed, Sep 06, 2017 at 11:34:14AM +0800, zijun_hu wrote:
> >> From: zijun_hu <zijun_hu@htc.com>
> >>
> >> type bool is used to index three arrays in alloc_and_link_pwqs()
> >> it doesn't look like conventional.
> >>
> >> it is fixed by using type int to index the relevant arrays.
> >
> > bool is a uint type which can be either 0 or 1. I don't see what the
> > benefit of this patch is.q
> >
> bool is NOT a uint type now, it is a new type introduced by gcc, it is
> rather different with "typedef int bool" historically
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n815.htm
Because C has existed for so long without a Boolean type, however, the
new standard must coexist with the old remedies. Therefore, the type
name is taken from the reserved identifier space. To maintain
orthogonal promotion rules, the Boolean type is defined as an unsigned
integer type capable of representing the values 0 and 1. The more
conventional names for the type and its values are then made available
only with the inclusion of the <stdbool.h> header. In addition, the
header defines a feature test macro to aid in integrating new code
with old code that defines its own Boolean type.
--
tejun
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-09-06 16:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <59AF6CB6.4090609@zoho.com>
[not found] ` <20170906143320.GK1774378@devbig577.frc2.facebook.com>
2017-09-06 16:04 ` zijun_hu
2017-09-06 16:40 ` Tejun Heo [this message]
2017-09-06 17:07 ` zijun_hu
2017-09-06 17:22 ` Tejun Heo
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=20170906164015.GQ1774378@devbig577.frc2.facebook.com \
--to=tj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=zijun_hu@htc.com \
--cc=zijun_hu@zoho.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox