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 .