[linux-next:master 10391/10906] drivers/scsi/mpi3mr/mpi3mr_os.c:389:40: warning: cast from pointer to integer of different size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   6014cfa5bf32cf8c5c58b3cfd5ee0e1542c8a825
commit: c196bc4dce42bdcc2c69ec106d176f427c56003a [10391/10906] scsi: mpi3mr: Reduce VD queue depth on detecting throttling
config: csky-allyesconfig (https://download.01.org/0day-ci/archive/20220718/202207180253.NWBbnISq-lkp@xxxxxxxxx/config)
compiler: csky-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=c196bc4dce42bdcc2c69ec106d176f427c56003a
        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 c196bc4dce42bdcc2c69ec106d176f427c56003a
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=csky SHELL=/bin/bash drivers/gpu/drm/amd/amdgpu/ drivers/net/vmxnet3/ drivers/scsi/mpi3mr/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   drivers/scsi/mpi3mr/mpi3mr_os.c: In function 'mpi3mr_queue_qd_reduction_event':
>> drivers/scsi/mpi3mr/mpi3mr_os.c:389:40: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     389 |         *(__le64 *)fwevt->event_data = (__le64)tg;
         |                                        ^
   drivers/scsi/mpi3mr/mpi3mr_os.c: In function 'mpi3mr_fwevt_bh':
>> drivers/scsi/mpi3mr/mpi3mr_os.c:1663:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    1663 |                 tg = (struct mpi3mr_throttle_group_info *)
         |                      ^
   drivers/scsi/mpi3mr/mpi3mr_os.c: In function 'mpi3mr_queue_qd_reduction_event':
   drivers/scsi/mpi3mr/mpi3mr_os.c:389:9: warning: array subscript '__le64 {aka long long unsigned int}[9]' is partly outside array bounds of 'unsigned char[76]' [-Warray-bounds]
     389 |         *(__le64 *)fwevt->event_data = (__le64)tg;
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/fs.h:45,
                    from include/linux/highmem.h:5,
                    from include/linux/bvec.h:10,
                    from include/linux/blk_types.h:10,
                    from include/linux/blkdev.h:9,
                    from drivers/scsi/mpi3mr/mpi3mr.h:13,
                    from drivers/scsi/mpi3mr/mpi3mr_os.c:10:
   In function 'kmalloc',
       inlined from 'kzalloc' at include/linux/slab.h:733:9,
       inlined from 'mpi3mr_alloc_fwevt' at drivers/scsi/mpi3mr/mpi3mr_os.c:198:10,
       inlined from 'mpi3mr_queue_qd_reduction_event' at drivers/scsi/mpi3mr/mpi3mr_os.c:384:10:
   include/linux/slab.h:600:24: note: at offset 72 into object of size 76 allocated by 'kmem_cache_alloc_trace'
     600 |                 return kmem_cache_alloc_trace(
         |                        ^~~~~~~~~~~~~~~~~~~~~~~
     601 |                                 kmalloc_caches[kmalloc_type(flags)][index],
         |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     602 |                                 flags, size);
         |                                 ~~~~~~~~~~~~


vim +389 drivers/scsi/mpi3mr/mpi3mr_os.c

   358	
   359	/**
   360	 * mpi3mr_queue_qd_reduction_event - Queue TG QD reduction event
   361	 * @mrioc: Adapter instance reference
   362	 * @tg: Throttle group information pointer
   363	 *
   364	 * Accessor to queue on synthetically generated driver event to
   365	 * the event worker thread, the driver event will be used to
   366	 * reduce the QD of all VDs in the TG from the worker thread.
   367	 *
   368	 * Return: None.
   369	 */
   370	static void mpi3mr_queue_qd_reduction_event(struct mpi3mr_ioc *mrioc,
   371		struct mpi3mr_throttle_group_info *tg)
   372	{
   373		struct mpi3mr_fwevt *fwevt;
   374		u16 sz = sizeof(struct mpi3mr_throttle_group_info *);
   375	
   376		/*
   377		 * If the QD reduction event is already queued due to throttle and if
   378		 * the QD is not restored through device info change event
   379		 * then dont queue further reduction events
   380		 */
   381		if (tg->fw_qd != tg->modified_qd)
   382			return;
   383	
   384		fwevt = mpi3mr_alloc_fwevt(sz);
   385		if (!fwevt) {
   386			ioc_warn(mrioc, "failed to queue TG QD reduction event\n");
   387			return;
   388		}
 > 389		*(__le64 *)fwevt->event_data = (__le64)tg;
   390		fwevt->mrioc = mrioc;
   391		fwevt->event_id = MPI3MR_DRIVER_EVENT_TG_QD_REDUCTION;
   392		fwevt->send_ack = 0;
   393		fwevt->process_evt = 1;
   394		fwevt->evt_ctx = 0;
   395		fwevt->event_data_size = sz;
   396		tg->modified_qd = max_t(u16, (tg->fw_qd * tg->qd_reduction) / 10, 8);
   397	
   398		dprint_event_bh(mrioc, "qd reduction event queued for tg_id(%d)\n",
   399		    tg->id);
   400		mpi3mr_fwevt_add_to_list(mrioc, fwevt);
   401	}
   402	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux