LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [kees:kspp/array-bounds/next-20210816/v1 9/10] drivers/scsi/megaraid.c:211:13: warning: array subscript 'mbox_t[0]' is partly outside array bounds of 'u8[15]' {aka 'unsigned char[15]'}
@ 2021-08-18 12:47 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-08-18 12:47 UTC (permalink / raw)
  To: Kees Cook; +Cc: kbuild-all, linux-kernel, Gustavo A. R. Silva

[-- Attachment #1: Type: text/plain, Size: 23578 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git kspp/array-bounds/next-20210816/v1
head:   b07d5e8190ca172b1ffddd1412b921296000b379
commit: ecc23a9ee765008e439113eea38fb1cbbd3d7c83 [9/10] Makefile: Enable -Warray-bounds
config: arc-randconfig-r043-20210818 (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.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/kees/linux.git/commit/?id=ecc23a9ee765008e439113eea38fb1cbbd3d7c83
        git remote add kees https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git
        git fetch --no-tags kees kspp/array-bounds/next-20210816/v1
        git checkout ecc23a9ee765008e439113eea38fb1cbbd3d7c83
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/scsi/megaraid.c: In function 'mega_query_adapter':
>> drivers/scsi/megaraid.c:211:13: warning: array subscript 'mbox_t[0]' is partly outside array bounds of 'u8[15]' {aka 'unsigned char[15]'} [-Warray-bounds]
     211 |         mbox->m_out.xferaddr = (u32)adapter->buf_dma_handle;
         |             ^~
   drivers/scsi/megaraid.c:195:17: note: while referencing 'raw_mbox'
     195 |         u8      raw_mbox[sizeof(struct mbox_out)];
         |                 ^~~~~~~~
   drivers/scsi/megaraid.c:265:21: warning: array subscript 'mbox_t[0]' is partly outside array bounds of 'u8[15]' {aka 'unsigned char[15]'} [-Warray-bounds]
     265 |                 mbox->m_out.xferaddr = prod_info_dma_handle;
         |                     ^~
   drivers/scsi/megaraid.c:195:17: note: while referencing 'raw_mbox'
     195 |         u8      raw_mbox[sizeof(struct mbox_out)];
         |                 ^~~~~~~~
   drivers/scsi/megaraid.c:235:21: warning: array subscript 'mbox_t[0]' is partly outside array bounds of 'u8[15]' {aka 'unsigned char[15]'} [-Warray-bounds]
     235 |                 mbox->m_out.xferaddr = (u32)dma_handle;
         |                     ^~
   drivers/scsi/megaraid.c:195:17: note: while referencing 'raw_mbox'
     195 |         u8      raw_mbox[sizeof(struct mbox_out)];
         |                 ^~~~~~~~
   drivers/scsi/megaraid.c:238:21: warning: array subscript 'mbox_t[0]' is partly outside array bounds of 'u8[15]' {aka 'unsigned char[15]'} [-Warray-bounds]
     238 |                 mbox->m_out.cmd = MEGA_MBOXCMD_ADPEXTINQ;
         |                     ^~
   drivers/scsi/megaraid.c:195:17: note: while referencing 'raw_mbox'
     195 |         u8      raw_mbox[sizeof(struct mbox_out)];
         |                 ^~~~~~~~
>> drivers/scsi/megaraid.c:3881:30: warning: array subscript 'mbox_t[0]' is partly outside array bounds of 'unsigned char[15]' [-Warray-bounds]
    3881 |         mbox->m_out.xferaddr = (u32)adapter->buf_dma_handle;
         |         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/megaraid.c:3872:25: note: while referencing 'raw_mbox'
    3872 |         unsigned char   raw_mbox[sizeof(struct mbox_out)];
         |                         ^~~~~~~~
   drivers/scsi/megaraid.c: In function 'megaraid_probe_one':
   drivers/scsi/megaraid.c:3585:30: warning: array subscript 'mbox_t[0]' is partly outside array bounds of 'unsigned char[15]' [-Warray-bounds]
    3585 |         mbox->m_out.xferaddr = (u32)adapter->buf_dma_handle;
         |         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/megaraid.c:3576:25: note: while referencing 'raw_mbox'
    3576 |         unsigned char   raw_mbox[sizeof(struct mbox_out)];
         |                         ^~~~~~~~
   drivers/scsi/megaraid.c:3623:30: warning: array subscript 'mbox_t[0]' is partly outside array bounds of 'unsigned char[15]' [-Warray-bounds]
    3623 |         mbox->m_out.xferaddr = (u32)adapter->buf_dma_handle;
         |         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/megaraid.c:3607:23: note: while referencing 'raw_mbox'
    3607 |         unsigned char raw_mbox[sizeof(struct mbox_out)];
         |                       ^~~~~~~~
   drivers/scsi/megaraid.c:3678:30: warning: array subscript 'mbox_t[0]' is partly outside array bounds of 'unsigned char[15]' [-Warray-bounds]
    3678 |         mbox->m_out.xferaddr = (u32)adapter->buf_dma_handle;
         |         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/megaraid.c:3662:25: note: while referencing 'raw_mbox'
    3662 |         unsigned char   raw_mbox[sizeof(struct mbox_out)];
         |                         ^~~~~~~~
   drivers/scsi/megaraid.c:3926:30: warning: array subscript 'mbox_t[0]' is partly outside array bounds of 'unsigned char[15]' [-Warray-bounds]
    3926 |         mbox->m_out.xferaddr = (u32)adapter->buf_dma_handle;
         |         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/megaraid.c:3917:25: note: while referencing 'raw_mbox'
    3917 |         unsigned char   raw_mbox[sizeof(struct mbox_out)];
         |                         ^~~~~~~~
--
   drivers/thunderbolt/xdomain.c: In function 'tb_xdomain_properties_changed':
>> drivers/thunderbolt/xdomain.c:226:22: warning: array subscript 'const struct tb_xdp_error_response[0]' is partly outside array bounds of 'struct tb_xdp_properties_changed_response[1]' [-Warray-bounds]
     226 |         switch (error->error) {
         |                 ~~~~~^~~~~~~
   drivers/thunderbolt/xdomain.c:448:51: note: while referencing 'res'
     448 |         struct tb_xdp_properties_changed_response res;
         |                                                   ^~~
--
   drivers/gpu/drm/drm_dp_helper.c: In function 'drm_dp_get_adjust_request_post_cursor':
>> drivers/gpu/drm/drm_dp_helper.c:59:27: warning: array subscript 10 is outside array bounds of 'const u8[6]' {aka 'const unsigned char[6]'} [-Warray-bounds]
      59 |         return link_status[r - DP_LANE0_1_STATUS];
         |                ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/drm_dp_helper.c:133:51: note: while referencing 'link_status'
     133 | u8 drm_dp_get_adjust_request_post_cursor(const u8 link_status[DP_LINK_STATUS_SIZE],
         |                                          ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/drm_dp_helper.c: In function 'drm_dp_pcon_dsc_bpp_incr':
   drivers/gpu/drm/drm_dp_helper.c:2981:28: warning: array subscript 12 is outside array bounds of 'const u8[12]' {aka 'const unsigned char[12]'} [-Warray-bounds]
    2981 |         buf = pcon_dsc_dpcd[DP_PCON_DSC_BPP_INCR - DP_PCON_DSC_ENCODER];
         |               ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/drm_dp_helper.c:2977:39: note: while referencing 'pcon_dsc_dpcd'
    2977 | int drm_dp_pcon_dsc_bpp_incr(const u8 pcon_dsc_dpcd[DP_PCON_DSC_ENCODER_CAP_SIZE])
         |                              ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
   In file included from net/mac80211/tx.c:15:
   net/mac80211/tx.c: In function 'ieee80211_xmit_fast':
>> include/linux/skbuff.h:2048:9: warning: array subscript 'struct sk_buff[0]' is partly outside array bounds of 'struct ieee80211_tx_data[1]' [-Warray-bounds]
    2048 |         __skb_insert(newsk, next->prev, next, list);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/mac80211/tx.c:3506:34: note: while referencing 'tx'
    3506 |         struct ieee80211_tx_data tx;
         |                                  ^~
--
   In file included from include/linux/if_ether.h:19,
                    from net/mac80211/ieee80211_i.h:16,
                    from net/mac80211/mesh.h:13,
                    from net/mac80211/mesh_ps.c:7:
   net/mac80211/mesh_ps.c: In function 'mps_frame_deliver':
>> include/linux/skbuff.h:2048:9: warning: array subscript 'struct sk_buff[0]' is partly outside array bounds of 'struct sk_buff_head[1]' [-Warray-bounds]
    2048 |         __skb_insert(newsk, next->prev, next, list);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/mac80211/mesh_ps.c:454:29: note: while referencing 'frames'
     454 |         struct sk_buff_head frames;
         |                             ^~~~~~
   In file included from include/linux/if_ether.h:19,
                    from net/mac80211/ieee80211_i.h:16,
                    from net/mac80211/mesh.h:13,
                    from net/mac80211/mesh_ps.c:7:
>> include/linux/skbuff.h:2048:9: warning: array subscript 'struct sk_buff[0]' is partly outside array bounds of 'struct sk_buff_head[1]' [-Warray-bounds]
    2048 |         __skb_insert(newsk, next->prev, next, list);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/mac80211/mesh_ps.c:454:29: note: while referencing 'frames'
     454 |         struct sk_buff_head frames;
         |                             ^~~~~~
--
   In file included from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from net/mac80211/sta_info.c:12:
   net/mac80211/sta_info.c: In function 'ieee80211_sta_ps_deliver_response':
>> include/linux/skbuff.h:2048:9: warning: array subscript 'struct sk_buff[0]' is partly outside array bounds of 'struct sk_buff_head[1]' [-Warray-bounds]
    2048 |         __skb_insert(newsk, next->prev, next, list);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/mac80211/sta_info.c:1577:29: note: while referencing 'frames'
    1577 |         struct sk_buff_head frames;
         |                             ^~~~~~
   In file included from include/linux/if_ether.h:19,
                    from include/linux/etherdevice.h:20,
                    from net/mac80211/sta_info.c:12:
>> include/linux/skbuff.h:2048:9: warning: array subscript 'struct sk_buff[0]' is partly outside array bounds of 'struct sk_buff_head[1]' [-Warray-bounds]
    2048 |         __skb_insert(newsk, next->prev, next, list);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/mac80211/sta_info.c:1620:37: note: while referencing 'pending'
    1620 |                 struct sk_buff_head pending;
         |                                     ^~~~~~~


vim +211 drivers/scsi/megaraid.c

^1da177e4c3f41 Linus Torvalds 2005-04-16  181  
^1da177e4c3f41 Linus Torvalds 2005-04-16  182  
^1da177e4c3f41 Linus Torvalds 2005-04-16  183  /*
^1da177e4c3f41 Linus Torvalds 2005-04-16  184   * mega_query_adapter()
^1da177e4c3f41 Linus Torvalds 2005-04-16  185   * @adapter - pointer to our soft state
^1da177e4c3f41 Linus Torvalds 2005-04-16  186   *
^1da177e4c3f41 Linus Torvalds 2005-04-16  187   * Issue the adapter inquiry commands to the controller and find out
^1da177e4c3f41 Linus Torvalds 2005-04-16  188   * information and parameter about the devices attached
^1da177e4c3f41 Linus Torvalds 2005-04-16  189   */
^1da177e4c3f41 Linus Torvalds 2005-04-16  190  static int
^1da177e4c3f41 Linus Torvalds 2005-04-16  191  mega_query_adapter(adapter_t *adapter)
^1da177e4c3f41 Linus Torvalds 2005-04-16  192  {
^1da177e4c3f41 Linus Torvalds 2005-04-16  193  	dma_addr_t	prod_info_dma_handle;
^1da177e4c3f41 Linus Torvalds 2005-04-16  194  	mega_inquiry3	*inquiry3;
^1da177e4c3f41 Linus Torvalds 2005-04-16  195  	u8	raw_mbox[sizeof(struct mbox_out)];
^1da177e4c3f41 Linus Torvalds 2005-04-16  196  	mbox_t	*mbox;
^1da177e4c3f41 Linus Torvalds 2005-04-16  197  	int	retval;
^1da177e4c3f41 Linus Torvalds 2005-04-16  198  
^1da177e4c3f41 Linus Torvalds 2005-04-16  199  	/* Initialize adapter inquiry mailbox */
^1da177e4c3f41 Linus Torvalds 2005-04-16  200  
^1da177e4c3f41 Linus Torvalds 2005-04-16  201  	mbox = (mbox_t *)raw_mbox;
^1da177e4c3f41 Linus Torvalds 2005-04-16  202  
^1da177e4c3f41 Linus Torvalds 2005-04-16  203  	memset((void *)adapter->mega_buffer, 0, MEGA_BUFFER_SIZE);
^1da177e4c3f41 Linus Torvalds 2005-04-16  204  	memset(&mbox->m_out, 0, sizeof(raw_mbox));
^1da177e4c3f41 Linus Torvalds 2005-04-16  205  
^1da177e4c3f41 Linus Torvalds 2005-04-16  206  	/*
^1da177e4c3f41 Linus Torvalds 2005-04-16  207  	 * Try to issue Inquiry3 command
^1da177e4c3f41 Linus Torvalds 2005-04-16  208  	 * if not succeeded, then issue MEGA_MBOXCMD_ADAPTERINQ command and
^1da177e4c3f41 Linus Torvalds 2005-04-16  209  	 * update enquiry3 structure
^1da177e4c3f41 Linus Torvalds 2005-04-16  210  	 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 @211  	mbox->m_out.xferaddr = (u32)adapter->buf_dma_handle;
^1da177e4c3f41 Linus Torvalds 2005-04-16  212  
^1da177e4c3f41 Linus Torvalds 2005-04-16  213  	inquiry3 = (mega_inquiry3 *)adapter->mega_buffer;
^1da177e4c3f41 Linus Torvalds 2005-04-16  214  
^1da177e4c3f41 Linus Torvalds 2005-04-16  215  	raw_mbox[0] = FC_NEW_CONFIG;		/* i.e. mbox->cmd=0xA1 */
^1da177e4c3f41 Linus Torvalds 2005-04-16  216  	raw_mbox[2] = NC_SUBOP_ENQUIRY3;	/* i.e. 0x0F */
^1da177e4c3f41 Linus Torvalds 2005-04-16  217  	raw_mbox[3] = ENQ3_GET_SOLICITED_FULL;	/* i.e. 0x02 */
^1da177e4c3f41 Linus Torvalds 2005-04-16  218  
^1da177e4c3f41 Linus Torvalds 2005-04-16  219  	/* Issue a blocking command to the card */
^1da177e4c3f41 Linus Torvalds 2005-04-16  220  	if ((retval = issue_scb_block(adapter, raw_mbox))) {
^1da177e4c3f41 Linus Torvalds 2005-04-16  221  		/* the adapter does not support 40ld */
^1da177e4c3f41 Linus Torvalds 2005-04-16  222  
^1da177e4c3f41 Linus Torvalds 2005-04-16  223  		mraid_ext_inquiry	*ext_inq;
^1da177e4c3f41 Linus Torvalds 2005-04-16  224  		mraid_inquiry		*inq;
^1da177e4c3f41 Linus Torvalds 2005-04-16  225  		dma_addr_t		dma_handle;
^1da177e4c3f41 Linus Torvalds 2005-04-16  226  
ec090ef8cd1c23 Suraj Upadhyay 2020-07-29  227  		ext_inq = dma_alloc_coherent(&adapter->dev->dev,
ec090ef8cd1c23 Suraj Upadhyay 2020-07-29  228  					     sizeof(mraid_ext_inquiry),
ec090ef8cd1c23 Suraj Upadhyay 2020-07-29  229  					     &dma_handle, GFP_KERNEL);
^1da177e4c3f41 Linus Torvalds 2005-04-16  230  
^1da177e4c3f41 Linus Torvalds 2005-04-16  231  		if( ext_inq == NULL ) return -1;
^1da177e4c3f41 Linus Torvalds 2005-04-16  232  
^1da177e4c3f41 Linus Torvalds 2005-04-16  233  		inq = &ext_inq->raid_inq;
^1da177e4c3f41 Linus Torvalds 2005-04-16  234  
^1da177e4c3f41 Linus Torvalds 2005-04-16  235  		mbox->m_out.xferaddr = (u32)dma_handle;
^1da177e4c3f41 Linus Torvalds 2005-04-16  236  
^1da177e4c3f41 Linus Torvalds 2005-04-16  237  		/*issue old 0x04 command to adapter */
^1da177e4c3f41 Linus Torvalds 2005-04-16  238  		mbox->m_out.cmd = MEGA_MBOXCMD_ADPEXTINQ;
^1da177e4c3f41 Linus Torvalds 2005-04-16  239  
^1da177e4c3f41 Linus Torvalds 2005-04-16  240  		issue_scb_block(adapter, raw_mbox);
^1da177e4c3f41 Linus Torvalds 2005-04-16  241  
^1da177e4c3f41 Linus Torvalds 2005-04-16  242  		/*
^1da177e4c3f41 Linus Torvalds 2005-04-16  243  		 * update Enquiry3 and ProductInfo structures with
^1da177e4c3f41 Linus Torvalds 2005-04-16  244  		 * mraid_inquiry structure
^1da177e4c3f41 Linus Torvalds 2005-04-16  245  		 */
^1da177e4c3f41 Linus Torvalds 2005-04-16  246  		mega_8_to_40ld(inq, inquiry3,
^1da177e4c3f41 Linus Torvalds 2005-04-16  247  				(mega_product_info *)&adapter->product_info);
^1da177e4c3f41 Linus Torvalds 2005-04-16  248  
ec090ef8cd1c23 Suraj Upadhyay 2020-07-29  249  		dma_free_coherent(&adapter->dev->dev,
ec090ef8cd1c23 Suraj Upadhyay 2020-07-29  250  				  sizeof(mraid_ext_inquiry), ext_inq,
ec090ef8cd1c23 Suraj Upadhyay 2020-07-29  251  				  dma_handle);
^1da177e4c3f41 Linus Torvalds 2005-04-16  252  
^1da177e4c3f41 Linus Torvalds 2005-04-16  253  	} else {		/*adapter supports 40ld */
^1da177e4c3f41 Linus Torvalds 2005-04-16  254  		adapter->flag |= BOARD_40LD;
^1da177e4c3f41 Linus Torvalds 2005-04-16  255  
^1da177e4c3f41 Linus Torvalds 2005-04-16  256  		/*
^1da177e4c3f41 Linus Torvalds 2005-04-16  257  		 * get product_info, which is static information and will be
^1da177e4c3f41 Linus Torvalds 2005-04-16  258  		 * unchanged
^1da177e4c3f41 Linus Torvalds 2005-04-16  259  		 */
ec090ef8cd1c23 Suraj Upadhyay 2020-07-29  260  		prod_info_dma_handle = dma_map_single(&adapter->dev->dev,
ec090ef8cd1c23 Suraj Upadhyay 2020-07-29  261  						      (void *)&adapter->product_info,
ec090ef8cd1c23 Suraj Upadhyay 2020-07-29  262  						      sizeof(mega_product_info),
ec090ef8cd1c23 Suraj Upadhyay 2020-07-29  263  						      DMA_FROM_DEVICE);
^1da177e4c3f41 Linus Torvalds 2005-04-16  264  
^1da177e4c3f41 Linus Torvalds 2005-04-16  265  		mbox->m_out.xferaddr = prod_info_dma_handle;
^1da177e4c3f41 Linus Torvalds 2005-04-16  266  
^1da177e4c3f41 Linus Torvalds 2005-04-16  267  		raw_mbox[0] = FC_NEW_CONFIG;	/* i.e. mbox->cmd=0xA1 */
^1da177e4c3f41 Linus Torvalds 2005-04-16  268  		raw_mbox[2] = NC_SUBOP_PRODUCT_INFO;	/* i.e. 0x0E */
^1da177e4c3f41 Linus Torvalds 2005-04-16  269  
^1da177e4c3f41 Linus Torvalds 2005-04-16  270  		if ((retval = issue_scb_block(adapter, raw_mbox)))
3b8a1ba378b750 Bjorn Helgaas  2015-07-07  271  			dev_warn(&adapter->dev->dev,
3b8a1ba378b750 Bjorn Helgaas  2015-07-07  272  				"Product_info cmd failed with error: %d\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16  273  				retval);
^1da177e4c3f41 Linus Torvalds 2005-04-16  274  
ec090ef8cd1c23 Suraj Upadhyay 2020-07-29  275  		dma_unmap_single(&adapter->dev->dev, prod_info_dma_handle,
ec090ef8cd1c23 Suraj Upadhyay 2020-07-29  276  				 sizeof(mega_product_info), DMA_FROM_DEVICE);
^1da177e4c3f41 Linus Torvalds 2005-04-16  277  	}
^1da177e4c3f41 Linus Torvalds 2005-04-16  278  
^1da177e4c3f41 Linus Torvalds 2005-04-16  279  
^1da177e4c3f41 Linus Torvalds 2005-04-16  280  	/*
^1da177e4c3f41 Linus Torvalds 2005-04-16  281  	 * kernel scans the channels from 0 to <= max_channel
^1da177e4c3f41 Linus Torvalds 2005-04-16  282  	 */
^1da177e4c3f41 Linus Torvalds 2005-04-16  283  	adapter->host->max_channel =
^1da177e4c3f41 Linus Torvalds 2005-04-16  284  		adapter->product_info.nchannels + NVIRT_CHAN -1;
^1da177e4c3f41 Linus Torvalds 2005-04-16  285  
^1da177e4c3f41 Linus Torvalds 2005-04-16  286  	adapter->host->max_id = 16;	/* max targets per channel */
^1da177e4c3f41 Linus Torvalds 2005-04-16  287  
^1da177e4c3f41 Linus Torvalds 2005-04-16  288  	adapter->host->max_lun = 7;	/* Up to 7 luns for non disk devices */
^1da177e4c3f41 Linus Torvalds 2005-04-16  289  
^1da177e4c3f41 Linus Torvalds 2005-04-16  290  	adapter->host->cmd_per_lun = max_cmd_per_lun;
^1da177e4c3f41 Linus Torvalds 2005-04-16  291  
^1da177e4c3f41 Linus Torvalds 2005-04-16  292  	adapter->numldrv = inquiry3->num_ldrv;
^1da177e4c3f41 Linus Torvalds 2005-04-16  293  
^1da177e4c3f41 Linus Torvalds 2005-04-16  294  	adapter->max_cmds = adapter->product_info.max_commands;
^1da177e4c3f41 Linus Torvalds 2005-04-16  295  
^1da177e4c3f41 Linus Torvalds 2005-04-16  296  	if(adapter->max_cmds > MAX_COMMANDS)
^1da177e4c3f41 Linus Torvalds 2005-04-16  297  		adapter->max_cmds = MAX_COMMANDS;
^1da177e4c3f41 Linus Torvalds 2005-04-16  298  
^1da177e4c3f41 Linus Torvalds 2005-04-16  299  	adapter->host->can_queue = adapter->max_cmds - 1;
^1da177e4c3f41 Linus Torvalds 2005-04-16  300  
^1da177e4c3f41 Linus Torvalds 2005-04-16  301  	/*
^1da177e4c3f41 Linus Torvalds 2005-04-16  302  	 * Get the maximum number of scatter-gather elements supported by this
^1da177e4c3f41 Linus Torvalds 2005-04-16  303  	 * firmware
^1da177e4c3f41 Linus Torvalds 2005-04-16  304  	 */
^1da177e4c3f41 Linus Torvalds 2005-04-16  305  	mega_get_max_sgl(adapter);
^1da177e4c3f41 Linus Torvalds 2005-04-16  306  
^1da177e4c3f41 Linus Torvalds 2005-04-16  307  	adapter->host->sg_tablesize = adapter->sglen;
^1da177e4c3f41 Linus Torvalds 2005-04-16  308  
124dd90f6525ee Adam Radford   2012-01-10  309  	/* use HP firmware and bios version encoding
124dd90f6525ee Adam Radford   2012-01-10  310  	   Note: fw_version[0|1] and bios_version[0|1] were originally shifted
124dd90f6525ee Adam Radford   2012-01-10  311  	   right 8 bits making them zero. This 0 value was hardcoded to fix
124dd90f6525ee Adam Radford   2012-01-10  312  	   sparse warnings. */
54ebfd57813ada Jon Mason      2012-07-10  313  	if (adapter->product_info.subsysvid == PCI_VENDOR_ID_HP) {
875826a71c8b5e Arnd Bergmann  2017-07-14  314  		snprintf(adapter->fw_version, sizeof(adapter->fw_version),
875826a71c8b5e Arnd Bergmann  2017-07-14  315  			 "%c%d%d.%d%d",
^1da177e4c3f41 Linus Torvalds 2005-04-16  316  			 adapter->product_info.fw_version[2],
124dd90f6525ee Adam Radford   2012-01-10  317  			 0,
^1da177e4c3f41 Linus Torvalds 2005-04-16  318  			 adapter->product_info.fw_version[1] & 0x0f,
124dd90f6525ee Adam Radford   2012-01-10  319  			 0,
^1da177e4c3f41 Linus Torvalds 2005-04-16  320  			 adapter->product_info.fw_version[0] & 0x0f);
875826a71c8b5e Arnd Bergmann  2017-07-14  321  		snprintf(adapter->bios_version, sizeof(adapter->fw_version),
875826a71c8b5e Arnd Bergmann  2017-07-14  322  			 "%c%d%d.%d%d",
^1da177e4c3f41 Linus Torvalds 2005-04-16  323  			 adapter->product_info.bios_version[2],
124dd90f6525ee Adam Radford   2012-01-10  324  			 0,
^1da177e4c3f41 Linus Torvalds 2005-04-16  325  			 adapter->product_info.bios_version[1] & 0x0f,
124dd90f6525ee Adam Radford   2012-01-10  326  			 0,
^1da177e4c3f41 Linus Torvalds 2005-04-16  327  			 adapter->product_info.bios_version[0] & 0x0f);
^1da177e4c3f41 Linus Torvalds 2005-04-16  328  	} else {
^1da177e4c3f41 Linus Torvalds 2005-04-16  329  		memcpy(adapter->fw_version,
^1da177e4c3f41 Linus Torvalds 2005-04-16  330  				(char *)adapter->product_info.fw_version, 4);
^1da177e4c3f41 Linus Torvalds 2005-04-16  331  		adapter->fw_version[4] = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16  332  
^1da177e4c3f41 Linus Torvalds 2005-04-16  333  		memcpy(adapter->bios_version,
^1da177e4c3f41 Linus Torvalds 2005-04-16  334  				(char *)adapter->product_info.bios_version, 4);
^1da177e4c3f41 Linus Torvalds 2005-04-16  335  
^1da177e4c3f41 Linus Torvalds 2005-04-16  336  		adapter->bios_version[4] = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16  337  	}
^1da177e4c3f41 Linus Torvalds 2005-04-16  338  
3b8a1ba378b750 Bjorn Helgaas  2015-07-07  339  	dev_notice(&adapter->dev->dev, "[%s:%s] detected %d logical drives\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16  340  		adapter->fw_version, adapter->bios_version, adapter->numldrv);
^1da177e4c3f41 Linus Torvalds 2005-04-16  341  
^1da177e4c3f41 Linus Torvalds 2005-04-16  342  	/*
^1da177e4c3f41 Linus Torvalds 2005-04-16  343  	 * Do we support extended (>10 bytes) cdbs
^1da177e4c3f41 Linus Torvalds 2005-04-16  344  	 */
^1da177e4c3f41 Linus Torvalds 2005-04-16  345  	adapter->support_ext_cdb = mega_support_ext_cdb(adapter);
^1da177e4c3f41 Linus Torvalds 2005-04-16  346  	if (adapter->support_ext_cdb)
3b8a1ba378b750 Bjorn Helgaas  2015-07-07  347  		dev_notice(&adapter->dev->dev, "supports extended CDBs\n");
^1da177e4c3f41 Linus Torvalds 2005-04-16  348  
^1da177e4c3f41 Linus Torvalds 2005-04-16  349  
^1da177e4c3f41 Linus Torvalds 2005-04-16  350  	return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16  351  }
^1da177e4c3f41 Linus Torvalds 2005-04-16  352  

:::::: The code at line 211 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 43248 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-18 12:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-18 12:47 [kees:kspp/array-bounds/next-20210816/v1 9/10] drivers/scsi/megaraid.c:211:13: warning: array subscript 'mbox_t[0]' is partly outside array bounds of 'u8[15]' {aka 'unsigned char[15]'} kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).