Re: [PATCH v4] coding-style: Clarify the expectations around bool
From: Jason Gunthorpe <hidden>
Date: 2019-01-14 17:20:56
Also in:
linux-doc, linux-rdma, lkml
On Fri, Jan 11, 2019 at 07:29:40AM -1000, Joey Pabalinas wrote:
On Thu, Jan 10, 2019 at 11:48:13PM +0000, Jason Gunthorpe wrote:quoted
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:quoted
+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: --------------quoted
+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 <redacted>
done, thanks Jason