From a844f4510dce23c07f3923cb42138f5fdd745017 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Wed, 2 Nov 2005 14:38:42 +1100 Subject: [XFS] Remove xfs_macros.c, xfs_macros.h, rework headers a whole lot. SGI-PV: 943122 SGI-Modid: xfs-linux:xfs-kern:23901a Signed-off-by: Nathan Scott --- fs/xfs/xfs_bit.h | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) (limited to 'fs/xfs/xfs_bit.h') diff --git a/fs/xfs/xfs_bit.h b/fs/xfs/xfs_bit.h index 1e7f57ddf7a..041e8248506 100644 --- a/fs/xfs/xfs_bit.h +++ b/fs/xfs/xfs_bit.h @@ -39,30 +39,26 @@ /* * masks with n high/low bits set, 32-bit values & 64-bit values */ -#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MASK32HI) -__uint32_t xfs_mask32hi(int n); #define XFS_MASK32HI(n) xfs_mask32hi(n) -#else -#define XFS_MASK32HI(n) ((__uint32_t)-1 << (32 - (n))) -#endif -#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MASK64HI) -__uint64_t xfs_mask64hi(int n); +static inline __uint32_t xfs_mask32hi(int n) +{ + return (__uint32_t)-1 << (32 - (n)); +} #define XFS_MASK64HI(n) xfs_mask64hi(n) -#else -#define XFS_MASK64HI(n) ((__uint64_t)-1 << (64 - (n))) -#endif -#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MASK32LO) -__uint32_t xfs_mask32lo(int n); +static inline __uint64_t xfs_mask64hi(int n) +{ + return (__uint64_t)-1 << (64 - (n)); +} #define XFS_MASK32LO(n) xfs_mask32lo(n) -#else -#define XFS_MASK32LO(n) (((__uint32_t)1 << (n)) - 1) -#endif -#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MASK64LO) -__uint64_t xfs_mask64lo(int n); +static inline __uint32_t xfs_mask32lo(int n) +{ + return ((__uint32_t)1 << (n)) - 1; +} #define XFS_MASK64LO(n) xfs_mask64lo(n) -#else -#define XFS_MASK64LO(n) (((__uint64_t)1 << (n)) - 1) -#endif +static inline __uint64_t xfs_mask64lo(int n) +{ + return ((__uint64_t)1 << (n)) - 1; +} /* Get high bit set out of 32-bit argument, -1 if none set */ extern int xfs_highbit32(__uint32_t v); -- cgit v1.2.3