lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 19 Nov 2019 16:28:50 +0000
From:   Andrew Murray <andrew.murray@....com>
To:     Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
Cc:     Heiko Stuebner <heiko@...ech.de>, linux-pci@...r.kernel.org,
        Shawn Lin <shawn.lin@...k-chips.com>,
        Christoph Hellwig <hch@....de>,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        linux-rdma@...r.kernel.org, maz@...nel.org, phil@...pberrypi.org,
        iommu@...ts.linux-foundation.org,
        linux-rockchip@...ts.infradead.org, f.fainelli@...il.com,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        linux-arm-kernel@...ts.infradead.org, mbrugger@...e.com,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        jeremy.linton@....com, Tom Joseph <tjoseph@...ence.com>,
        wahrenst@....net, james.quinlan@...adcom.com,
        Robin Murphy <robin.murphy@....com>,
        "David S. Miller" <davem@...emloft.net>,
        Tariq Toukan <tariqt@...lanox.com>
Subject: Re: [PATCH v2 1/6] linux/log2.h: Add roundup/rounddown_pow_two64()
 family of functions

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
> > 
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ