drivers/scsi/bfa/bfad_bsg.c:2553:50: sparse: sparse: incorrect type in initializer (different base types)
From: kernel test robot
Date: Sat Sep 16 2023 - 07:22:40 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 57d88e8a5974644039fbc47806bac7bb12025636
commit: 2e5a6c3baccd31476ed00c3fbc413b48ddd87993 scsi: bfa: Convert bfad_reset_sdev_bflags() from a macro into a function
date: 10 months ago
config: i386-randconfig-062-20230916 (https://download.01.org/0day-ci/archive/20230916/202309161958.cn3ZKYOD-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230916/202309161958.cn3ZKYOD-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/202309161958.cn3ZKYOD-lkp@xxxxxxxxx/
sparse warnings: (new ones prefixed by >>)
drivers/scsi/bfa/bfad_bsg.c:2391:25: sparse: sparse: cast to restricted __be32
drivers/scsi/bfa/bfad_bsg.c:2414:38: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfad_bsg.c:2415:38: sparse: sparse: cast to restricted __be16
drivers/scsi/bfa/bfad_bsg.c:2417:33: sparse: sparse: cast to restricted __be32
>> drivers/scsi/bfa/bfad_bsg.c:2553:50: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned int const [usertype] scan_flags @@ got restricted blist_flags_t @@
drivers/scsi/bfa/bfad_bsg.c:2553:50: sparse: expected unsigned int const [usertype] scan_flags
drivers/scsi/bfa/bfad_bsg.c:2553:50: sparse: got restricted blist_flags_t
drivers/scsi/bfa/bfad_bsg.c:2562:51: sparse: sparse: invalid assignment: |=
drivers/scsi/bfa/bfad_bsg.c:2562:51: sparse: left side has type restricted blist_flags_t
drivers/scsi/bfa/bfad_bsg.c:2562:51: sparse: right side has type unsigned int
drivers/scsi/bfa/bfad_bsg.c:2564:51: sparse: sparse: invalid assignment: &=
drivers/scsi/bfa/bfad_bsg.c:2564:51: sparse: left side has type restricted blist_flags_t
drivers/scsi/bfa/bfad_bsg.c:2564:51: sparse: right side has type unsigned int
drivers/scsi/bfa/bfad_bsg.c:3407:34: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got void * @@
drivers/scsi/bfa/bfad_bsg.c:3407:34: sparse: expected void const [noderef] __user *from
drivers/scsi/bfa/bfad_bsg.c:3407:34: sparse: got void *
drivers/scsi/bfa/bfad_bsg.c:3561:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __user *to @@ got void * @@
drivers/scsi/bfa/bfad_bsg.c:3561:27: sparse: expected void [noderef] __user *to
drivers/scsi/bfa/bfad_bsg.c:3561:27: sparse: got void *
vim +2553 drivers/scsi/bfa/bfad_bsg.c
2542
2543 /*
2544 * Set the SCSI device sdev_bflags - sdev_bflags are used by the
2545 * SCSI mid-layer to choose LUN Scanning mode REPORT_LUNS vs. Sequential Scan
2546 *
2547 * Internally iterates over all the ITNIM's part of the im_port & sets the
2548 * sdev_bflags for the scsi_device associated with LUN #0.
2549 */
2550 static void bfad_reset_sdev_bflags(struct bfad_im_port_s *im_port,
2551 int lunmask_cfg)
2552 {
> 2553 const u32 scan_flags = BLIST_NOREPORTLUN | BLIST_SPARSELUN;
2554 struct bfad_itnim_s *itnim;
2555 struct scsi_device *sdev;
2556
2557 list_for_each_entry(itnim, &im_port->itnim_mapped_list, list_entry) {
2558 sdev = scsi_device_lookup(im_port->shost, itnim->channel,
2559 itnim->scsi_tgt_id, 0);
2560 if (sdev) {
2561 if (lunmask_cfg == BFA_TRUE)
2562 sdev->sdev_bflags |= scan_flags;
2563 else
2564 sdev->sdev_bflags &= ~scan_flags;
2565 scsi_device_put(sdev);
2566 }
2567 }
2568 }
2569
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki