Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp950198imm; Fri, 28 Sep 2018 09:21:42 -0700 (PDT) X-Google-Smtp-Source: ACcGV62czJse2wmUCSJt26y82DxWtL4oZNZ4+h6gE2+wBxxCkfODeHrgBye7GonvSbcH1w4ybsie X-Received: by 2002:a62:fd06:: with SMTP id p6-v6mr17543273pfh.167.1538151702684; Fri, 28 Sep 2018 09:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538151702; cv=none; d=google.com; s=arc-20160816; b=VYFBV8/4VSn+hW4E94XiwNuCJSgedpbCDTBELvXjYspjL1zy/m6BznVr5al7G9omBv qHyVrHnpBkvg6PWGQT8AXJ4oCfjfLCUqjJMUNw5DfLzf99N4mTiPiTdligWBtb8BfjvT eHO8GFxx6NTQAXkKIPiM5GWb5t+hAiSpy02J8FsnSx36yww1qqcxhBp2VMcpPeV9mEpz 4miABp3oqhigWaWOhlMXMsgDqUGKpph6g4+hAdI3l7tN7VDM53aoNXMtAc1s8E16MPCN 9SkWiHwwhFZ0T+c2pv4OT3GNFQJLoaFjg7TjmAwyKRxLrHiH2bPqGkQkJazfF1MbXkcp Zrnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=LmaH5ZUI3rnWbCHZ/o2sYuAVE5EZKis2D9MExUpomio=; b=vY9EDkv3oH37kCS2vhkPl+7reHvFUzqRXOEM7yKtXGR+OIRyqGbHsb3d0NRaSAftYZ KY58uWnVdTJU8OXVHgu1++ZvCODHRmLDCTbKLgVusbKi+lLAhkJY72JbfBbFwoEBDxCp rhPj3XWWqPMBtLm9pjRJqu3RPbtUAGqFx1LotEMWfiWaWQrkL+7PNKjVihZGyjhCcndg Ukl5UfYa4MIm6Z6B4a9m/0FJMMJpjKgey19IBFomL096XfM7xe16ImXbVqcCyDWTEv79 n6NLjB/c4mUR4FJCUJgIT9ysgTdDfDinSsX2LZDzyBTd6D/kS+bYMVP0HPPdxPevRKY9 H5Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dS5Equ8O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v8-v6si5120304pff.248.2018.09.28.09.21.27; Fri, 28 Sep 2018 09:21:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dS5Equ8O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729490AbeI1WpH (ORCPT + 99 others); Fri, 28 Sep 2018 18:45:07 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:35432 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbeI1WpH (ORCPT ); Fri, 28 Sep 2018 18:45:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=LmaH5ZUI3rnWbCHZ/o2sYuAVE5EZKis2D9MExUpomio=; b=dS5Equ8OFiJjzh8eoyfr3z3qt Djd9Crs/Ohzn1d6FtPLDRJrjsBZNiVU03od0ooFP1mBeSYGUniR4WXkDC9pBPgC6mQY36IjTKw2UX 5OZ2y7ImO8S56C8wNXhdW3tHbw/tvPWc2PKrDfOWCRQjLkfPzpWN18cM83uvSDePxWqTIs2OO6UCF oqrFeZbmwXTnumkGUlhJfjLLckILg1M1GpHqMU6lqI2YwLdLXsxpcgYNKNj6xFVLXH+084g4Cxi0d 4MlSav1LYsPmoyZjD6D/AMUetKN/7KkLhkIY+7sedGelD+YEanrkZdQ7IAuvq2V8qBj19I+P8UepM A2lR0n1Dg==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5vVG-0002bK-HE; Fri, 28 Sep 2018 16:20:30 +0000 Date: Fri, 28 Sep 2018 09:20:30 -0700 From: Christoph Hellwig To: Guo Ren Cc: akpm@linux-foundation.org, arnd@arndb.de, daniel.lezcano@linaro.org, davem@davemloft.net, gregkh@linuxfoundation.org, jason@lakedaemon.net, marc.zyngier@arm.com, mark.rutland@arm.com, mchehab+samsung@kernel.org, peterz@infradead.org, robh@kernel.org, robh+dt@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, devicetree@vger.kernel.org, green.hu@gmail.com, Chen Linfei , Mao Han Subject: Re: [PATCH V6 13/33] csky: Library functions Message-ID: <20180928162030.GE19827@infradead.org> References: <2418a9d77fb92ff7606c08e209d8994e4f21e7ff.1538058840.git.ren_guo@c-sky.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2418a9d77fb92ff7606c08e209d8994e4f21e7ff.1538058840.git.ren_guo@c-sky.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +unsigned long long notrace __bswapdi2(unsigned long long u) > +{ > + return (((u) & 0xff00000000000000ull) >> 56) | > + (((u) & 0x00ff000000000000ull) >> 40) | > + (((u) & 0x0000ff0000000000ull) >> 24) | > + (((u) & 0x000000ff00000000ull) >> 8) | > + (((u) & 0x00000000ff000000ull) << 8) | > + (((u) & 0x0000000000ff0000ull) << 24) | > + (((u) & 0x000000000000ff00ull) << 40) | > + (((u) & 0x00000000000000ffull) << 56); > +} How is this any better than using the generic byteswap helpers? > +unsigned int notrace __bswapsi2(unsigned int u) > +{ > + return (((u) & 0xff000000) >> 24) | > + (((u) & 0x00ff0000) >> 8) | > + (((u) & 0x0000ff00) << 8) | > + (((u) & 0x000000ff) << 24); > +} Same here.