Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1472130

Re: [PATCH] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions

From Chen Gang <chengang@emindsoft.com.cn>
Newsgroups linux.kernel
Subject Re: [PATCH] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions
Date 2016-08-29 23:50 +0200
Message-ID <sbCBj-4fE-9@gated-at.bofh.it> (permalink)
References <sb18J-64x-3@gated-at.bofh.it> <sbuDL-7Mi-11@gated-at.bofh.it> <sbxUZ-1fP-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@emindsoft.com.cn wrote:
>>> From: Chen Gang <chengang@emindsoft.com.cn>
>>>
>>> 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@gmail.com>
>>
>> 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
>>   interdependencies)
>> - 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?

Thanks.
-- 
Chen Gang (陈刚)

Managing Natural Environments is the Duty of Human Beings.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions Arnd Bergmann <arnd@arndb.de> - 2016-08-29 15:20 +0200
  Re: [PATCH] arch: all: include: asm: bitops: Use bool instead of int  for all bit test functions Peter Zijlstra <peterz@infradead.org> - 2016-08-29 15:50 +0200
    Re: [PATCH] arch: all: include: asm: bitops: Use bool instead of int  for all bit test functions Geert Uytterhoeven <geert@linux-m68k.org> - 2016-08-29 16:00 +0200
  Re: [PATCH] arch: all: include: asm: bitops: Use bool instead of int  for all bit test functions Vineet Gupta <vgupta@synopsys.com> - 2016-08-29 18:50 +0200
    Re: [PATCH] arch: all: include: asm: bitops: Use bool instead of  int for all bit test functions Chen Gang <chengang@emindsoft.com.cn> - 2016-08-29 23:50 +0200
      cmsg newgroup alt.sex.fetish.bool (was Re: [PATCH] arch: all:  include: asm: bitops: Use bool instead of int for all bit test functions) Al Viro <viro@ZenIV.linux.org.uk> - 2016-09-01 23:10 +0200
        Re: cmsg newgroup alt.sex.fetish.bool (was Re: [PATCH] arch: all:  include: asm: bitops: Use bool instead of int for all bit test functions) Chen Gang <chengang@emindsoft.com.cn> - 2016-09-03 01:40 +0200
          Re: cmsg newgroup alt.sex.fetish.bool (was Re: [PATCH] arch: all:  include: asm: bitops: Use bool instead of int for all bit test functions) Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-09-03 02:10 +0200
            Re: cmsg newgroup alt.sex.fetish.bool (was Re: [PATCH] arch: all:  include: asm: bitops: Use bool instead of int for all bit test functions) Chen Gang <chengang@emindsoft.com.cn> - 2016-09-04 00:40 +0200
              Re: cmsg newgroup alt.sex.fetish.bool (was Re: [PATCH] arch: all:  include: asm: bitops: Use bool instead of int for all bit test functions) Al Viro <viro@ZenIV.linux.org.uk> - 2016-09-04 07:10 +0200
                Re: cmsg newgroup alt.sex.fetish.bool (was Re: [PATCH] arch: all:  include: asm: bitops: Use bool instead of int for all bit test functions) Chen Gang <chengang@emindsoft.com.cn> - 2016-09-07 18:00 +0200
  Re: [PATCH] arch: all: include: asm: bitops: Use bool instead of  int for all bit test functions Chen Gang <chengang@emindsoft.com.cn> - 2016-08-30 00:30 +0200

csiph-web