diff mbox

IB/core: Remove a set-but-not-used variable from ib_sg_to_pages()

Message ID 5682561F.7000400@sandisk.com (mailing list archive)
State Accepted
Headers show

Commit Message

Bart Van Assche Dec. 29, 2015, 9:45 a.m. UTC
Detected this by building the IB core with W=1. See also patch
"IB core: Fix ib_sg_to_pages()" (commit 8f5ba10ed40a).

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: Christoph Hellwig <hch@lst.de>
---
 drivers/infiniband/core/verbs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Leon Romanovsky Dec. 29, 2015, 10:55 a.m. UTC | #1
On Tue, Dec 29, 2015 at 10:45:03AM +0100, Bart Van Assche wrote:
> Detected this by building the IB core with W=1. See also patch
> "IB core: Fix ib_sg_to_pages()" (commit 8f5ba10ed40a).

Reviewed-by: Leon Romanovsky <leon.romanovsky@mellanox.com>

> 
> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
> Cc: Sagi Grimberg <sagig@mellanox.com>
> Cc: Christoph Hellwig <hch@lst.de>
> ---
>  drivers/infiniband/core/verbs.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
> index 545906d..c90ed29 100644
> --- a/drivers/infiniband/core/verbs.c
> +++ b/drivers/infiniband/core/verbs.c
> @@ -1530,7 +1530,7 @@ int ib_sg_to_pages(struct ib_mr *mr,
>  		   int (*set_page)(struct ib_mr *, u64))
>  {
>  	struct scatterlist *sg;
> -	u64 last_end_dma_addr = 0, last_page_addr = 0;
> +	u64 last_end_dma_addr = 0;
>  	unsigned int last_page_off = 0;
>  	u64 page_mask = ~((u64)mr->page_size - 1);
>  	int i, ret;
> @@ -1572,7 +1572,6 @@ next_page:
>  
>  		mr->length += dma_len;
>  		last_end_dma_addr = end_dma_addr;
> -		last_page_addr = end_dma_addr & page_mask;
>  		last_page_off = end_dma_addr & ~page_mask;
>  	}
>  
> -- 
> 2.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sagi Grimberg Dec. 29, 2015, 10:58 a.m. UTC | #2
Thanks Bart,

Acked-by: Sagi Grimberg <sagig@mellanox.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig Dec. 30, 2015, 9:42 a.m. UTC | #3
Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Ledford Jan. 19, 2016, 9:15 p.m. UTC | #4
On 12/29/2015 04:45 AM, Bart Van Assche wrote:
> Detected this by building the IB core with W=1. See also patch
> "IB core: Fix ib_sg_to_pages()" (commit 8f5ba10ed40a).
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
> Cc: Sagi Grimberg <sagig@mellanox.com>
> Cc: Christoph Hellwig <hch@lst.de>
> ---
>  drivers/infiniband/core/verbs.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
> index 545906d..c90ed29 100644
> --- a/drivers/infiniband/core/verbs.c
> +++ b/drivers/infiniband/core/verbs.c
> @@ -1530,7 +1530,7 @@ int ib_sg_to_pages(struct ib_mr *mr,
>  		   int (*set_page)(struct ib_mr *, u64))
>  {
>  	struct scatterlist *sg;
> -	u64 last_end_dma_addr = 0, last_page_addr = 0;
> +	u64 last_end_dma_addr = 0;
>  	unsigned int last_page_off = 0;
>  	u64 page_mask = ~((u64)mr->page_size - 1);
>  	int i, ret;
> @@ -1572,7 +1572,6 @@ next_page:
>  
>  		mr->length += dma_len;
>  		last_end_dma_addr = end_dma_addr;
> -		last_page_addr = end_dma_addr & page_mask;
>  		last_page_off = end_dma_addr & ~page_mask;
>  	}
>  
> 

Thanks, applied.
diff mbox

Patch

diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 545906d..c90ed29 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -1530,7 +1530,7 @@  int ib_sg_to_pages(struct ib_mr *mr,
 		   int (*set_page)(struct ib_mr *, u64))
 {
 	struct scatterlist *sg;
-	u64 last_end_dma_addr = 0, last_page_addr = 0;
+	u64 last_end_dma_addr = 0;
 	unsigned int last_page_off = 0;
 	u64 page_mask = ~((u64)mr->page_size - 1);
 	int i, ret;
@@ -1572,7 +1572,6 @@  next_page:
 
 		mr->length += dma_len;
 		last_end_dma_addr = end_dma_addr;
-		last_page_addr = end_dma_addr & page_mask;
 		last_page_off = end_dma_addr & ~page_mask;
 	}