]> err.no Git - linux-2.6/blobdiff - drivers/net/mlx4/alloc.c
Merge branch 'upstream-jeff' of git://git.kernel.org/pub/scm/linux/kernel/git/romieu...
[linux-2.6] / drivers / net / mlx4 / alloc.c
index 9ffdb9d29da931a3d3ccf81358db4a0c080783a6..f8d63d39f59246bc80da046ee72963e2303c8644 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/errno.h>
 #include <linux/slab.h>
 #include <linux/bitmap.h>
+#include <linux/dma-mapping.h>
 
 #include "mlx4.h"
 
@@ -50,8 +51,8 @@ u32 mlx4_bitmap_alloc(struct mlx4_bitmap *bitmap)
 
        if (obj < bitmap->max) {
                set_bit(obj, bitmap->table);
+               bitmap->last = (obj + 1) & (bitmap->max - 1);
                obj |= bitmap->top;
-               bitmap->last = obj + 1;
        } else
                obj = -1;