tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 21ef7b1e17d039053edaeaf41142423810572741 commit: 272bba19d631e21e47f6ffa5654d3c17c57ea2ac [5279/8441] RDMA: Remove unnecessary ternary operators config: loongarch-randconfig-r091-20230810 (https://download.01.org/0day-ci/archive/20230811/202308110251.BV6BcwUR-lkp@xxxxxxxxx/config) compiler: loongarch64-linux-gcc (GCC) 12.3.0 reproduce: (https://download.01.org/0day-ci/archive/20230811/202308110251.BV6BcwUR-lkp@xxxxxxxxx/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202308110251.BV6BcwUR-lkp@xxxxxxxxx/ sparse warnings: (new ones prefixed by >>) >> drivers/infiniband/hw/irdma/uk.c:285:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected bool [usertype] push_wqe:1 @@ got restricted __le32 [usertype] *push_db @@ drivers/infiniband/hw/irdma/uk.c:285:24: sparse: expected bool [usertype] push_wqe:1 drivers/infiniband/hw/irdma/uk.c:285:24: sparse: got restricted __le32 [usertype] *push_db drivers/infiniband/hw/irdma/uk.c:386:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected bool [usertype] push_wqe:1 @@ got restricted __le32 [usertype] *push_db @@ drivers/infiniband/hw/irdma/uk.c:386:24: sparse: expected bool [usertype] push_wqe:1 drivers/infiniband/hw/irdma/uk.c:386:24: sparse: got restricted __le32 [usertype] *push_db drivers/infiniband/hw/irdma/uk.c:471:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected bool [usertype] push_wqe:1 @@ got restricted __le32 [usertype] *push_db @@ drivers/infiniband/hw/irdma/uk.c:471:24: sparse: expected bool [usertype] push_wqe:1 drivers/infiniband/hw/irdma/uk.c:471:24: sparse: got restricted __le32 [usertype] *push_db drivers/infiniband/hw/irdma/uk.c:723:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected bool [usertype] push_wqe:1 @@ got restricted __le32 [usertype] *push_db @@ drivers/infiniband/hw/irdma/uk.c:723:24: sparse: expected bool [usertype] push_wqe:1 drivers/infiniband/hw/irdma/uk.c:723:24: sparse: got restricted __le32 [usertype] *push_db drivers/infiniband/hw/irdma/uk.c:797:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected bool [usertype] push_wqe:1 @@ got restricted __le32 [usertype] *push_db @@ drivers/infiniband/hw/irdma/uk.c:797:24: sparse: expected bool [usertype] push_wqe:1 drivers/infiniband/hw/irdma/uk.c:797:24: sparse: got restricted __le32 [usertype] *push_db drivers/infiniband/hw/irdma/uk.c:875:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected bool [usertype] push_wqe:1 @@ got restricted __le32 [usertype] *push_db @@ drivers/infiniband/hw/irdma/uk.c:875:24: sparse: expected bool [usertype] push_wqe:1 drivers/infiniband/hw/irdma/uk.c:875:24: sparse: got restricted __le32 [usertype] *push_db vim +285 drivers/infiniband/hw/irdma/uk.c 265 266 /** 267 * irdma_uk_rdma_write - rdma write operation 268 * @qp: hw qp ptr 269 * @info: post sq information 270 * @post_sq: flag to post sq 271 */ 272 int irdma_uk_rdma_write(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, 273 bool post_sq) 274 { 275 u64 hdr; 276 __le64 *wqe; 277 struct irdma_rdma_write *op_info; 278 u32 i, wqe_idx; 279 u32 total_size = 0, byte_off; 280 int ret_code; 281 u32 frag_cnt, addl_frag_cnt; 282 bool read_fence = false; 283 u16 quanta; 284 > 285 info->push_wqe = qp->push_db; 286 287 op_info = &info->op.rdma_write; 288 if (op_info->num_lo_sges > qp->max_sq_frag_cnt) 289 return -EINVAL; 290 291 for (i = 0; i < op_info->num_lo_sges; i++) 292 total_size += op_info->lo_sg_list[i].length; 293 294 read_fence |= info->read_fence; 295 296 if (info->imm_data_valid) 297 frag_cnt = op_info->num_lo_sges + 1; 298 else 299 frag_cnt = op_info->num_lo_sges; 300 addl_frag_cnt = frag_cnt > 1 ? (frag_cnt - 1) : 0; 301 ret_code = irdma_fragcnt_to_quanta_sq(frag_cnt, &quanta); 302 if (ret_code) 303 return ret_code; 304 305 wqe = irdma_qp_get_next_send_wqe(qp, &wqe_idx, quanta, total_size, 306 info); 307 if (!wqe) 308 return -ENOMEM; 309 310 irdma_clr_wqes(qp, wqe_idx); 311 312 set_64bit_val(wqe, 16, 313 FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.addr)); 314 315 if (info->imm_data_valid) { 316 set_64bit_val(wqe, 0, 317 FIELD_PREP(IRDMAQPSQ_IMMDATA, info->imm_data)); 318 i = 0; 319 } else { 320 qp->wqe_ops.iw_set_fragment(wqe, 0, 321 op_info->lo_sg_list, 322 qp->swqe_polarity); 323 i = 1; 324 } 325 326 for (byte_off = 32; i < op_info->num_lo_sges; i++) { 327 qp->wqe_ops.iw_set_fragment(wqe, byte_off, 328 &op_info->lo_sg_list[i], 329 qp->swqe_polarity); 330 byte_off += 16; 331 } 332 333 /* if not an odd number set valid bit in next fragment */ 334 if (qp->uk_attrs->hw_rev >= IRDMA_GEN_2 && !(frag_cnt & 0x01) && 335 frag_cnt) { 336 qp->wqe_ops.iw_set_fragment(wqe, byte_off, NULL, 337 qp->swqe_polarity); 338 if (qp->uk_attrs->hw_rev == IRDMA_GEN_2) 339 ++addl_frag_cnt; 340 } 341 342 hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.lkey) | 343 FIELD_PREP(IRDMAQPSQ_OPCODE, info->op_type) | 344 FIELD_PREP(IRDMAQPSQ_IMMDATAFLAG, info->imm_data_valid) | 345 FIELD_PREP(IRDMAQPSQ_REPORTRTT, info->report_rtt) | 346 FIELD_PREP(IRDMAQPSQ_ADDFRAGCNT, addl_frag_cnt) | 347 FIELD_PREP(IRDMAQPSQ_PUSHWQE, info->push_wqe) | 348 FIELD_PREP(IRDMAQPSQ_READFENCE, read_fence) | 349 FIELD_PREP(IRDMAQPSQ_LOCALFENCE, info->local_fence) | 350 FIELD_PREP(IRDMAQPSQ_SIGCOMPL, info->signaled) | 351 FIELD_PREP(IRDMAQPSQ_VALID, qp->swqe_polarity); 352 353 dma_wmb(); /* make sure WQE is populated before valid bit is set */ 354 355 set_64bit_val(wqe, 24, hdr); 356 if (info->push_wqe) { 357 irdma_qp_push_wqe(qp, wqe, quanta, wqe_idx, post_sq); 358 } else { 359 if (post_sq) 360 irdma_uk_qp_post_wr(qp); 361 } 362 363 return 0; 364 } 365 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki