Loading drivers/net/mlx4/alloc.c +2 −1 Original line number Original line Diff line number Diff line Loading @@ -178,6 +178,7 @@ int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, } else { } else { int i; int i; buf->direct.buf = NULL; buf->nbufs = (size + PAGE_SIZE - 1) / PAGE_SIZE; buf->nbufs = (size + PAGE_SIZE - 1) / PAGE_SIZE; buf->npages = buf->nbufs; buf->npages = buf->nbufs; buf->page_shift = PAGE_SHIFT; buf->page_shift = PAGE_SHIFT; Loading Loading @@ -229,7 +230,7 @@ void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf) dma_free_coherent(&dev->pdev->dev, size, buf->direct.buf, dma_free_coherent(&dev->pdev->dev, size, buf->direct.buf, buf->direct.map); buf->direct.map); else { else { if (BITS_PER_LONG == 64) if (BITS_PER_LONG == 64 && buf->direct.buf) vunmap(buf->direct.buf); vunmap(buf->direct.buf); for (i = 0; i < buf->nbufs; ++i) for (i = 0; i < buf->nbufs; ++i) Loading Loading
drivers/net/mlx4/alloc.c +2 −1 Original line number Original line Diff line number Diff line Loading @@ -178,6 +178,7 @@ int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, } else { } else { int i; int i; buf->direct.buf = NULL; buf->nbufs = (size + PAGE_SIZE - 1) / PAGE_SIZE; buf->nbufs = (size + PAGE_SIZE - 1) / PAGE_SIZE; buf->npages = buf->nbufs; buf->npages = buf->nbufs; buf->page_shift = PAGE_SHIFT; buf->page_shift = PAGE_SHIFT; Loading Loading @@ -229,7 +230,7 @@ void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf) dma_free_coherent(&dev->pdev->dev, size, buf->direct.buf, dma_free_coherent(&dev->pdev->dev, size, buf->direct.buf, buf->direct.map); buf->direct.map); else { else { if (BITS_PER_LONG == 64) if (BITS_PER_LONG == 64 && buf->direct.buf) vunmap(buf->direct.buf); vunmap(buf->direct.buf); for (i = 0; i < buf->nbufs; ++i) for (i = 0; i < buf->nbufs; ++i) Loading