diff options
author | Pekka Enberg <penberg@kernel.org> | 2015-05-15 21:40:20 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-31 09:19:37 +0900 |
commit | 322489d9d551d20bfa69feef85729b82dc2edebc (patch) | |
tree | d4b46c962a0895fba6000bddfff739773211a575 | |
parent | 36fc24486910d492881f279cb97ad33b69859ebd (diff) | |
download | op-kernel-dev-322489d9d551d20bfa69feef85729b82dc2edebc.zip op-kernel-dev-322489d9d551d20bfa69feef85729b82dc2edebc.tar.gz |
staging/lustre: Use roundup_pow_of_two() in LNetEQAlloc()
Use roundup_pow_of_two() and drop the private cfs_power2_roundup()
implementation.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/lustre/include/linux/libcfs/libcfs_private.h | 13 | ||||
-rw-r--r-- | drivers/staging/lustre/lnet/lnet/lib-eq.c | 2 |
2 files changed, 1 insertions, 14 deletions
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h index fef8825..d8f8543 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h @@ -496,19 +496,6 @@ static inline size_t cfs_round_strlen(char *fset) return (size_t)cfs_size_round((int)strlen(fset) + 1); } -/* roundup \a val to power2 */ -static inline unsigned int cfs_power2_roundup(unsigned int val) -{ - if (val != LOWEST_BIT_SET(val)) { /* not a power of 2 already */ - do { - val &= ~LOWEST_BIT_SET(val); - } while (val != LOWEST_BIT_SET(val)); - /* ...and round up */ - val <<= 1; - } - return val; -} - #define LOGL(var, len, ptr) \ do { \ if (var) \ diff --git a/drivers/staging/lustre/lnet/lnet/lib-eq.c b/drivers/staging/lustre/lnet/lnet/lib-eq.c index 5470148..1221c0b 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-eq.c +++ b/drivers/staging/lustre/lnet/lnet/lib-eq.c @@ -79,7 +79,7 @@ LNetEQAlloc(unsigned int count, lnet_eq_handler_t callback, * overflow, they don't skip entries, so the queue has the same * apparent capacity at all times */ - count = cfs_power2_roundup(count); + count = roundup_pow_of_two(count); if (callback != LNET_EQ_HANDLER_NONE && count != 0) CWARN("EQ callback is guaranteed to get every event, do you still want to set eqcount %d for polling event which will have locking overhead? Please contact with developer to confirm\n", count); |