Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: oulijun <oulijun@huawei.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <linux-rdma@vger.kernel.org>
Subject: Re: [bug report] RDMA/hns: Avoid unncessary initialization
Date: Thu, 17 Sep 2020 22:11:44 +0800	[thread overview]
Message-ID: <3dbe4539-2c7a-1ef2-3923-0f18567d4265@huawei.com> (raw)
In-Reply-To: <20200916143940.GA766708@mwanda>

Thanks. I will fix it.

在 2020/9/16 22:39, Dan Carpenter 写道:
> Hello Lijun Ou,
>
> The patch a2f3d4479fe9: "RDMA/hns: Avoid unncessary initialization"
> from Sep 8, 2020, leads to the following static checker warning:
>
> 	drivers/infiniband/hw/hns/hns_roce_hw_v1.c:282 hns_roce_v1_post_send()
> 	error: uninitialized symbol 'ps_opcode'.
>
> drivers/infiniband/hw/hns/hns_roce_hw_v1.c
>     256                          switch (wr->opcode) {
>     257                          case IB_WR_RDMA_READ:
>     258                                  ps_opcode = HNS_ROCE_WQE_OPCODE_RDMA_READ;
>     259                                  set_raddr_seg(wqe,  rdma_wr(wr)->remote_addr,
>     260                                                 rdma_wr(wr)->rkey);
>     261                                  break;
>     262                          case IB_WR_RDMA_WRITE:
>     263                          case IB_WR_RDMA_WRITE_WITH_IMM:
>     264                                  ps_opcode = HNS_ROCE_WQE_OPCODE_RDMA_WRITE;
>     265                                  set_raddr_seg(wqe,  rdma_wr(wr)->remote_addr,
>     266                                                rdma_wr(wr)->rkey);
>     267                                  break;
>     268                          case IB_WR_SEND:
>     269                          case IB_WR_SEND_WITH_INV:
>     270                          case IB_WR_SEND_WITH_IMM:
>     271                                  ps_opcode = HNS_ROCE_WQE_OPCODE_SEND;
>     272                                  break;
>     273                          case IB_WR_LOCAL_INV:
>                                  ^^^^^^^^^^^^^^^^^^^^
> "ps_opcode" is not initialized for this case statement.
>
>     274                                  break;
>     275                          case IB_WR_ATOMIC_CMP_AND_SWP:
>     276                          case IB_WR_ATOMIC_FETCH_AND_ADD:
>     277                          case IB_WR_LSO:
>     278                          default:
>     279                                  ps_opcode = HNS_ROCE_WQE_OPCODE_MASK;
>     280                                  break;
>     281                          }
>     282                          ctrl->flag |= cpu_to_le32(ps_opcode);
>                                                            ^^^^^^^^^
> Uninitialized.
>
>     283                          wqe += sizeof(struct hns_roce_wqe_raddr_seg);
>     284
>     285                          dseg = wqe;
>
> regards,
> dan carpenter
> .
>


      reply	other threads:[~2020-09-17 14:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16 14:39 [bug report] RDMA/hns: Avoid unncessary initialization Dan Carpenter
2020-09-17 14:11 ` oulijun [this message]

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=3dbe4539-2c7a-1ef2-3923-0f18567d4265@huawei.com \
    --to=oulijun@huawei.com \
    --cc=dan.carpenter@oracle.com \
    --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