From: Cheng Xu <chengyou@linux.alibaba.com>
To: Advait Dhamorikar <advaitdhamorikar@gmail.com>,
Kai Shen <kaishen@linux.alibaba.com>,
Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>
Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH-next] RDMA/erdma: Fix opcode conditional check
Date: Thu, 19 Dec 2024 13:40:50 +0800 [thread overview]
Message-ID: <37815931-4b7d-35af-fde4-9f3007ee99d9@linux.alibaba.com> (raw)
In-Reply-To: <20241219043939.10344-1-advaitdhamorikar@gmail.com>
On 12/19/24 12:39 PM, Advait Dhamorikar wrote:
> Fix conditional if else check by checking with wr->opcode.
> The indicated dead code may have performed some action; that
> action will never occur as op is pre-assigned a different value.
>
> Signed-off-by: Advait Dhamorikar <advaitdhamorikar@gmail.com>
> ---
> drivers/infiniband/hw/erdma/erdma_qp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com>
Thanks very much,
Cheng Xu
> diff --git a/drivers/infiniband/hw/erdma/erdma_qp.c b/drivers/infiniband/hw/erdma/erdma_qp.c
> index 4dfb4272ad86..5c266918fb36 100644
> --- a/drivers/infiniband/hw/erdma/erdma_qp.c
> +++ b/drivers/infiniband/hw/erdma/erdma_qp.c
> @@ -406,7 +406,7 @@ static void init_send_sqe_rc(struct erdma_qp *qp, struct erdma_send_sqe_rc *sqe,
> if (wr->opcode == IB_WR_SEND_WITH_IMM) {
> op = ERDMA_OP_SEND_WITH_IMM;
> sqe->imm_data = wr->ex.imm_data;
> - } else if (op == IB_WR_SEND_WITH_INV) {
> + } else if (wr->opcode == IB_WR_SEND_WITH_INV) {
> op = ERDMA_OP_SEND_WITH_INV;
> sqe->invalid_stag = cpu_to_le32(wr->ex.invalidate_rkey);
> }
next prev parent reply other threads:[~2024-12-19 5:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-19 4:39 Advait Dhamorikar
2024-12-19 5:40 ` Cheng Xu [this message]
2024-12-19 12:16 ` Leon Romanovsky
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=37815931-4b7d-35af-fde4-9f3007ee99d9@linux.alibaba.com \
--to=chengyou@linux.alibaba.com \
--cc=advaitdhamorikar@gmail.com \
--cc=jgg@ziepe.ca \
--cc=kaishen@linux.alibaba.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
/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®