public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next] RDMA/hfi1: Remove the unneeded result variable
@ 2022-09-01  7:42 cgel.zte
  2022-09-05 12:14 ` Leon Romanovsky
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-09-01  7:42 UTC (permalink / raw)
  To: jgg
  Cc: dennis.dalessandro, leon, linux-rdma, linux-kernel, ye xingchen,
	Zeal Robot

From: ye xingchen <ye.xingchen@zte.com.cn>

Return the value set_link_state() directly instead of storing it in
another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
 drivers/infiniband/hw/hfi1/verbs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c
index ec4f316a28e1..e6e17984553c 100644
--- a/drivers/infiniband/hw/hfi1/verbs.c
+++ b/drivers/infiniband/hw/hfi1/verbs.c
@@ -1447,12 +1447,10 @@ static int shut_down_port(struct rvt_dev_info *rdi, u32 port_num)
 	struct hfi1_ibdev *verbs_dev = dev_from_rdi(rdi);
 	struct hfi1_devdata *dd = dd_from_dev(verbs_dev);
 	struct hfi1_pportdata *ppd = &dd->pport[port_num - 1];
-	int ret;
 
 	set_link_down_reason(ppd, OPA_LINKDOWN_REASON_UNKNOWN, 0,
 			     OPA_LINKDOWN_REASON_UNKNOWN);
-	ret = set_link_state(ppd, HLS_DN_DOWNDEF);
-	return ret;
+	return set_link_state(ppd, HLS_DN_DOWNDEF);
 }
 
 static int hfi1_get_guid_be(struct rvt_dev_info *rdi, struct rvt_ibport *rvp,
-- 
2.25.1

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

* Re: [PATCH linux-next] RDMA/hfi1: Remove the unneeded result variable
  2022-09-01  7:42 [PATCH linux-next] RDMA/hfi1: Remove the unneeded result variable cgel.zte
@ 2022-09-05 12:14 ` Leon Romanovsky
  0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2022-09-05 12:14 UTC (permalink / raw)
  To: cgel.zte
  Cc: jgg, dennis.dalessandro, linux-rdma, linux-kernel, ye xingchen,
	Zeal Robot

On Thu, Sep 01, 2022 at 07:42:09AM +0000, cgel.zte@gmail.com wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> Return the value set_link_state() directly instead of storing it in
> another redundant variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
> ---
>  drivers/infiniband/hw/hfi1/verbs.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 

Thanks, applied.

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

end of thread, other threads:[~2022-09-05 12:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-01  7:42 [PATCH linux-next] RDMA/hfi1: Remove the unneeded result variable cgel.zte
2022-09-05 12:14 ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox