From: Guo Zhengkui <guozhengkui@vivo.com>
To: Mustafa Ismail <mustafa.ismail@intel.com>,
Shiraz Saleem <shiraz.saleem@intel.com>,
Jason Gunthorpe <jgg@ziepe.ca>, Yishai Hadas <yishaih@nvidia.com>,
linux-rdma@vger.kernel.org (open list:INTEL ETHERNET PROTOCOL
DRIVER FOR RDMA), linux-kernel@vger.kernel.org (open list)
Cc: zhengkui_guo@outlook.com, Guo Zhengkui <guozhengkui@vivo.com>
Subject: [PATCH linux-next] RDMA: simplify if-if to if-else
Date: Mon, 28 Mar 2022 21:08:59 +0800 [thread overview]
Message-ID: <20220328130900.8539-1-guozhengkui@vivo.com> (raw)
`if (!ret)` can be replaced with `else` for simplification.
Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
---
drivers/infiniband/hw/irdma/puda.c | 4 ++--
drivers/infiniband/hw/mlx4/mcg.c | 3 +--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/infiniband/hw/irdma/puda.c b/drivers/infiniband/hw/irdma/puda.c
index 397f3d070f90..ee91424eb94a 100644
--- a/drivers/infiniband/hw/irdma/puda.c
+++ b/drivers/infiniband/hw/irdma/puda.c
@@ -842,7 +842,7 @@ static void irdma_puda_free_qp(struct irdma_puda_rsrc *rsrc)
ibdev_dbg(to_ibdev(dev),
"PUDA: error puda qp destroy wqe, status = %d\n",
ret);
- if (!ret) {
+ else {
ret = irdma_sc_poll_for_cqp_op_done(dev->cqp, IRDMA_CQP_OP_DESTROY_QP,
&compl_info);
if (ret)
@@ -871,7 +871,7 @@ static void irdma_puda_free_cq(struct irdma_puda_rsrc *rsrc)
ret = irdma_sc_cq_destroy(&rsrc->cq, 0, true);
if (ret)
ibdev_dbg(to_ibdev(dev), "PUDA: error ieq cq destroy\n");
- if (!ret) {
+ else {
ret = irdma_sc_poll_for_cqp_op_done(dev->cqp, IRDMA_CQP_OP_DESTROY_CQ,
&compl_info);
if (ret)
diff --git a/drivers/infiniband/hw/mlx4/mcg.c b/drivers/infiniband/hw/mlx4/mcg.c
index 33f525b744f2..a8c8d432d0dc 100644
--- a/drivers/infiniband/hw/mlx4/mcg.c
+++ b/drivers/infiniband/hw/mlx4/mcg.c
@@ -304,9 +304,8 @@ static int send_leave_to_wire(struct mcast_group *group, u8 join_state)
ret = send_mad_to_wire(group->demux, (struct ib_mad *)&mad);
if (ret)
group->state = MCAST_IDLE;
-
/* set timeout handler */
- if (!ret) {
+ else {
/* calls mlx4_ib_mcg_timeout_handler */
queue_delayed_work(group->demux->mcg_wq, &group->timeout_work,
msecs_to_jiffies(MAD_TIMEOUT_MS));
--
2.20.1
next reply other threads:[~2022-03-28 13:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-28 13:08 Guo Zhengkui [this message]
2022-03-30 11:02 ` [PATCH linux-next] RDMA: simplify if-if to if-else Leon Romanovsky
2022-03-30 11:06 ` Haakon Bugge
2022-03-30 11:32 ` Leon Romanovsky
2022-03-30 12:26 ` Haakon Bugge
2022-03-30 12:56 ` Leon Romanovsky
2022-03-31 3:03 ` Guo Zhengkui
2022-03-31 9:05 ` Leon Romanovsky
2022-03-31 13:05 ` [PATCH linux-next v2] " Guo Zhengkui
2022-03-31 13:58 ` Saleem, Shiraz
2022-04-04 13:56 ` Jason Gunthorpe
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=20220328130900.8539-1-guozhengkui@vivo.com \
--to=guozhengkui@vivo.com \
--cc=jgg@ziepe.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mustafa.ismail@intel.com \
--cc=shiraz.saleem@intel.com \
--cc=yishaih@nvidia.com \
--cc=zhengkui_guo@outlook.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;
as well as URLs for NNTP newsgroup(s).