[openib-general] [PATCH 2/7] AMSO1100 Low Level Driver
Tom Tucker
tom at opengridcomputing.com
Thu Mar 9 13:56:19 PST 2006
Thanks, applied
On Wed, 2006-03-08 at 12:31 -0800, Roland Dreier wrote:
> > +#define C2_ROUNDUP(__a, __s) (((__a) + (__s-1)) & ~(__s-1))
>
> Duplicates ALIGN() in <linux/kernel.h>. Patch below...
>
> --- infiniband/hw/amso1100/c2.h (revision 5693)
> +++ infiniband/hw/amso1100/c2.h (working copy)
> @@ -83,8 +83,6 @@
> #define C2_TXP_HTXDQ_SIZE (4096)
> #define C2_TX_TIMEOUT (6*HZ)
>
> -#define C2_ROUNDUP(__a, __s) (((__a) + (__s-1)) & ~(__s-1))
> -
> /* CEPHEUS */
> static const u8 c2_magic[] = {
> 0x43, 0x45, 0x50, 0x48, 0x45, 0x55, 0x53
> --- infiniband/hw/amso1100/c2_provider.c (revision 5693)
> +++ infiniband/hw/amso1100/c2_provider.c (working copy)
> @@ -379,8 +379,8 @@ static struct ib_mr *c2_reg_phys_mr(stru
> }
>
> total_len += buffer_list[i].size;
> - pbl_depth += C2_ROUNDUP(buffer_list[i].size,
> - (1 << page_shift)) >> page_shift;
> + pbl_depth += ALIGN(buffer_list[i].size,
> + (1 << page_shift)) >> page_shift;
> }
>
> page_list = vmalloc(sizeof(u64) * pbl_depth);
> @@ -394,8 +394,8 @@ static struct ib_mr *c2_reg_phys_mr(stru
>
> int naddrs;
>
> - naddrs = C2_ROUNDUP(buffer_list[i].size,
> - (1 << page_shift)) >> page_shift;
> + naddrs = ALIGN(buffer_list[i].size,
> + (1 << page_shift)) >> page_shift;
> for (k = 0; k < naddrs; k++)
> page_list[j++] = (buffer_list[i].addr +
> (k << page_shift));
More information about the general
mailing list