From: zijun_hu <zijun_hu@zoho.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: sfr@canb.auug.org.au, linux-kernel@vger.kernel.org
Subject: [PATCH 1/1] bitops.h: move out get_count_order[_long]() from __KERNEL__ scope
Date: Tue, 16 Aug 2016 14:27:04 +0800 [thread overview]
Message-ID: <57B2B238.3030709@zoho.com> (raw)
From: zijun_hu <zijun_hu@htc.com>
move out get_count_order[_long]() definitions from scope limited
by macro __KERNEL__
Signed-off-by: zijun_hu <zijun_hu@htc.com>
---
this patch is based on the newest mmotm/linux-next tree and can
be applied directly
include/linux/bitops.h | 52 +++++++++++++++++++++++++-------------------------
1 file changed, 26 insertions(+), 26 deletions(-)
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 6f202c8fe4a6..a83c822c35c2 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -181,6 +181,32 @@ static inline unsigned fls_long(unsigned long l)
return fls64(l);
}
+static inline int get_count_order(unsigned int count)
+{
+ int order;
+
+ order = fls(count) - 1;
+ if (count & (count - 1))
+ order++;
+ return order;
+}
+
+/**
+ * get_count_order_long - get order after rounding @l up to power of 2
+ * @l: parameter
+ *
+ * it is same as get_count_order() but with long type parameter
+ */
+static inline int get_count_order_long(unsigned long l)
+{
+ if (l == 0UL)
+ return -1;
+ else if (l & (l - 1UL))
+ return (int)fls_long(l);
+ else
+ return (int)fls_long(l) - 1;
+}
+
/**
* __ffs64 - find first set bit in a 64 bit word
* @word: The 64 bit word
@@ -233,32 +259,6 @@ static inline unsigned long __ffs64(u64 word)
})
#endif
-static inline int get_count_order(unsigned int count)
-{
- int order;
-
- order = fls(count) - 1;
- if (count & (count - 1))
- order++;
- return order;
-}
-
-/**
- * get_count_order_long - get order after rounding @l up to power of 2
- * @l: parameter
- *
- * it is same as get_count_order() but with long type parameter
- */
-static inline int get_count_order_long(unsigned long l)
-{
- if (l == 0UL)
- return -1;
- else if (l & (l - 1UL))
- return (int)fls_long(l);
- else
- return (int)fls_long(l) - 1;
-}
-
#ifndef find_last_bit
/**
* find_last_bit - find the last set bit in a memory region
--
1.9.1
next reply other threads:[~2016-08-16 6:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-16 6:27 zijun_hu [this message]
2016-08-16 6:50 ` [PATCH 1/1] bitops.h: move out get_count_order[_long]() from __KERNEL__ scope Stephen Rothwell
2016-08-16 7:24 ` zijun_hu
2016-08-16 7:46 ` [RESEND PATCH " zijun_hu
2016-08-17 17:20 ` Al Viro
2016-08-17 23:51 ` zijun_hu
2016-08-17 23:59 ` Al Viro
2016-08-18 0:10 ` zijun_hu
2016-08-18 0:28 ` Al Viro
2016-08-18 0:50 ` zijun_hu
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=57B2B238.3030709@zoho.com \
--to=zijun_hu@zoho.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/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