Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp739997ybc; Tue, 19 Nov 2019 08:30:21 -0800 (PST) X-Google-Smtp-Source: APXvYqyqdLfntprS0UoZLSpVheF65/DfhuaonbItPKqTNJw6wGA6iV6Ht+YFbski7Wo4BZTRj72n X-Received: by 2002:a17:907:447b:: with SMTP id oo19mr34988117ejb.81.1574181021667; Tue, 19 Nov 2019 08:30:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574181021; cv=none; d=google.com; s=arc-20160816; b=VIySPMA2BvdqCRDyFFnVn28F30UNixzOSIGSltTR1D7/Avt0q3once3omJBPxQOsft aSMt+GKsZW0tZeyolOpEjMSNcD+wEe0+GKWl+hiPNCFFxqfM09tGWMmBw51/hPowJs+S dKO3AbZ/Bp/I/rt+X5sAibwsHCZH3qDagdAu3K7YPJ3jg0/YmCOrPi1GntkneFtutFva V8b+IJCQZC5F2g5KexIW3Ppm4kcc41A8a6UnczRNnVnfrmIU1XnAbg2JXONYha7Betqe Oqk4PvLyYiyRWQaMe95zeC6t+y2B+P2kWFqUKuJ32dCnyQ66URCDNZR8RhYAdnTsgS96 H4DA== 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; bh=hcLkpKTNS5Zvsg+GMqW+suL5JPT2tTP3FcOd7V5FR/k=; b=EVJFx9hpJHq5tasYzsOdj6IYC4huEBEuJFICcTeWcPe+UxBOMEuCnCydOfIfQHWuna 5IPFgZN1GRIS+1/RM1wGz1tryDsdk6gGJCHqLTVROPgGn5DvucKyHBwG5ANUe2Bd6vW6 MlWfriuNRQ2n8tKJrbgrbqh+/smCYBX8/Ahgn3T0CeylptrGmDeezsPXnSYw0aLcSb2g GCB8YRA0suIF1Y8qYfOpom7O6zvq4M4Sfdg0aW8949d0DlPPQX03Fq8mL3/xVbZ3GDSP 7P8ypMCBzDtKETgnjpsEiNauu2iowSNgkLvNaqXXFw1BsAlPG/RN+6poZgOxOLjxN4UZ +AjA== ARC-Authentication-Results: i=1; mx.google.com; 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 p24si1737268eja.385.2019.11.19.08.29.53; Tue, 19 Nov 2019 08:30:21 -0800 (PST) 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; 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 S1728362AbfKSQ2y (ORCPT + 99 others); Tue, 19 Nov 2019 11:28:54 -0500 Received: from foss.arm.com ([217.140.110.172]:54990 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727456AbfKSQ2y (ORCPT ); Tue, 19 Nov 2019 11:28:54 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F256131B; Tue, 19 Nov 2019 08:28:52 -0800 (PST) Received: from localhost (unknown [10.37.6.20]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 320683F6C4; Tue, 19 Nov 2019 08:28:52 -0800 (PST) Date: Tue, 19 Nov 2019 16:28:50 +0000 From: Andrew Murray To: Nicolas Saenz Julienne Cc: Heiko Stuebner , linux-pci@vger.kernel.org, Shawn Lin , Christoph Hellwig , Marek Szyprowski , Lorenzo Pieralisi , linux-rdma@vger.kernel.org, maz@kernel.org, phil@raspberrypi.org, iommu@lists.linux-foundation.org, linux-rockchip@lists.infradead.org, f.fainelli@gmail.com, Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, mbrugger@suse.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jeremy.linton@arm.com, Tom Joseph , wahrenst@gmx.net, james.quinlan@broadcom.com, Robin Murphy , "David S. Miller" , Tariq Toukan Subject: Re: [PATCH v2 1/6] linux/log2.h: Add roundup/rounddown_pow_two64() family of functions Message-ID: <20191119162849.GT43905@e119886-lin.cambridge.arm.com> References: <20191112155926.16476-1-nsaenzjulienne@suse.de> <20191112155926.16476-2-nsaenzjulienne@suse.de> <20191119111320.GP43905@e119886-lin.cambridge.arm.com> <052d07fb4eb79b29dd58cab577d59bab6684329a.camel@suse.de> <56cbba61d92f9bc7d0a33c1de379bcd5cf411cb8.camel@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56cbba61d92f9bc7d0a33c1de379bcd5cf411cb8.camel@suse.de> User-Agent: Mutt/1.10.1+81 (426a6c1) (2018-08-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 19, 2019 at 01:43:39PM +0100, Nicolas Saenz Julienne wrote: > On Tue, 2019-11-19 at 12:30 +0100, Nicolas Saenz Julienne wrote: > > Hi Andrew, thanks for the review. > > > > +/** > > > > + * __roundup_pow_of_two64() - round 64bit value up to nearest power of > > > > two > > > > + * @n: value to round up > > > > + */ > > > > +static inline __attribute__((const)) __u64 __roundup_pow_of_two64(__u64 > > > > n) > > > > > > To be consistent with other functions in the same file (__ilog_u64) you may > > > want to rename this to __roundup_pow_of_two_u64. > > > > Sounds good to me. > > > > > Also do you know why u64 is used in some places and __u64 in others? > > > > That's unwarranted, it should be __u64 everywhere. > > Sorry, now that I look deeper into it, it should be u64. Do you know the reason why? I'd be interested to know. Thanks, Andrew Murray > > > > > +{ > > > > + return 1UL << fls64(n - 1); > > > > > > Does this need to be (and for the others): > > > > > > return 1ULL << fls64(n - 1); > > > > > > Notice that the PCI drivers you convert, all use 1ULL. > > > > Noted > > > > Regards, > > Nicolas > > >