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]
Message-ID: <878tmfq6fr.fsf@notabene.neil.brown.name>
Date:   Wed, 03 May 2017 07:45:12 +1000
From:   NeilBrown <neilb@...e.com>
To:     Wei Yang <richard.weiyang@...il.com>,
        Wei Yang <richard.weiyang@...il.com>
Cc:     shli@...com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] bitops.h: use BITS_PER_LONG to simplify BITS_TO_LONGS

On Tue, May 02 2017, Wei Yang wrote:

> Hi, masters
>
> Not sure this one is acceptable?

You'd have better luck getting a response if you post things like this
to akpm - he tends to collect miscellaneous bits and pieces.
I don't think the patch makes more that a tiny improvement and I
wouldn't bother with it, but maybe Andrew will.

NeilBrown

>
> On Sat, Mar 18, 2017 at 08:37:43AM +0800, Wei Yang wrote:
>>The second parameter is the number of bits for type "long", which is
>>already defined in header file.
>>
>>This patch replace the calculation with macro to make it more readable.
>>
>>Signed-off-by: Wei Yang <richard.weiyang@...il.com>
>>---
>> include/linux/bitops.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>>diff --git a/include/linux/bitops.h b/include/linux/bitops.h
>>index a83c822c35c2..923fe72d31e3 100644
>>--- a/include/linux/bitops.h
>>+++ b/include/linux/bitops.h
>>@@ -10,7 +10,7 @@
>> #define BIT_ULL_MASK(nr)	(1ULL << ((nr) % BITS_PER_LONG_LONG))
>> #define BIT_ULL_WORD(nr)	((nr) / BITS_PER_LONG_LONG)
>> #define BITS_PER_BYTE		8
>>-#define BITS_TO_LONGS(nr)	DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
>>+#define BITS_TO_LONGS(nr)	DIV_ROUND_UP(nr, BITS_PER_LONG)
>> #endif
>> 
>> /*
>>-- 
>>2.11.0
>
> -- 
> Wei Yang
> Help you, Help me

Download attachment "signature.asc" of type "application/pgp-signature" (833 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ