Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1634406 > unrolled thread

Re: [PATCH] bitops.h: use BITS_PER_LONG to simplify BITS_TO_LONGS

Started byWei Yang <richard.weiyang@gmail.com>
First post2017-05-02 15:30 +0200
Last post2017-05-03 03:10 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] bitops.h: use BITS_PER_LONG to simplify BITS_TO_LONGS Wei Yang <richard.weiyang@gmail.com> - 2017-05-02 15:30 +0200
    Re: [PATCH] bitops.h: use BITS_PER_LONG to simplify BITS_TO_LONGS NeilBrown <neilb@suse.com> - 2017-05-02 23:50 +0200
      Re: [PATCH] bitops.h: use BITS_PER_LONG to simplify BITS_TO_LONGS Wei Yang <richard.weiyang@gmail.com> - 2017-05-03 03:10 +0200

#1634406 — Re: [PATCH] bitops.h: use BITS_PER_LONG to simplify BITS_TO_LONGS

FromWei Yang <richard.weiyang@gmail.com>
Date2017-05-02 15:30 +0200
SubjectRe: [PATCH] bitops.h: use BITS_PER_LONG to simplify BITS_TO_LONGS
Message-ID<tCG2l-7dm-1@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

Hi, masters

Not sure this one is acceptable?

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@gmail.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

[toc] | [next] | [standalone]


#1634633

FromNeilBrown <neilb@suse.com>
Date2017-05-02 23:50 +0200
Message-ID<tCNQd-3I8-1@gated-at.bofh.it>
In reply to#1634406

[Multipart message — attachments visible in raw view] — view raw

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@gmail.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

[toc] | [prev] | [next] | [standalone]


#1634687

FromWei Yang <richard.weiyang@gmail.com>
Date2017-05-03 03:10 +0200
Message-ID<tCQXL-5Rp-3@gated-at.bofh.it>
In reply to#1634633

[Multipart message — attachments visible in raw view] — view raw

On Wed, May 03, 2017 at 07:45:12AM +1000, NeilBrown wrote:
>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
>

Yep, thanks for your comment :-)

-- 
Wei Yang
Help you, Help me

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web