Hi Saurav, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on mkp-scsi/for-next] [also build test WARNING on v5.0 next-20190306] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Saurav-Kashyap/qedf-Misc-fixes-for-the-driver/20190305-205913 base: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next reproduce: # apt-get install sparse make ARCH=x86_64 allmodconfig make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' sparse warnings: (new ones prefixed by >>) include/linux/slab.h:664:13: sparse: undefined identifier '__builtin_mul_overflow' drivers/scsi/qedf/qedf_io.c:469:42: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] lo @@ got unsignrestricted __le32 [usertype] lo @@ drivers/scsi/qedf/qedf_io.c:469:42: expected restricted __le32 [usertype] lo drivers/scsi/qedf/qedf_io.c:469:42: got unsigned int [unsigned] [usertype] <noident> drivers/scsi/qedf/qedf_io.c:470:43: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] hi @@ got unsignrestricted __le32 [usertype] hi @@ drivers/scsi/qedf/qedf_io.c:470:43: expected restricted __le32 [usertype] hi drivers/scsi/qedf/qedf_io.c:470:43: got unsigned int [unsigned] [usertype] <noident> >> drivers/scsi/qedf/qedf_io.c:471:38: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] sge_len @@ got unsigned int [unsrestricted __le32 [usertype] sge_len @@ drivers/scsi/qedf/qedf_io.c:471:38: expected restricted __le32 [usertype] sge_len drivers/scsi/qedf/qedf_io.c:471:38: got unsigned int [unsigned] [assigned] [usertype] sg_len drivers/scsi/qedf/qedf_io.c:598:59: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] lo @@ got unsignrestricted __le32 [usertype] lo @@ drivers/scsi/qedf/qedf_io.c:598:59: expected restricted __le32 [usertype] lo drivers/scsi/qedf/qedf_io.c:598:59: got unsigned int [unsigned] [usertype] <noident> drivers/scsi/qedf/qedf_io.c:600:59: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] hi @@ got unsignrestricted __le32 [usertype] hi @@ drivers/scsi/qedf/qedf_io.c:600:59: expected restricted __le32 [usertype] hi drivers/scsi/qedf/qedf_io.c:600:59: got unsigned int [unsigned] [usertype] <noident> drivers/scsi/qedf/qedf_io.c:612:40: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] lo @@ got unsignrestricted __le32 [usertype] lo @@ drivers/scsi/qedf/qedf_io.c:612:40: expected restricted __le32 [usertype] lo drivers/scsi/qedf/qedf_io.c:612:40: got unsigned int [unsigned] [usertype] <noident> drivers/scsi/qedf/qedf_io.c:613:40: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] hi @@ got unsignrestricted __le32 [usertype] hi @@ drivers/scsi/qedf/qedf_io.c:613:40: expected restricted __le32 [usertype] hi drivers/scsi/qedf/qedf_io.c:613:40: got unsigned int [unsigned] [usertype] <noident> drivers/scsi/qedf/qedf_io.c:621:33: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [unsigned] <noident> @@ got restrunsigned int [unsigned] <noident> @@ drivers/scsi/qedf/qedf_io.c:621:33: expected unsigned int [unsigned] <noident> drivers/scsi/qedf/qedf_io.c:621:33: got restricted __be32 [usertype] <noident> drivers/scsi/qedf/qedf_io.c:677:26: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] fh_ox_id @@ got unsignedrestricted __be16 [usertype] fh_ox_id @@ drivers/scsi/qedf/qedf_io.c:677:26: expected restricted __be16 [usertype] fh_ox_id drivers/scsi/qedf/qedf_io.c:677:26: got unsigned short [unsigned] [usertype] xid drivers/scsi/qedf/qedf_io.c:681:31: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [addressable] [usertype] parameter @@ got e32 [addressable] [usertype] parameter @@ drivers/scsi/qedf/qedf_io.c:681:31: expected restricted __le32 [addressable] [usertype] parameter drivers/scsi/qedf/qedf_io.c:681:31: got restricted __be32 [usertype] fh_parm_offset drivers/scsi/qedf/qedf_io.c:686:27: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [addressable] [assigned] [usertype] rx_id @@ got sable] [assigned] [usertype] rx_id @@ drivers/scsi/qedf/qedf_io.c:686:27: expected restricted __le16 [addressable] [assigned] [usertype] rx_id drivers/scsi/qedf/qedf_io.c:686:27: got restricted __be16 [usertype] fh_rx_id drivers/scsi/qedf/qedf_io.c:687:27: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [addressable] [assigned] [usertype] ox_id @@ got sable] [assigned] [usertype] ox_id @@ drivers/scsi/qedf/qedf_io.c:687:27: expected restricted __le16 [addressable] [assigned] [usertype] ox_id drivers/scsi/qedf/qedf_io.c:687:27: got restricted __be16 [usertype] fh_ox_id drivers/scsi/qedf/qedf_io.c:691:45: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [addressable] [assigned] [usertype] lo @@ got addressable] [assigned] [usertype] lo @@ drivers/scsi/qedf/qedf_io.c:691:45: expected restricted __le32 [addressable] [assigned] [usertype] lo drivers/scsi/qedf/qedf_io.c:691:45: got unsigned int [unsigned] [usertype] <noident> drivers/scsi/qedf/qedf_io.c:692:45: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [addressable] [assigned] [usertype] hi @@ got addressable] [assigned] [usertype] hi @@ drivers/scsi/qedf/qedf_io.c:692:45: expected restricted __le32 [addressable] [assigned] [usertype] hi drivers/scsi/qedf/qedf_io.c:692:45: got unsigned int [unsigned] [usertype] <noident> drivers/scsi/qedf/qedf_io.c:700:45: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [addressable] [assigned] [usertype] lo @@ got addressable] [assigned] [usertype] lo @@ drivers/scsi/qedf/qedf_io.c:700:45: expected restricted __le32 [addressable] [assigned] [usertype] lo drivers/scsi/qedf/qedf_io.c:700:45: got unsigned int [unsigned] [usertype] <noident> drivers/scsi/qedf/qedf_io.c:701:45: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [addressable] [assigned] [usertype] hi @@ got addressable] [assigned] [usertype] hi @@ drivers/scsi/qedf/qedf_io.c:701:45: expected restricted __le32 [addressable] [assigned] [usertype] hi drivers/scsi/qedf/qedf_io.c:701:45: got unsigned int [unsigned] [usertype] <noident> drivers/scsi/qedf/qedf_io.c:746:23: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [assigned] [usertype] sq_prod @@ got tricted __le16 [assigned] [usertype] sq_prod @@ drivers/scsi/qedf/qedf_io.c:746:23: expected restricted __le16 [assigned] [usertype] sq_prod drivers/scsi/qedf/qedf_io.c:746:23: got unsigned short [unsigned] [usertype] fw_sq_prod_idx drivers/scsi/qedf/qedf_io.c:989:35: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [unsigned] [usertype] fcp_resid @@ got ed int [unsigned] [usertype] fcp_resid @@ drivers/scsi/qedf/qedf_io.c:989:35: expected unsigned int [unsigned] [usertype] fcp_resid drivers/scsi/qedf/qedf_io.c:989:35: got restricted __le32 [usertype] fcp_resid drivers/scsi/qedf/qedf_io.c:997:29: sparse: incorrect type in assignment (different base types) @@ expected int [signed] fcp_rsp_len @@ got restricted __le3int [signed] fcp_rsp_len @@ drivers/scsi/qedf/qedf_io.c:997:29: expected int [signed] fcp_rsp_len drivers/scsi/qedf/qedf_io.c:997:29: got restricted __le32 [usertype] fcp_rsp_len drivers/scsi/qedf/qedf_io.c:1001:29: sparse: incorrect type in assignment (different base types) @@ expected int [signed] fcp_sns_len @@ got restricted __le3int [signed] fcp_sns_len @@ drivers/scsi/qedf/qedf_io.c:1001:29: expected int [signed] fcp_sns_len drivers/scsi/qedf/qedf_io.c:1001:29: got restricted __le32 [usertype] fcp_sns_len drivers/scsi/qedf/qedf_io.c:1162:48: sparse: restricted __le16 degrades to integer drivers/scsi/qedf/qedf_io.c:1164:52: sparse: restricted __le16 degrades to integer drivers/scsi/qedf/qedf_io.c:1277:9: sparse: cast to restricted __le32 drivers/scsi/qedf/qedf_io.c:1277:9: sparse: cast from restricted __le16 drivers/scsi/qedf/qedf_io.c:1285:15: sparse: cast from restricted __le32 drivers/scsi/qedf/qedf_io.c:1286:14: sparse: cast from restricted __le32 drivers/scsi/qedf/qedf_io.c:1300:52: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [unsigned] [usertype] rx_buf_off @@ got ed int [unsigned] [usertype] rx_buf_off @@ drivers/scsi/qedf/qedf_io.c:1300:52: expected unsigned int [unsigned] [usertype] rx_buf_off drivers/scsi/qedf/qedf_io.c:1300:52: got restricted __le32 [usertype] rx_buf_off drivers/scsi/qedf/qedf_io.c:1302:52: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [unsigned] [usertype] tx_buf_off @@ got ed int [unsigned] [usertype] tx_buf_off @@ drivers/scsi/qedf/qedf_io.c:1302:52: expected unsigned int [unsigned] [usertype] tx_buf_off drivers/scsi/qedf/qedf_io.c:1302:52: got restricted __le32 [usertype] tx_buf_off drivers/scsi/qedf/qedf_io.c:1304:47: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [unsigned] [usertype] rx_id @@ got ed int [unsigned] [usertype] rx_id @@ drivers/scsi/qedf/qedf_io.c:1304:47: expected unsigned int [unsigned] [usertype] rx_id drivers/scsi/qedf/qedf_io.c:1304:47: got restricted __le16 [usertype] rx_id drivers/scsi/qedf/qedf_io.c:1340:9: sparse: cast to restricted __le32 drivers/scsi/qedf/qedf_io.c:1340:9: sparse: cast from restricted __le16 drivers/scsi/qedf/qedf_io.c:1699:32: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] lo @@ got unsignrestricted __le32 [usertype] lo @@ drivers/scsi/qedf/qedf_io.c:1699:32: expected restricted __le32 [usertype] lo drivers/scsi/qedf/qedf_io.c:1699:32: got unsigned int [unsigned] [usertype] <noident> drivers/scsi/qedf/qedf_io.c:1700:32: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] hi @@ got unsignrestricted __le32 [usertype] hi @@ drivers/scsi/qedf/qedf_io.c:1700:32: expected restricted __le32 [usertype] hi drivers/scsi/qedf/qedf_io.c:1700:32: got unsigned int [unsigned] [usertype] <noident> drivers/scsi/qedf/qedf_io.c:1701:28: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] sge_len @@ got e] sge_len @@ drivers/scsi/qedf/qedf_io.c:1701:28: expected restricted __le32 [usertype] sge_len drivers/scsi/qedf/qedf_io.c:1701:28: got int drivers/scsi/qedf/qedf_io.c:1710:33: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] lo @@ got unsignrestricted __le32 [usertype] lo @@ drivers/scsi/qedf/qedf_io.c:1710:33: expected restricted __le32 [usertype] lo drivers/scsi/qedf/qedf_io.c:1710:33: got unsigned int [unsigned] [usertype] <noident> drivers/scsi/qedf/qedf_io.c:1711:33: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] hi @@ got unsignrestricted __le32 [usertype] hi @@ drivers/scsi/qedf/qedf_io.c:1711:33: expected restricted __le32 [usertype] hi drivers/scsi/qedf/qedf_io.c:1711:33: got unsigned int [unsigned] [usertype] <noident> drivers/scsi/qedf/qedf_io.c:1712:29: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] sge_len @@ got e] sge_len @@ drivers/scsi/qedf/qedf_io.c:1712:29: expected restricted __le32 [usertype] sge_len drivers/scsi/qedf/qedf_io.c:1712:29: got int drivers/scsi/qedf/qedf_io.c:2032:53: sparse: incorrect type in initializer (different base types) @@ expected unsigned short [unsigned] [usertype] pktlen @@ got short [unsigned] [usertype] pktlen @@ drivers/scsi/qedf/qedf_io.c:2032:53: expected unsigned short [unsigned] [usertype] pktlen drivers/scsi/qedf/qedf_io.c:2032:53: got restricted __le16 [usertype] pkt_len drivers/scsi/qedf/qedf_io.c:2089:20: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [unsigned] [usertype] fr_crc @@ got ed int [unsigned] [usertype] fr_crc @@ drivers/scsi/qedf/qedf_io.c:2089:20: expected unsigned int [unsigned] [usertype] fr_crc drivers/scsi/qedf/qedf_io.c:2089:20: got restricted __le32 [usertype] <noident> include/linux/slab.h:664:13: sparse: call with no type! vim +471 drivers/scsi/qedf/qedf_io.c 430 431 static int qedf_map_sg(struct qedf_ioreq *io_req) 432 { 433 struct scsi_cmnd *sc = io_req->sc_cmd; 434 struct Scsi_Host *host = sc->device->host; 435 struct fc_lport *lport = shost_priv(host); 436 struct qedf_ctx *qedf = lport_priv(lport); 437 struct scsi_sge *bd = io_req->bd_tbl->bd_tbl; 438 struct scatterlist *sg; 439 int byte_count = 0; 440 int sg_count = 0; 441 int bd_count = 0; 442 u32 sg_len; 443 u64 addr, end_addr; 444 int i = 0; 445 446 sg_count = dma_map_sg(&qedf->pdev->dev, scsi_sglist(sc), 447 scsi_sg_count(sc), sc->sc_data_direction); 448 sg = scsi_sglist(sc); 449 450 io_req->sge_type = QEDF_IOREQ_UNKNOWN_SGE; 451 452 if (sg_count <= 8 || io_req->io_req_flags == QEDF_READ) 453 io_req->sge_type = QEDF_IOREQ_FAST_SGE; 454 455 scsi_for_each_sg(sc, sg, sg_count, i) { 456 sg_len = (u32)sg_dma_len(sg); 457 addr = (u64)sg_dma_address(sg); 458 end_addr = (u64)(addr + sg_len); 459 460 /* 461 * Intermediate s/g element so check if start and end address 462 * is page aligned. Only required for writes and only if the 463 * number of scatter/gather elements is 8 or more. 464 */ 465 if (io_req->sge_type == QEDF_IOREQ_UNKNOWN_SGE && (i) && 466 (i != (sg_count - 1)) && sg_len < QEDF_PAGE_SIZE) 467 io_req->sge_type = QEDF_IOREQ_SLOW_SGE; 468 > 469 bd[bd_count].sge_addr.lo = U64_LO(addr); 470 bd[bd_count].sge_addr.hi = U64_HI(addr); > 471 bd[bd_count].sge_len = sg_len; 472 473 bd_count++; 474 byte_count += sg_len; 475 } 476 477 /* To catch a case where FAST and SLOW nothing is set, set FAST */ 478 if (io_req->sge_type == QEDF_IOREQ_UNKNOWN_SGE) 479 io_req->sge_type = QEDF_IOREQ_FAST_SGE; 480 481 if (byte_count != scsi_bufflen(sc)) 482 QEDF_ERR(&(qedf->dbg_ctx), "byte_count = %d != " 483 "scsi_bufflen = %d, task_id = 0x%x.\n", byte_count, 484 scsi_bufflen(sc), io_req->xid); 485 486 return bd_count; 487 } 488 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation