Re: [PATCH 32/32] elx: efct: Tie into kernel Kconfig and build process

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

 



Hi James,

I love your patch! Perhaps something to improve:

[auto build test WARNING on mkp-scsi/for-next]
[cannot apply to v5.4-rc4 next-20191025]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/James-Smart/efct-Broadcom-Emulex-FC-Target-driver/20191026-050814
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=ia64 

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

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers/scsi/elx/libefc_sli/sli4.c: In function 'sli_fc_rq_set_alloc':
>> drivers/scsi/elx/libefc_sli/sli4.c:818:12: warning: 'offset' may be used uninitialized in this function [-Wmaybe-uninitialized]
     u32 i, p, offset;
               ^~~~~~

vim +/offset +818 drivers/scsi/elx/libefc_sli/sli4.c

8994bfd36daa33 James Smart 2019-10-23  795  
8994bfd36daa33 James Smart 2019-10-23  796  /**
8994bfd36daa33 James Smart 2019-10-23  797   * @ingroup sli_fc
8994bfd36daa33 James Smart 2019-10-23  798   * @brief Write an RQ_CREATE_V2 command.
8994bfd36daa33 James Smart 2019-10-23  799   *
8994bfd36daa33 James Smart 2019-10-23  800   * @param sli4 SLI context.
8994bfd36daa33 James Smart 2019-10-23  801   * @param buf Destination buffer for the command.
8994bfd36daa33 James Smart 2019-10-23  802   * @param size Buffer size, in bytes.
8994bfd36daa33 James Smart 2019-10-23  803   * @param qmem DMA memory for the queue.
8994bfd36daa33 James Smart 2019-10-23  804   * @param cq_id Associated CQ_ID.
8994bfd36daa33 James Smart 2019-10-23  805   * @param buffer_size Buffer size pointed to by each RQE.
8994bfd36daa33 James Smart 2019-10-23  806   *
8994bfd36daa33 James Smart 2019-10-23  807   * @note This creates a Version 0 message
8994bfd36daa33 James Smart 2019-10-23  808   *
8994bfd36daa33 James Smart 2019-10-23  809   * @return Returns zero for success and non-zero for failure.
8994bfd36daa33 James Smart 2019-10-23  810   */
8994bfd36daa33 James Smart 2019-10-23  811  static int
8994bfd36daa33 James Smart 2019-10-23  812  sli_cmd_rq_create_v2(struct sli4_s *sli4, u32 num_rqs,
8994bfd36daa33 James Smart 2019-10-23  813  		     struct sli4_queue_s *qs[], u32 base_cq_id,
8994bfd36daa33 James Smart 2019-10-23  814  		     u32 header_buffer_size,
8994bfd36daa33 James Smart 2019-10-23  815  		     u32 payload_buffer_size, struct efc_dma_s *dma)
8994bfd36daa33 James Smart 2019-10-23  816  {
8994bfd36daa33 James Smart 2019-10-23  817  	struct sli4_rqst_rq_create_v2_s *req = NULL;
8994bfd36daa33 James Smart 2019-10-23 @818  	u32 i, p, offset;
8994bfd36daa33 James Smart 2019-10-23  819  	u32 payload_size, page_count;
8994bfd36daa33 James Smart 2019-10-23  820  	uintptr_t addr;
8994bfd36daa33 James Smart 2019-10-23  821  	u32 num_pages;
8994bfd36daa33 James Smart 2019-10-23  822  
8994bfd36daa33 James Smart 2019-10-23  823  	page_count =  sli_page_count(qs[0]->dma.size, SLI_PAGE_SIZE) * num_rqs;
8994bfd36daa33 James Smart 2019-10-23  824  
8994bfd36daa33 James Smart 2019-10-23  825  	/* Payload length must accommodate both request and response */
8994bfd36daa33 James Smart 2019-10-23  826  	payload_size = max(CFG_RQST_CMDSZ(rq_create_v2) +
8994bfd36daa33 James Smart 2019-10-23  827  			   SZ_DMAADDR * page_count,
8994bfd36daa33 James Smart 2019-10-23  828  			   sizeof(struct sli4_rsp_cmn_create_queue_set_s));
8994bfd36daa33 James Smart 2019-10-23  829  
8994bfd36daa33 James Smart 2019-10-23  830  	dma->size = payload_size;
8994bfd36daa33 James Smart 2019-10-23  831  	dma->virt = dma_alloc_coherent(&sli4->pcidev->dev, dma->size,
8994bfd36daa33 James Smart 2019-10-23  832  				      &dma->phys, GFP_DMA);
8994bfd36daa33 James Smart 2019-10-23  833  	if (!dma->virt)
8994bfd36daa33 James Smart 2019-10-23  834  		return EFC_FAIL;
8994bfd36daa33 James Smart 2019-10-23  835  
8994bfd36daa33 James Smart 2019-10-23  836  	memset(dma->virt, 0, payload_size);
8994bfd36daa33 James Smart 2019-10-23  837  
8994bfd36daa33 James Smart 2019-10-23  838  	req = sli_config_cmd_init(sli4, sli4->bmbx.virt, SLI4_BMBX_SIZE,
8994bfd36daa33 James Smart 2019-10-23  839  			       payload_size, dma);
8994bfd36daa33 James Smart 2019-10-23  840  	if (!req)
8994bfd36daa33 James Smart 2019-10-23  841  		return EFC_FAIL;
8994bfd36daa33 James Smart 2019-10-23  842  
8994bfd36daa33 James Smart 2019-10-23  843  	/* Fill Header fields */
8994bfd36daa33 James Smart 2019-10-23  844  	req->hdr.opcode    = SLI4_OPC_RQ_CREATE;
8994bfd36daa33 James Smart 2019-10-23  845  	req->hdr.subsystem = SLI4_SUBSYSTEM_FC;
8994bfd36daa33 James Smart 2019-10-23  846  	req->hdr.dw3_version   = cpu_to_le32(CMD_V2);
8994bfd36daa33 James Smart 2019-10-23  847  	req->hdr.request_length = CFG_RQST_PYLD_LEN_VAR(rq_create_v2,
8994bfd36daa33 James Smart 2019-10-23  848  						SZ_DMAADDR * page_count);
8994bfd36daa33 James Smart 2019-10-23  849  
8994bfd36daa33 James Smart 2019-10-23  850  	/* Fill Payload fields */
8994bfd36daa33 James Smart 2019-10-23  851  	req->dim_dfd_dnb  |= SLI4_RQCREATEV2_DNB;
8994bfd36daa33 James Smart 2019-10-23  852  	num_pages = sli_page_count(qs[0]->dma.size, SLI_PAGE_SIZE);
8994bfd36daa33 James Smart 2019-10-23  853  	req->num_pages	   = cpu_to_le16(num_pages);
8994bfd36daa33 James Smart 2019-10-23  854  	req->rqe_count     = cpu_to_le16(qs[0]->dma.size / SLI4_RQE_SIZE);
8994bfd36daa33 James Smart 2019-10-23  855  	req->rqe_size_byte |= SLI4_RQE_SIZE_8;
8994bfd36daa33 James Smart 2019-10-23  856  	req->page_size     = SLI4_RQ_PAGE_SIZE_4096;
8994bfd36daa33 James Smart 2019-10-23  857  	req->rq_count      = num_rqs;
8994bfd36daa33 James Smart 2019-10-23  858  	req->base_cq_id    = cpu_to_le16(base_cq_id);
8994bfd36daa33 James Smart 2019-10-23  859  	req->hdr_buffer_size     = cpu_to_le16(header_buffer_size);
8994bfd36daa33 James Smart 2019-10-23  860  	req->payload_buffer_size = cpu_to_le16(payload_buffer_size);
8994bfd36daa33 James Smart 2019-10-23  861  
8994bfd36daa33 James Smart 2019-10-23  862  	for (i = 0; i < num_rqs; i++) {
8994bfd36daa33 James Smart 2019-10-23  863  		for (p = 0, addr = qs[i]->dma.phys; p < num_pages;
8994bfd36daa33 James Smart 2019-10-23  864  		     p++, addr += SLI_PAGE_SIZE) {
8994bfd36daa33 James Smart 2019-10-23  865  			req->page_phys_addr[offset].low =
8994bfd36daa33 James Smart 2019-10-23  866  					cpu_to_le32(lower_32_bits(addr));
8994bfd36daa33 James Smart 2019-10-23  867  			req->page_phys_addr[offset].high =
8994bfd36daa33 James Smart 2019-10-23  868  					cpu_to_le32(upper_32_bits(addr));
8994bfd36daa33 James Smart 2019-10-23  869  			offset++;
8994bfd36daa33 James Smart 2019-10-23  870  		}
8994bfd36daa33 James Smart 2019-10-23  871  	}
8994bfd36daa33 James Smart 2019-10-23  872  
8994bfd36daa33 James Smart 2019-10-23  873  	return EFC_SUCCESS;
8994bfd36daa33 James Smart 2019-10-23  874  }
8994bfd36daa33 James Smart 2019-10-23  875  

:::::: The code at line 818 was first introduced by commit
:::::: 8994bfd36daa331dd81afd4af5a1d567fb75b6ac elx: libefc_sli: queue create/destroy/parse routines

:::::: TO: James Smart <jsmart2021@xxxxxxxxx>
:::::: CC: 0day robot <lkp@xxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux