linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IB/core: remove dead code
@ 2016-06-05 20:45 Sudip Mukherjee
  2016-06-06  7:22 ` Leon Romanovsky
  0 siblings, 1 reply; 3+ messages in thread
From: Sudip Mukherjee @ 2016-06-05 20:45 UTC (permalink / raw)
  To: Doug Ledford, Sean Hefty, Hal Rosenstock
  Cc: linux-kernel, linux-rdma, Sudip Mukherjee

prot_sg_cnt has been assigned with the value of ret which we have
already checked to be non-zero so prot_sg_cnt can never be zero at this
point of the code and hence the else part can never execute.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
---
 drivers/infiniband/core/rw.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c
index 1eb9b12..644589b 100644
--- a/drivers/infiniband/core/rw.c
+++ b/drivers/infiniband/core/rw.c
@@ -398,8 +398,6 @@ int rdma_rw_ctx_signature_init(struct rdma_rw_ctx *ctx, struct ib_qp *qp,
 		else
 			prev_wr->next = &ctx->sig->prot.reg_wr.wr;
 		prev_wr = &ctx->sig->prot.reg_wr.wr;
-	} else {
-		ctx->sig->prot.mr = NULL;
 	}
 
 	ctx->sig->sig_mr = ib_mr_pool_get(qp, &qp->sig_mrs);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] IB/core: remove dead code
  2016-06-05 20:45 [PATCH] IB/core: remove dead code Sudip Mukherjee
@ 2016-06-06  7:22 ` Leon Romanovsky
  2016-06-06  8:50   ` Sudip Mukherjee
  0 siblings, 1 reply; 3+ messages in thread
From: Leon Romanovsky @ 2016-06-06  7:22 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Doug Ledford, Sean Hefty, Hal Rosenstock, linux-kernel, linux-rdma

[-- Attachment #1: Type: text/plain, Size: 1284 bytes --]

On Sun, Jun 05, 2016 at 09:45:52PM +0100, Sudip Mukherjee wrote:
> prot_sg_cnt has been assigned with the value of ret which we have
> already checked to be non-zero so prot_sg_cnt can never be zero at this
> point of the code and hence the else part can never execute.
> 
> Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
> ---
>  drivers/infiniband/core/rw.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c
> index 1eb9b12..644589b 100644
> --- a/drivers/infiniband/core/rw.c
> +++ b/drivers/infiniband/core/rw.c
> @@ -398,8 +398,6 @@ int rdma_rw_ctx_signature_init(struct rdma_rw_ctx *ctx, struct ib_qp *qp,
>  		else
>  			prev_wr->next = &ctx->sig->prot.reg_wr.wr;
>  		prev_wr = &ctx->sig->prot.reg_wr.wr;
> -	} else {
> -		ctx->sig->prot.mr = NULL;
>  	}

You need to remove the "if (prot_sg_cnt) {" line too. There is no need
in it after you removed "else" case.

Thanks

>  
>  	ctx->sig->sig_mr = ib_mr_pool_get(qp, &qp->sig_mrs);
> -- 
> 1.9.1
> 
> --
> 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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] IB/core: remove dead code
  2016-06-06  7:22 ` Leon Romanovsky
@ 2016-06-06  8:50   ` Sudip Mukherjee
  0 siblings, 0 replies; 3+ messages in thread
From: Sudip Mukherjee @ 2016-06-06  8:50 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Doug Ledford, Sean Hefty, Hal Rosenstock, linux-kernel, linux-rdma

On Mon, Jun 06, 2016 at 10:22:43AM +0300, Leon Romanovsky wrote:
> On Sun, Jun 05, 2016 at 09:45:52PM +0100, Sudip Mukherjee wrote:
> > prot_sg_cnt has been assigned with the value of ret which we have
> > already checked to be non-zero so prot_sg_cnt can never be zero at this
> > point of the code and hence the else part can never execute.
> > 
> > Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
> > ---
> >  drivers/infiniband/core/rw.c | 2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c
> > index 1eb9b12..644589b 100644
> > --- a/drivers/infiniband/core/rw.c
> > +++ b/drivers/infiniband/core/rw.c
> > @@ -398,8 +398,6 @@ int rdma_rw_ctx_signature_init(struct rdma_rw_ctx *ctx, struct ib_qp *qp,
> >  		else
> >  			prev_wr->next = &ctx->sig->prot.reg_wr.wr;
> >  		prev_wr = &ctx->sig->prot.reg_wr.wr;
> > -	} else {
> > -		ctx->sig->prot.mr = NULL;
> >  	}
> 
> You need to remove the "if (prot_sg_cnt) {" line too. There is no need
> in it after you removed "else" case.

ohhh, ofcourse. How silly of me.. :(
will send v2 tonight.

regards
sudip

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-06  8:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-05 20:45 [PATCH] IB/core: remove dead code Sudip Mukherjee
2016-06-06  7:22 ` Leon Romanovsky
2016-06-06  8:50   ` Sudip Mukherjee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).