From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755450AbcH2Qsw (ORCPT ); Mon, 29 Aug 2016 12:48:52 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:34266 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752274AbcH2Qsu (ORCPT ); Mon, 29 Aug 2016 12:48:50 -0400 Subject: Re: [PATCH] arch: all: include: asm: bitops: Use bool instead of int for all bit test functions To: Arnd Bergmann , chengang@emindsoft.com.cn References: <1472362755-26776-1-git-send-email-chengang@emindsoft.com.cn> <201608291503.41630.arnd@arndb.de> 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, davem@dave From: Vineet Gupta Organization: Synopsys Message-ID: <80e3ae6c-e81d-3541-9051-07ad726b59cd@synopsys.com> Date: Mon, 29 Aug 2016 09:48:46 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608291503.41630.arnd@arndb.de> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > - See which architectures can still get converted to using the > asm-generic headers instead of providing their own, I think at > least for the nonatomic ones, there are a couple. > > Arnd >