aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64/vio.h
diff options
context:
space:
mode:
authorRobert P. J. Day <rpjday@crashcourse.ca>2007-11-07 05:24:33 -0500
committerDavid S. Miller <davem@davemloft.net>2007-11-07 05:24:33 -0500
commit6f78a19702574008bbd333237380fa85be1c9e5d (patch)
tree4f25e2fa7e46d630dd70f5be341d27540cb30126 /include/asm-sparc64/vio.h
parent9c969ffe1f1bb349e118a299f76f6bb0bbd6b05a (diff)
[SPARC64]: Use "is_power_of_2" macro for simplicity.
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/asm-sparc64/vio.h')
-rw-r--r--include/asm-sparc64/vio.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asm-sparc64/vio.h b/include/asm-sparc64/vio.h
index f7417e91b170..d4de32f0f8af 100644
--- a/include/asm-sparc64/vio.h
+++ b/include/asm-sparc64/vio.h
@@ -8,6 +8,7 @@
8#include <linux/spinlock.h> 8#include <linux/spinlock.h>
9#include <linux/completion.h> 9#include <linux/completion.h>
10#include <linux/list.h> 10#include <linux/list.h>
11#include <linux/log2.h>
11 12
12#include <asm/ldc.h> 13#include <asm/ldc.h>
13#include <asm/mdesc.h> 14#include <asm/mdesc.h>
@@ -257,8 +258,7 @@ static inline void *vio_dring_entry(struct vio_dring_state *dr,
257static inline u32 vio_dring_avail(struct vio_dring_state *dr, 258static inline u32 vio_dring_avail(struct vio_dring_state *dr,
258 unsigned int ring_size) 259 unsigned int ring_size)
259{ 260{
260 /* Ensure build-time power-of-2. */ 261 BUILD_BUG_ON(!is_power_of_2(ring_size));
261 BUILD_BUG_ON(ring_size & (ring_size - 1));
262 262
263 return (dr->pending - 263 return (dr->pending -
264 ((dr->prod - dr->cons) & (ring_size - 1))); 264 ((dr->prod - dr->cons) & (ring_size - 1)));