Re: [PATCH] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
From: Chen Gang
Date: Mon Aug 29 2016 - 17:47:59 EST
On 8/30/16 00:48, Vineet Gupta wrote:
> On 08/29/2016 06:03 AM, Arnd Bergmann wrote:
>> On Sunday 28 August 2016, chengang@xxxxxxxxxxxxxxxx wrote:
>>> From: Chen Gang <chengang@xxxxxxxxxxxxxxxx>
>>> Also use the same changing to asm-generic, and also use bool variable
>>> instead of int variable for mips, mn10300, parisc and tile related
>>> functions, and also avoid checkpatch.pl to report ERROR.
>>> Originally, except powerpc and xtensa, all another architectures intend
>>> to return 0 or 1. After this patch, also let powerpc and xtensa return 0
>>> or 1.
>>> The patch passes cross building for mips and parisc with default config.
>>> All related contents are found by "grep test_bit, grep test_and" under
>>> arch sub-directory.
>>> Signed-off-by: Chen Gang <gang.chen.5i5j@xxxxxxxxx>
>> This seems like a good idea overall, and I'm fine with the asm-generic
>> contents. If there is consensus on changing this, we probably also want
>> to do some other steps:
>> - Change the Documentation/atomic_ops.txt file accordingly
>> - split up the series per architecture (I don't think there are any
>> - For the architectures on which the definition changes (at least
>> x86 and ARM), do some more sanity checks and see if there are
>> noticeable changes in object code, and if so whether it looks
>> better or worse (I'm guessing it will be better if anything)
> For ARC atleast, it will be slightly worse. As bool is promoted to int in various
> expressions, gcc generates an additional EXTB (extend byte) instruction.
Could you provide the related proof?
Or shall I try to analyze about it and get proof?
Chen Gang (éå)
Managing Natural Environments is the Duty of Human Beings.