Commit 6f78a197 authored by Robert P. J. Day's avatar Robert P. J. Day Committed by David S. Miller

[SPARC64]: Use "is_power_of_2" macro for simplicity.

Signed-off-by: default avatarRobert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9c969ffe
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/log2.h>
#include <asm/ldc.h> #include <asm/ldc.h>
#include <asm/mdesc.h> #include <asm/mdesc.h>
...@@ -257,8 +258,7 @@ static inline void *vio_dring_entry(struct vio_dring_state *dr, ...@@ -257,8 +258,7 @@ static inline void *vio_dring_entry(struct vio_dring_state *dr,
static inline u32 vio_dring_avail(struct vio_dring_state *dr, static inline u32 vio_dring_avail(struct vio_dring_state *dr,
unsigned int ring_size) unsigned int ring_size)
{ {
/* Ensure build-time power-of-2. */ BUILD_BUG_ON(!is_power_of_2(ring_size));
BUILD_BUG_ON(ring_size & (ring_size - 1));
return (dr->pending - return (dr->pending -
((dr->prod - dr->cons) & (ring_size - 1))); ((dr->prod - dr->cons) & (ring_size - 1)));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment