lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 11 Jan 2019 07:29:40 -1000
From:   Joey Pabalinas <joeypabalinas@...il.com>
To:     Jason Gunthorpe <jgg@...lanox.com>
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>,
        Joey Pabalinas <joeypabalinas@...il.com>
Subject: Re: [PATCH v4] coding-style: Clarify the expectations around bool

On Thu, Jan 10, 2019 at 11:48:13PM +0000, Jason Gunthorpe wrote:
> There has been some confusion since checkpatch started warning about bool
> use in structures, and people have been avoiding using it.
> 
> Many people feel there is still a legitimate place for bool in structures,
> so provide some guidance on bool usage derived from the entire thread that
> spawned the checkpatch warning.

Hey Jason,

I very much agree that the bool expectations could be much clearer, and this
patch is a nice step in that direction! Just a couple small nitpicks:

> +Do not use bool if cache line layout or size of the value matters, its size
> +and alignment varies based on the compiled architecture. Structures that are
> +optimized for alignment and size should not use bool.

+Do not use bool if cache line layout or size of the value matters, as its size
                                                                    ^
                                                                    |
Adding an "as" makes the sentence flow a bit cleaner: --------------

> +into a single bitwise 'flags' argument and 'flags' can often a more readable
> +alternative if the call-sites have naked true/false constants.

+into a single bitwise 'flags' argument and 'flags' can often be a more readable
                                                              ^
                                                              |
Missing a "be" here: -----------------------------------------

Ack from me after those two corrections.

Reviewed-by: Joey Pabalinas <joeypabalinas@...il.com>

-- 
Cheers,
Joey Pabalinas

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ