mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: zys.zljxml@gmail.com, bharat@chelsio.com
Cc: jgg@ziepe.ca, linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Yushan Zhou <katrinzhou@tencent.com>
Subject: Re: [PATCH] RDMA/cxgb4: Cleanup unused assignments
Date: Thu, 21 Jul 2022 10:17:56 +0300	[thread overview]
Message-ID: <Ytj9pHgPmp9rYeku@unreal> (raw)
In-Reply-To: <20220719090948.612921-1-zys.zljxml@gmail.com>

On Tue, Jul 19, 2022 at 05:09:48PM +0800, zys.zljxml@gmail.com wrote:
> From: Yushan Zhou <katrinzhou@tencent.com>
> 
> The variable err is reassigned before the assigned value works.
> Cleanup unused assignments reported by Coverity.
> 
> Addresses-Coverity: ("UNUSED_VALUE")
> Signed-off-by: Yushan Zhou <katrinzhou@tencent.com>
> ---
>  drivers/infiniband/hw/cxgb4/cm.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
> index c16017f6e8db..3462fe991f93 100644
> --- a/drivers/infiniband/hw/cxgb4/cm.c
> +++ b/drivers/infiniband/hw/cxgb4/cm.c
> @@ -1590,7 +1590,6 @@ static int process_mpa_reply(struct c4iw_ep *ep, struct sk_buff *skb)
>  					insuff_ird = 1;
>  			}
>  			if (insuff_ird) {
> -				err = -ENOMEM;
>  				ep->ird = resp_ord;
>  				ep->ord = resp_ird;
>  			}
> @@ -1655,7 +1654,7 @@ static int process_mpa_reply(struct c4iw_ep *ep, struct sk_buff *skb)
>  		attrs.ecode = MPA_NOMATCH_RTR;
>  		attrs.next_state = C4IW_QP_STATE_TERMINATE;
>  		attrs.send_term = 1;
> -		err = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp,
> +		c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp,
>  				C4IW_QP_ATTR_NEXT_STATE, &attrs, 1);
>  		err = -ENOMEM;

I would prefer do not overwrite errors returned from the functions
unless it is really necessary.

Can anyone from chelsio help here?

Thanks

>  		disconnect = 1;
> @@ -1674,7 +1673,7 @@ static int process_mpa_reply(struct c4iw_ep *ep, struct sk_buff *skb)
>  		attrs.ecode = MPA_INSUFF_IRD;
>  		attrs.next_state = C4IW_QP_STATE_TERMINATE;
>  		attrs.send_term = 1;
> -		err = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp,
> +		c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp,
>  				C4IW_QP_ATTR_NEXT_STATE, &attrs, 1);
>  		err = -ENOMEM;
>  		disconnect = 1;
> -- 
> 2.27.0
> 

  reply	other threads:[~2022-07-21  7:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-19  9:09 zys.zljxml
2022-07-21  7:17 ` Leon Romanovsky [this message]
2022-07-22  4:47   ` Katrin Jo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Ytj9pHgPmp9rYeku@unreal \
    --to=leon@kernel.org \
    --cc=bharat@chelsio.com \
    --cc=jgg@ziepe.ca \
    --cc=katrinzhou@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=zys.zljxml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®