[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190114172827.GG22875@mellanox.com>
Date: Mon, 14 Jan 2019 17:28:34 +0000
From: Jason Gunthorpe <jgg@...lanox.com>
To: Federico Vaga <federico.vaga@...a.pv.it>
CC: Joe Perches <joe@...ches.com>, Gal Pressman <galpress@...zon.com>,
Bart Van Assche <bvanassche@....org>,
Stephen Warren <swarren@...dotorg.org>,
Tariq Toukan <tariqt@...lanox.com>,
"xavier.huwei@...wei.com" <xavier.huwei@...wei.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
Doug Ledford <dledford@...hat.com>,
Stephen Warren <swarren@...dia.com>,
Christoph Hellwig <hch@....de>,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
Jonathan Corbet <corbet@....net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4] coding-style: Clarify the expectations around bool
On Sun, Jan 13, 2019 at 05:01:39PM +0100, Federico Vaga wrote:
> > -17) Don't re-invent the kernel macros
> > +17) Using bool
> > +--------------
> > +
> > +The Linux kernel bool type is an alias for the C99 _Bool type. bool
> > values can
> > +only evaluate to 0 or 1, and implicit or explicit conversion to bool
> > +automatically converts the value to true or false. When using bool
> > types the
> > +!! construction is not needed, which eliminates a class of bugs.
> > +
> > +When working with bool values the true and false definitions should be
> > used
> > +instead of 0 and 1.
>
> A very minor thing. I would suggest to keep consistent, in the
> statement, the mapping between definitions ("true and false [...]")
> and their correspondent integer values ("[...] instead of 1 and 0").
>
> In few words, I propose to change "0 and 1" into "1 and 0".
Hm, sure, seems harmless
> > +Similarly for function arguments, many true/false values can be
> > consolidated
> > +into a single bitwise 'flags' argument and 'flags' can often a more
> > readable
> > +alternative if the call-sites have naked true/false constants.
>
> Of course, English is not my primary language, but it looks to me
> that here a "be" is missing: "[...] and 'flags' can often a more
> readable alternative [...]".
yes, sthanks
> > +Otherwise limited use of bool in structures and arguments can improve
> > +readability.
>
> I'm going to update the Italian translations for this. Do you want
> me to contribute directly to this patch? Otherwise I will send a
> dedicated patch later when this one get accepted.
I think you should send it as an update I guess? I don't really know
the process for translations
Jason
Powered by blists - more mailing lists