From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756834AbcH2Vry (ORCPT ); Mon, 29 Aug 2016 17:47:54 -0400 Received: from out1134-195.mail.aliyun.com ([42.120.134.195]:60499 "EHLO out1134-195.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756301AbcH2Vrw (ORCPT ); Mon, 29 Aug 2016 17:47:52 -0400 X-Greylist: delayed 318 seconds by postgrey-1.27 at vger.kernel.org; Mon, 29 Aug 2016 17:47:51 EDT X-Alimail-AntiSpam: AC=CONTINUE;BC=0.1042804|-1;FP=0|0|0|0|0|-1|-1|-1;HT=e02c03307;MF=chengang@emindsoft.com.cn;NM=1;PH=DS;RN=37;RT=37;SR=0;TI=SMTPD_----5DR1hDb_1472506916; Message-ID: <57C4ADD1.6020609@emindsoft.com.cn> Date: Tue, 30 Aug 2016 05:49:05 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Vineet Gupta , Arnd Bergmann CC: akpm@linux-foundation.org, minchan@kernel.org, vbabka@suse.cz, gi-oh.kim@profitbricks.com, iamjoonsoo.kim@lge.com, hillf.zj@alibaba-inc.com, mgorman@techsingularity.net, mhocko@suse.com, rientjes@google.com, linux-kernel@vger.kernel.org, rth@twiddle.net, ink@jurassic.park.msu.ru, mattst88@gmail.com, linux@armlinux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, hskinnemoen@gmail.com, egtvedt@samfundet.no, realmz6@gmail.com, ysato@users.sourceforge.jp, rkuo@codeaurora.org, tony.luck@intel.com, fenghua.yu@intel.com, geert@linux-m68k.org, james.hogan@imgtec.com, ralf@linux-mips.org, dhowells@redhat.com, deller@gmx.de, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, dalias@libc.org, "David S. Miller" Subject: Re: [PATCH] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions References: <1472362755-26776-1-git-send-email-chengang@emindsoft.com.cn> <201608291503.41630.arnd@arndb.de> <80e3ae6c-e81d-3541-9051-07ad726b59cd@synopsys.com> In-Reply-To: <80e3ae6c-e81d-3541-9051-07ad726b59cd@synopsys.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >>> >>> 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 >> >> 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.