From: Wei Yang <richard.weiyang@gmail.com>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: shli@fb.com, neilb@suse.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bitops.h: use BITS_PER_LONG to simplify BITS_TO_LONGS
Date: Tue, 2 May 2017 21:28:23 +0800 [thread overview]
Message-ID: <20170502132823.GB7654@WeideMacBook-Pro.local> (raw)
In-Reply-To: <20170318003743.24639-1-richard.weiyang@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 985 bytes --]
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2017-05-02 13:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-18 0:37 [PATCH] bitops.h: use BITS_PER_LONG to simplify BITS_TO_LONGS Wei Yang
2017-05-02 13:28 ` Wei Yang [this message]
2017-05-02 21:45 ` NeilBrown
2017-05-03 1:06 ` Wei Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170502132823.GB7654@WeideMacBook-Pro.local \
--to=richard.weiyang@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=neilb@suse.com \
--cc=shli@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox