Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 1/3] bitops: Fix big endian compilation
@ 2018-11-05 19:06 Rosen Penev
  2018-11-05 19:06 ` [PATCH 2/3] task-utils: Fix comparison between pointer and integer Rosen Penev
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Rosen Penev @ 2018-11-05 19:06 UTC (permalink / raw)
  To: linux-btrfs

Replaced bswap with _ variants. While it's a glibc extension, all of the
popular libc implementations (glibc, uClibc, musl, BIONIC) seem to support
it.

Added static inline to two functions to match little endian variants. This
fixes a linking error experienced when compiling.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 kernel-lib/bitops.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel-lib/bitops.h b/kernel-lib/bitops.h
index b1fd6f5..2c51a26 100644
--- a/kernel-lib/bitops.h
+++ b/kernel-lib/bitops.h
@@ -178,9 +178,9 @@ static inline unsigned long find_next_zero_bit(const unsigned long *addr,
 static inline unsigned long ext2_swab(const unsigned long y)
 {
 #if BITS_PER_LONG == 64
-	return (unsigned long) bswap64((u64) y);
+	return (unsigned long) bswap_64((u64) y);
 #elif BITS_PER_LONG == 32
-	return (unsigned long) bswap32((u32) y);
+	return (unsigned long) bswap_32((u32) y);
 #else
 #error BITS_PER_LONG not defined
 #endif
@@ -218,14 +218,14 @@ static inline unsigned long _find_next_bit_le(const unsigned long *addr1,
 	return min(start + __ffs(ext2_swab(tmp)), nbits);
 }
 
-unsigned long find_next_zero_bit_le(const void *addr, unsigned long size,
+static inline unsigned long find_next_zero_bit_le(const void *addr, unsigned long size,
 		unsigned long offset)
 {
 	return _find_next_bit_le(addr, NULL, size, offset, ~0UL);
 }
 
 
-unsigned long find_next_bit_le(const void *addr, unsigned long size,
+static inline unsigned long find_next_bit_le(const void *addr, unsigned long size,
 		unsigned long offset)
 {
 	return _find_next_bit_le(addr, NULL, size, offset, 0UL);
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-11-13 12:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-05 19:06 [PATCH 1/3] bitops: Fix big endian compilation Rosen Penev
2018-11-05 19:06 ` [PATCH 2/3] task-utils: Fix comparison between pointer and integer Rosen Penev
2018-11-05 21:35   ` Nikolay Borisov
2018-11-05 19:06 ` [PATCH 3/3] treewide: Fix missing declarations Rosen Penev
2018-11-05 21:29   ` Nikolay Borisov
2018-11-05 21:31 ` [PATCH 1/3] bitops: Fix big endian compilation Nikolay Borisov
2018-11-05 21:42   ` Rosen Penev
2018-11-06  6:27     ` Nikolay Borisov
2018-11-13 12:34 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox