Use the standard powerof2() macro from param.h instead of a local one.

Pointed out by:	 jhb@
This commit is contained in:
Ian Lepore 2014-11-15 02:58:17 +00:00
parent adcdc8f290
commit 3aa1219d0c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=274536

View File

@ -64,8 +64,6 @@ __FBSDID("$FreeBSD$");
#include <machine/cpufunc.h>
#include <machine/md_var.h>
#define IS_POWER_OF_2(val) (((val) & ((val) - 1)) == 0)
#define MAX_BPAGES 64
#define MAX_DMA_SEGMENTS 4096
#define BUS_DMA_EXCL_BOUNCE BUS_DMA_BUS2
@ -469,11 +467,11 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
#endif
/* Basic sanity checking. */
KASSERT(boundary == 0 || IS_POWER_OF_2(boundary),
KASSERT(boundary == 0 || powerof2(boundary),
("dma tag boundary %lu, must be a power of 2", boundary));
KASSERT(boundary == 0 || boundary >= maxsegsz,
("dma tag boundary %lu is < maxsegsz %lu\n", boundary, maxsegsz));
KASSERT(alignment != 0 && IS_POWER_OF_2(alignment),
KASSERT(alignment != 0 && powerof2(alignment),
("dma tag alignment %lu, must be non-zero power of 2", alignment));
KASSERT(maxsegsz != 0, ("dma tag maxsegsz must not be zero"));