Skip to content

Commit

Permalink
[SPARC64]: Use "is_power_of_2" macro for simplicity.
Browse files Browse the repository at this point in the history
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Robert P. J. Day authored and David S. Miller committed Nov 7, 2007
1 parent 9c969ff commit 6f78a19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/asm-sparc64/vio.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <linux/spinlock.h>
#include <linux/completion.h>
#include <linux/list.h>
#include <linux/log2.h>

#include <asm/ldc.h>
#include <asm/mdesc.h>
Expand Down Expand Up @@ -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,
unsigned int ring_size)
{
/* Ensure build-time power-of-2. */
BUILD_BUG_ON(ring_size & (ring_size - 1));
BUILD_BUG_ON(!is_power_of_2(ring_size));

return (dr->pending -
((dr->prod - dr->cons) & (ring_size - 1)));
Expand Down

0 comments on commit 6f78a19

Please sign in to comment.