diff mbox series

[-next] RDMA/bnxt_re: Remove set but not used variable 'pg_size'

Message ID 20200227064209.87893-1-yuehaibing@huawei.com (mailing list archive)
State Mainlined
Commit 6be2067d1e31477354b08d1ac85ff9ec6dec898e
Delegated to: Jason Gunthorpe
Headers show
Series [-next] RDMA/bnxt_re: Remove set but not used variable 'pg_size' | expand

Commit Message

Yue Haibing Feb. 27, 2020, 6:42 a.m. UTC
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/infiniband/hw/bnxt_re/qplib_res.c: In function '__alloc_pbl':
drivers/infiniband/hw/bnxt_re/qplib_res.c:109:13: warning:
 variable 'pg_size' set but not used [-Wunused-but-set-variable]

commit 0c4dcd602817 ("RDMA/bnxt_re: Refactor hardware queue memory allocation")
involved this, but not used, so remove it.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/infiniband/hw/bnxt_re/qplib_res.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Jason Gunthorpe Feb. 28, 2020, 4:43 p.m. UTC | #1
On Thu, Feb 27, 2020 at 06:42:09AM +0000, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/infiniband/hw/bnxt_re/qplib_res.c: In function '__alloc_pbl':
> drivers/infiniband/hw/bnxt_re/qplib_res.c:109:13: warning:
>  variable 'pg_size' set but not used [-Wunused-but-set-variable]
> 
> commit 0c4dcd602817 ("RDMA/bnxt_re: Refactor hardware queue memory allocation")
> involved this, but not used, so remove it.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/infiniband/hw/bnxt_re/qplib_res.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Applied to for-next, thanks

Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.c b/drivers/infiniband/hw/bnxt_re/qplib_res.c
index fc5909c7f2e0..cab1adf1fed9 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_res.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_res.c
@@ -106,13 +106,12 @@  static int __alloc_pbl(struct bnxt_qplib_res *res,
 	struct pci_dev *pdev = res->pdev;
 	struct scatterlist *sghead;
 	bool is_umem = false;
-	u32 pages, pg_size;
+	u32 pages;
 	int i;
 
 	if (sginfo->nopte)
 		return 0;
 	pages = sginfo->npages;
-	pg_size = sginfo->pgsize;
 	sghead = sginfo->sghead;
 	/* page ptr arrays */
 	pbl->pg_arr = vmalloc(pages * sizeof(void *));