[PATCH v1 1/1] misc: IBM Virtual Management Channel Driver

kbuild test robot lkp at intel.com
Wed Apr 25 22:00:15 AEST 2018


Hi Bryant,

I love your patch! Perhaps something to improve:

[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on v4.17-rc2 next-20180424]
[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/Bryant-G-Ly/misc-IBM-Virtual-Management-Channel-Driver/20180424-060306
config: powerpc64-allyesconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.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
        make.cross ARCH=powerpc64 

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//misc/ibmvmc.c: In function 'ibmvmc_probe':
>> drivers//misc/ibmvmc.c:2133:5: warning: 'rc' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (rc == H_RESOURCE)
        ^
   drivers//misc/ibmvmc.c:2111:6: note: 'rc' was declared here
     int rc;
         ^~

vim +/rc +2133 drivers//misc/ibmvmc.c

  2097	
  2098	/**
  2099	 * ibmvmc_init_crq_queue - Init CRQ Queue
  2100	 *
  2101	 * @adapter:	crq_server_adapter struct
  2102	 *
  2103	 * Return:
  2104	 *	0 - Success
  2105	 *	Non-zero - Failure
  2106	 */
  2107	static int ibmvmc_init_crq_queue(struct crq_server_adapter *adapter)
  2108	{
  2109		struct vio_dev *vdev = to_vio_dev(adapter->dev);
  2110		struct crq_queue *queue = &adapter->queue;
  2111		int rc;
  2112		int retrc;
  2113	
  2114		queue->msgs = (struct ibmvmc_crq_msg *)get_zeroed_page(GFP_KERNEL);
  2115	
  2116		if (!queue->msgs)
  2117			goto malloc_failed;
  2118	
  2119		queue->size = PAGE_SIZE / sizeof(*queue->msgs);
  2120	
  2121		queue->msg_token = dma_map_single(adapter->dev, queue->msgs,
  2122						  queue->size * sizeof(*queue->msgs),
  2123						  DMA_BIDIRECTIONAL);
  2124	
  2125		if (dma_mapping_error(adapter->dev, queue->msg_token))
  2126			goto map_failed;
  2127	
  2128		retrc = plpar_hcall_norets(H_REG_CRQ,
  2129					   vdev->unit_address,
  2130					   queue->msg_token, PAGE_SIZE);
  2131		retrc = rc;
  2132	
> 2133		if (rc == H_RESOURCE)
  2134			rc = ibmvmc_reset_crq_queue(adapter);
  2135	
  2136		if (rc == 2) {
  2137			dev_warn(adapter->dev, "Partner adapter not ready\n");
  2138			retrc = 0;
  2139		} else if (rc != 0) {
  2140			dev_err(adapter->dev, "Error %d opening adapter\n", rc);
  2141			goto reg_crq_failed;
  2142		}
  2143	
  2144		queue->cur = 0;
  2145		spin_lock_init(&queue->lock);
  2146	
  2147		tasklet_init(&adapter->work_task, ibmvmc_task, (unsigned long)adapter);
  2148	
  2149		if (request_irq(vdev->irq,
  2150				ibmvmc_handle_event,
  2151				0, "ibmvmc", (void *)adapter) != 0) {
  2152			dev_err(adapter->dev, "couldn't register irq 0x%x\n",
  2153				vdev->irq);
  2154			goto req_irq_failed;
  2155		}
  2156	
  2157		rc = vio_enable_interrupts(vdev);
  2158		if (rc != 0) {
  2159			dev_err(adapter->dev, "Error %d enabling interrupts!!!\n", rc);
  2160			goto req_irq_failed;
  2161		}
  2162	
  2163		return retrc;
  2164	
  2165	req_irq_failed:
  2166		/* Cannot have any work since we either never got our IRQ registered,
  2167		 * or never got interrupts enabled
  2168		 */
  2169		tasklet_kill(&adapter->work_task);
  2170		h_free_crq(vdev->unit_address);
  2171	reg_crq_failed:
  2172		dma_unmap_single(adapter->dev,
  2173				 queue->msg_token,
  2174				 queue->size * sizeof(*queue->msgs), DMA_BIDIRECTIONAL);
  2175	map_failed:
  2176		free_page((unsigned long)queue->msgs);
  2177	malloc_failed:
  2178		return -ENOMEM;
  2179	}
  2180	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 56234 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20180425/f24529a9/attachment-0001.gz>


More information about the Linuxppc-dev mailing list