aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-06-21 14:00:41 +0200
committerTakashi Iwai <tiwai@suse.de>2018-06-21 14:00:41 +0200
commit8b9600eeba31c3b9e0f723d30a67d7f28616c578 (patch)
tree7cab77643e5905e72e191178c2ef24e706949624
parentb7734ec4cf432f6bdb2ce3456fc748e15cd95fbd (diff)
downloadhda-emu-8b9600eeba31c3b9e0f723d30a67d7f28616c578.tar.gz
Fix gcc8 warnings with log2.h
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--include/linux/log2.h11
1 files changed, 2 insertions, 9 deletions
diff --git a/include/linux/log2.h b/include/linux/log2.h
index d208c34..c506e7e 100644
--- a/include/linux/log2.h
+++ b/include/linux/log2.h
@@ -2,12 +2,6 @@
#define _LINUX_LOG2_H
/*
- * deal with unrepresentable constant logarithms
- */
-extern __attribute__((const, noreturn))
-int ____ilog2_NaN(void);
-
-/*
* Determine whether some value is a power of two, where zero is
* *not* considered a power of two.
*/
@@ -30,7 +24,7 @@ bool is_power_of_2(unsigned long n)
*/
#define ilog2(n) \
( \
- (n) < 1 ? ____ilog2_NaN() : \
+ (n) < 2 ? 0 : \
(n) & (1ULL << 63) ? 63 : \
(n) & (1ULL << 62) ? 62 : \
(n) & (1ULL << 61) ? 61 : \
@@ -94,8 +88,7 @@ bool is_power_of_2(unsigned long n)
(n) & (1ULL << 3) ? 3 : \
(n) & (1ULL << 2) ? 2 : \
(n) & (1ULL << 1) ? 1 : \
- (n) & (1ULL << 0) ? 0 : \
- ____ilog2_NaN() \
+ 0 \
)
/**