tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 07dc787be2316e243a16a33d0a9b734cd9365bd3 commit: 476da8faa336f104cb5183ff51615335d1ff5d1f [3936/4317] scsi: qla2xxx: Add a new v2 dport diagnostic feature config: sparc-allmodconfig (https://download.01.org/0day-ci/archive/20220618/202206181652.5EKcExP1-lkp@xxxxxxxxx/config) compiler: sparc64-linux-gcc (GCC) 11.3.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.4-30-g92122700-dirty # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=476da8faa336f104cb5183ff51615335d1ff5d1f git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout 476da8faa336f104cb5183ff51615335d1ff5d1f # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=sparc SHELL=/bin/bash drivers/scsi/qla2xxx/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot <lkp@xxxxxxxxx> sparse warnings: (new ones prefixed by >>) >> drivers/scsi/qla2xxx/qla_bsg.c:2485:34: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] mbx1 @@ got restricted __le16 @@ drivers/scsi/qla2xxx/qla_bsg.c:2485:34: sparse: expected unsigned short [usertype] mbx1 drivers/scsi/qla2xxx/qla_bsg.c:2485:34: sparse: got restricted __le16 >> drivers/scsi/qla2xxx/qla_bsg.c:2486:34: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] mbx2 @@ got restricted __le16 @@ drivers/scsi/qla2xxx/qla_bsg.c:2486:34: sparse: expected unsigned short [usertype] mbx2 drivers/scsi/qla2xxx/qla_bsg.c:2486:34: sparse: got restricted __le16 vim +2485 drivers/scsi/qla2xxx/qla_bsg.c 2426 2427 static int 2428 qla2x00_do_dport_diagnostics_v2(struct bsg_job *bsg_job) 2429 { 2430 struct fc_bsg_reply *bsg_reply = bsg_job->reply; 2431 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); 2432 scsi_qla_host_t *vha = shost_priv(host); 2433 int rval; 2434 struct qla_dport_diag_v2 *dd; 2435 mbx_cmd_t mc; 2436 mbx_cmd_t *mcp = &mc; 2437 uint16_t options; 2438 2439 if (!IS_DPORT_CAPABLE(vha->hw)) 2440 return -EPERM; 2441 2442 dd = kzalloc(sizeof(*dd), GFP_KERNEL); 2443 if (!dd) 2444 return -ENOMEM; 2445 2446 sg_copy_to_buffer(bsg_job->request_payload.sg_list, 2447 bsg_job->request_payload.sg_cnt, dd, sizeof(*dd)); 2448 2449 options = dd->options; 2450 2451 /* Check dport Test in progress */ 2452 if (options == QLA_GET_DPORT_RESULT_V2 && 2453 vha->dport_status & DPORT_DIAG_IN_PROGRESS) { 2454 bsg_reply->reply_data.vendor_reply.vendor_rsp[0] = 2455 EXT_STATUS_DPORT_DIAG_IN_PROCESS; 2456 goto dportcomplete; 2457 } 2458 2459 /* Check chip reset in progress and start/restart requests arrive */ 2460 if (vha->dport_status & DPORT_DIAG_CHIP_RESET_IN_PROGRESS && 2461 (options == QLA_START_DPORT_TEST_V2 || 2462 options == QLA_RESTART_DPORT_TEST_V2)) { 2463 vha->dport_status &= ~DPORT_DIAG_CHIP_RESET_IN_PROGRESS; 2464 } 2465 2466 /* Check chip reset in progress and get result request arrive */ 2467 if (vha->dport_status & DPORT_DIAG_CHIP_RESET_IN_PROGRESS && 2468 options == QLA_GET_DPORT_RESULT_V2) { 2469 bsg_reply->reply_data.vendor_reply.vendor_rsp[0] = 2470 EXT_STATUS_DPORT_DIAG_NOT_RUNNING; 2471 goto dportcomplete; 2472 } 2473 2474 rval = qla26xx_dport_diagnostics_v2(vha, dd, mcp); 2475 2476 if (rval == QLA_SUCCESS) { 2477 bsg_reply->reply_data.vendor_reply.vendor_rsp[0] = 2478 EXT_STATUS_OK; 2479 if (options == QLA_START_DPORT_TEST_V2 || 2480 options == QLA_RESTART_DPORT_TEST_V2) { 2481 dd->mbx1 = mcp->mb[0]; 2482 dd->mbx2 = mcp->mb[1]; 2483 vha->dport_status |= DPORT_DIAG_IN_PROGRESS; 2484 } else if (options == QLA_GET_DPORT_RESULT_V2) { > 2485 dd->mbx1 = vha->dport_data[1]; > 2486 dd->mbx2 = vha->dport_data[2]; 2487 } 2488 } else { 2489 dd->mbx1 = mcp->mb[0]; 2490 dd->mbx2 = mcp->mb[1]; 2491 bsg_reply->reply_data.vendor_reply.vendor_rsp[0] = 2492 EXT_STATUS_DPORT_DIAG_ERR; 2493 } 2494 2495 dportcomplete: 2496 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, 2497 bsg_job->reply_payload.sg_cnt, dd, sizeof(*dd)); 2498 2499 bsg_reply->reply_payload_rcv_len = sizeof(*dd); 2500 bsg_job->reply_len = sizeof(*bsg_reply); 2501 bsg_reply->result = DID_OK << 16; 2502 bsg_job_done(bsg_job, bsg_reply->result, 2503 bsg_reply->reply_payload_rcv_len); 2504 2505 kfree(dd); 2506 2507 return 0; 2508 } 2509 -- 0-DAY CI Kernel Test Service https://01.org/lkp