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] [day] [month] [year] [list]
Message-ID: <1487758075.14159.3.camel@perches.com>
Date:   Wed, 22 Feb 2017 02:07:55 -0800
From:   Joe Perches <joe@...ches.com>
To:     Julia Lawall <julia.lawall@...6.fr>,
        simran singhal <singhalsimran0@...il.com>
Cc:     gregkh@...uxfoundation.org, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org, outreachy-kernel@...glegroups.com
Subject: Re: [Outreachy kernel] [PATCH v2 2/7] staging: most: Using macro
 DIV_ROUND_UP

On Wed, 2017-02-22 at 10:27 +0100, Julia Lawall wrote:
> > @@ -117,7 +118,7 @@ static int alloc_dbr(u16 size)
> >  		return DBR_SIZE; /* out of memory */
> > 
> >  	for (i = 0; i < DBR_MAP_SIZE; i++) {
> > -		u32 const blocks = (size + DBR_BLOCK_SIZE - 1) / DBR_BLOCK_SIZE;
> > +		u32 const blocks = DIV_ROUND_UP(size, DBR_BLOCK_SIZE);
> >  		u32 mask = ~((~(u32)0) << blocks);
> 
> Totally unrelated to DIV_ROUND_UP, would this code be a candidate for
> GENMASK?

Maybe "(1 << blocks) - 1" would be more intelligible.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ