All of lore.kernel.org
 help / color / mirror / Atom feed
* [lpieralisi-pci:pci/hv 5/5] drivers/pci/controller/pci-hyperv.c:2101:26: sparse: sparse: incorrect type in assignment (different base types)
@ 2020-03-05 20:56 kbuild test robot
  2020-03-05 23:30 ` Dexuan Cui
  0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2020-03-05 20:56 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git pci/hv
head:   d0e3c3fdf000bacd3fb11c6eb97a38ca27fe915c
commit: d0e3c3fdf000bacd3fb11c6eb97a38ca27fe915c [5/5] PCI: hv: Replace zero-length array with flexible-array member
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-174-g094d5a94-dirty
        git checkout d0e3c3fdf000bacd3fb11c6eb97a38ca27fe915c
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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


sparse warnings: (new ones prefixed by >>)

   drivers/pci/controller/pci-hyperv.c:974:5: sparse: sparse: symbol 'hv_read_config_block' was not declared. Should it be static?
   drivers/pci/controller/pci-hyperv.c:1054:5: sparse: sparse: symbol 'hv_write_config_block' was not declared. Should it be static?
   drivers/pci/controller/pci-hyperv.c:1123:5: sparse: sparse: symbol 'hv_register_block_invalidate' was not declared. Should it be static?
>> drivers/pci/controller/pci-hyperv.c:2101:26: sparse: sparse: incorrect type in assignment (different base types)
>> drivers/pci/controller/pci-hyperv.c:2101:26: sparse:    expected struct hv_pcidev_description *new_desc
>> drivers/pci/controller/pci-hyperv.c:2101:26: sparse:    got struct pci_function_description *
   drivers/pci/controller/pci-hyperv.c:2293:28: sparse: sparse: no member 'flags' in struct pci_function_description
   drivers/pci/controller/pci-hyperv.c:2294:28: sparse: sparse: no member 'virtual_numa_node' in struct pci_function_description

vim +2101 drivers/pci/controller/pci-hyperv.c

4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2029  
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2030  /**
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2031   * pci_devices_present_work() - Handle new list of child devices
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2032   * @work:	Work struct embedded in struct hv_dr_work
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2033   *
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2034   * "Bus Relations" is the Windows term for "children of this
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2035   * bus."  The terminology is preserved here for people trying to
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2036   * debug the interaction between Hyper-V and Linux.  This
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2037   * function is called when the parent partition reports a list
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2038   * of functions that should be observed under this PCI Express
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2039   * port (bus).
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2040   *
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2041   * This function updates the list, and must tolerate being
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2042   * called multiple times with the same information.  The typical
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2043   * number of child devices is one, with very atypical cases
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2044   * involving three or four, so the algorithms used here can be
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2045   * simple and inefficient.
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2046   *
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2047   * It must also treat the omission of a previously observed device as
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2048   * notification that the device no longer exists.
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2049   *
021ad274d7dc31 drivers/pci/host/pci-hyperv.c       Dexuan Cui        2018-03-15  2050   * Note that this function is serialized with hv_eject_device_work(),
021ad274d7dc31 drivers/pci/host/pci-hyperv.c       Dexuan Cui        2018-03-15  2051   * because both are pushed to the ordered workqueue hbus->wq.
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2052   */
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2053  static void pci_devices_present_work(struct work_struct *work)
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2054  {
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2055  	u32 child_no;
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2056  	bool found;
981e3ed0791edc drivers/pci/controller/pci-hyperv.c Long Li           2020-02-25  2057  	struct hv_pcidev_description *new_desc;
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2058  	struct hv_pci_dev *hpdev;
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2059  	struct hv_pcibus_device *hbus;
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2060  	struct list_head removed;
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2061  	struct hv_dr_work *dr_wrk;
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2062  	struct hv_dr_state *dr = NULL;
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2063  	unsigned long flags;
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2064  
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2065  	dr_wrk = container_of(work, struct hv_dr_work, wrk);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2066  	hbus = dr_wrk->bus;
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2067  	kfree(dr_wrk);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2068  
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2069  	INIT_LIST_HEAD(&removed);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2070  
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2071  	/* Pull this off the queue and process it if it was the last one. */
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2072  	spin_lock_irqsave(&hbus->device_list_lock, flags);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2073  	while (!list_empty(&hbus->dr_list)) {
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2074  		dr = list_first_entry(&hbus->dr_list, struct hv_dr_state,
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2075  				      list_entry);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2076  		list_del(&dr->list_entry);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2077  
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2078  		/* Throw this away if the list still has stuff in it. */
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2079  		if (!list_empty(&hbus->dr_list)) {
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2080  			kfree(dr);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2081  			continue;
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2082  		}
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2083  	}
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2084  	spin_unlock_irqrestore(&hbus->device_list_lock, flags);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2085  
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2086  	if (!dr) {
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2087  		put_hvpcibus(hbus);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2088  		return;
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2089  	}
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2090  
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2091  	/* First, mark all existing children as reported missing. */
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2092  	spin_lock_irqsave(&hbus->device_list_lock, flags);
5b8db8f66e08fa drivers/pci/host/pci-hyperv.c       Stephen Hemminger 2018-05-23  2093  	list_for_each_entry(hpdev, &hbus->children, list_entry) {
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2094  		hpdev->reported_missing = true;
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2095  	}
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2096  	spin_unlock_irqrestore(&hbus->device_list_lock, flags);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2097  
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2098  	/* Next, add back any reported devices. */
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2099  	for (child_no = 0; child_no < dr->device_count; child_no++) {
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2100  		found = false;
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16 @2101  		new_desc = &dr->func[child_no];
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2102  
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2103  		spin_lock_irqsave(&hbus->device_list_lock, flags);
5b8db8f66e08fa drivers/pci/host/pci-hyperv.c       Stephen Hemminger 2018-05-23  2104  		list_for_each_entry(hpdev, &hbus->children, list_entry) {
5b8db8f66e08fa drivers/pci/host/pci-hyperv.c       Stephen Hemminger 2018-05-23  2105  			if ((hpdev->desc.win_slot.slot == new_desc->win_slot.slot) &&
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2106  			    (hpdev->desc.v_id == new_desc->v_id) &&
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2107  			    (hpdev->desc.d_id == new_desc->d_id) &&
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2108  			    (hpdev->desc.ser == new_desc->ser)) {
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2109  				hpdev->reported_missing = false;
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2110  				found = true;
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2111  			}
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2112  		}
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2113  		spin_unlock_irqrestore(&hbus->device_list_lock, flags);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2114  
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2115  		if (!found) {
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2116  			hpdev = new_pcichild_device(hbus, new_desc);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2117  			if (!hpdev)
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2118  				dev_err(&hbus->hdev->device,
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2119  					"couldn't record a child device.\n");
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2120  		}
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2121  	}
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2122  
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2123  	/* Move missing children to a list on the stack. */
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2124  	spin_lock_irqsave(&hbus->device_list_lock, flags);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2125  	do {
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2126  		found = false;
5b8db8f66e08fa drivers/pci/host/pci-hyperv.c       Stephen Hemminger 2018-05-23  2127  		list_for_each_entry(hpdev, &hbus->children, list_entry) {
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2128  			if (hpdev->reported_missing) {
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2129  				found = true;
8c99e120ffcabc drivers/pci/host/pci-hyperv.c       Stephen Hemminger 2018-05-23  2130  				put_pcichild(hpdev);
4f1cb01a789258 drivers/pci/host/pci-hyperv.c       Wei Yongjun       2016-07-28  2131  				list_move_tail(&hpdev->list_entry, &removed);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2132  				break;
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2133  			}
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2134  		}
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2135  	} while (found);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2136  	spin_unlock_irqrestore(&hbus->device_list_lock, flags);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2137  
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2138  	/* Delete everything that should no longer exist. */
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2139  	while (!list_empty(&removed)) {
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2140  		hpdev = list_first_entry(&removed, struct hv_pci_dev,
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2141  					 list_entry);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2142  		list_del(&hpdev->list_entry);
340d455699400f drivers/pci/controller/pci-hyperv.c Dexuan Cui        2019-03-04  2143  
340d455699400f drivers/pci/controller/pci-hyperv.c Dexuan Cui        2019-03-04  2144  		if (hpdev->pci_slot)
340d455699400f drivers/pci/controller/pci-hyperv.c Dexuan Cui        2019-03-04  2145  			pci_destroy_slot(hpdev->pci_slot);
340d455699400f drivers/pci/controller/pci-hyperv.c Dexuan Cui        2019-03-04  2146  
8c99e120ffcabc drivers/pci/host/pci-hyperv.c       Stephen Hemminger 2018-05-23  2147  		put_pcichild(hpdev);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2148  	}
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2149  
d3a78d8bf759d8 drivers/pci/host/pci-hyperv.c       Long Li           2017-03-23  2150  	switch (hbus->state) {
d3a78d8bf759d8 drivers/pci/host/pci-hyperv.c       Long Li           2017-03-23  2151  	case hv_pcibus_installed:
d3a78d8bf759d8 drivers/pci/host/pci-hyperv.c       Long Li           2017-03-23  2152  		/*
d3a78d8bf759d8 drivers/pci/host/pci-hyperv.c       Long Li           2017-03-23  2153  		 * Tell the core to rescan bus
d3a78d8bf759d8 drivers/pci/host/pci-hyperv.c       Long Li           2017-03-23  2154  		 * because there may have been changes.
d3a78d8bf759d8 drivers/pci/host/pci-hyperv.c       Long Li           2017-03-23  2155  		 */
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2156  		pci_lock_rescan_remove();
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2157  		pci_scan_child_bus(hbus->pci_bus);
ae685159fb7cdb drivers/pci/controller/pci-hyperv.c Long Li           2020-02-25  2158  		hv_pci_assign_numa_node(hbus);
a15f2c08c70811 drivers/pci/controller/pci-hyperv.c Stephen Hemminger 2018-09-14  2159  		hv_pci_assign_slots(hbus);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2160  		pci_unlock_rescan_remove();
d3a78d8bf759d8 drivers/pci/host/pci-hyperv.c       Long Li           2017-03-23  2161  		break;
d3a78d8bf759d8 drivers/pci/host/pci-hyperv.c       Long Li           2017-03-23  2162  
d3a78d8bf759d8 drivers/pci/host/pci-hyperv.c       Long Li           2017-03-23  2163  	case hv_pcibus_init:
d3a78d8bf759d8 drivers/pci/host/pci-hyperv.c       Long Li           2017-03-23  2164  	case hv_pcibus_probed:
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2165  		survey_child_resources(hbus);
d3a78d8bf759d8 drivers/pci/host/pci-hyperv.c       Long Li           2017-03-23  2166  		break;
d3a78d8bf759d8 drivers/pci/host/pci-hyperv.c       Long Li           2017-03-23  2167  
d3a78d8bf759d8 drivers/pci/host/pci-hyperv.c       Long Li           2017-03-23  2168  	default:
d3a78d8bf759d8 drivers/pci/host/pci-hyperv.c       Long Li           2017-03-23  2169  		break;
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2170  	}
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2171  
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2172  	put_hvpcibus(hbus);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2173  	kfree(dr);
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2174  }
4daace0d8ce851 drivers/pci/host/pci-hyperv.c       Jake Oshins       2016-02-16  2175  

:::::: The code at line 2101 was first introduced by commit
:::::: 4daace0d8ce851f8f8f91563c835e3000c954d5e PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs

:::::: TO: Jake Oshins <jakeo@microsoft.com>
:::::: CC: Bjorn Helgaas <bhelgaas@google.com>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [lpieralisi-pci:pci/hv 5/5] drivers/pci/controller/pci-hyperv.c:2101:26: sparse: sparse: incorrect type in assignment (different base types)
  2020-03-05 20:56 [lpieralisi-pci:pci/hv 5/5] drivers/pci/controller/pci-hyperv.c:2101:26: sparse: sparse: incorrect type in assignment (different base types) kbuild test robot
@ 2020-03-05 23:30 ` Dexuan Cui
  0 siblings, 0 replies; 3+ messages in thread
From: Dexuan Cui @ 2020-03-05 23:30 UTC (permalink / raw)
  To: kbuild-all

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

> From: kbuild test robot <lkp@intel.com>
> Sent: Thursday, March 5, 2020 12:57 PM
> To: Gustavo A. R. Silva <gustavo@embeddedor.com>
> Cc: kbuild-all(a)lists.01.org; Bjorn Helgaas <helgaas@kernel.org>; Lorenzo
> Pieralisi <lorenzo.pieralisi@arm.com>; Dexuan Cui <decui@microsoft.com>
> Subject: [lpieralisi-pci:pci/hv 5/5] drivers/pci/controller/pci-hyperv.c:2101:26:
> sparse: sparse: incorrect type in assignment (different base types)
> 
> tree: ...
> head:   d0e3c3fdf000bacd3fb11c6eb97a38ca27fe915c
> commit: d0e3c3fdf000bacd3fb11c6eb97a38ca27fe915c [5/5] PCI: hv: Replace
> zero-length array with flexible-array member
> reproduce:
>         # apt-get install sparse
>         # sparse version: v0.6.1-174-g094d5a94-dirty
>         git checkout d0e3c3fdf000bacd3fb11c6eb97a38ca27fe915c
>         make ARCH=x86_64 allmodconfig
>         make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>

There is a merge mistake, causing this building failure.

And, Long Li's patch introduced a new zero-lengh array in struct pci_bus_relations2:
ae685159fb7c ("PCI: hv: Add support for protocol 1.3 and support PCI_BUS_RELATIONS2")

The below patch fixes the 2 issues above. I also attached the patch FYI.

Thanks,
-- Dexuan

diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
index 630d79792fa7..88fd39254e0c 100644
--- a/drivers/pci/controller/pci-hyperv.c
+++ b/drivers/pci/controller/pci-hyperv.c
@@ -325,7 +325,7 @@ struct pci_bus_relations {
 struct pci_bus_relations2 {
 	struct pci_incoming_message incoming;
 	u32 device_count;
-	struct pci_function_description2 func[0];
+	struct pci_function_description2 func[];
 } __packed;
 
 struct pci_q_res_req_response {
@@ -551,7 +551,7 @@ struct hv_pcidev_description {
 struct hv_dr_state {
 	struct list_head list_entry;
 	u32 device_count;
-	struct pci_function_description func[];
+	struct hv_pcidev_description func[];
 };
 
 enum hv_pcichild_state {

[-- Attachment #2: fix_hv_pci.patch --]
[-- Type: application/octet-stream, Size: 719 bytes --]

diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
index 630d79792fa7..88fd39254e0c 100644
--- a/drivers/pci/controller/pci-hyperv.c
+++ b/drivers/pci/controller/pci-hyperv.c
@@ -325,7 +325,7 @@ struct pci_bus_relations {
 struct pci_bus_relations2 {
 	struct pci_incoming_message incoming;
 	u32 device_count;
-	struct pci_function_description2 func[0];
+	struct pci_function_description2 func[];
 } __packed;
 
 struct pci_q_res_req_response {
@@ -551,7 +551,7 @@ struct hv_pcidev_description {
 struct hv_dr_state {
 	struct list_head list_entry;
 	u32 device_count;
-	struct pci_function_description func[];
+	struct hv_pcidev_description func[];
 };
 
 enum hv_pcichild_state {

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [lpieralisi-pci:pci/hv 5/5] drivers/pci/controller/pci-hyperv.c:2101:26: sparse: sparse: incorrect type in assignment (different base types)
       [not found] <HK0P153MB02738BCFE37BCCB900F0BE71BFE20@HK0P153MB0273.APCP153.PROD.OUTLOOK.COM>
@ 2020-03-06 10:47 ` Lorenzo Pieralisi
  0 siblings, 0 replies; 3+ messages in thread
From: Lorenzo Pieralisi @ 2020-03-06 10:47 UTC (permalink / raw)
  To: kbuild-all

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

On Thu, Mar 05, 2020 at 11:30:32PM +0000, Dexuan Cui wrote:
> > From: kbuild test robot <lkp@intel.com>
> > Sent: Thursday, March 5, 2020 12:57 PM
> > To: Gustavo A. R. Silva <gustavo@embeddedor.com>
> > Cc: kbuild-all(a)lists.01.org; Bjorn Helgaas <helgaas@kernel.org>; Lorenzo
> > Pieralisi <lorenzo.pieralisi@arm.com>; Dexuan Cui <decui@microsoft.com>
> > Subject: [lpieralisi-pci:pci/hv 5/5] drivers/pci/controller/pci-hyperv.c:2101:26:
> > sparse: sparse: incorrect type in assignment (different base types)
> > 
> > tree: ...
> > head:   d0e3c3fdf000bacd3fb11c6eb97a38ca27fe915c
> > commit: d0e3c3fdf000bacd3fb11c6eb97a38ca27fe915c [5/5] PCI: hv: Replace
> > zero-length array with flexible-array member
> > reproduce:
> >         # apt-get install sparse
> >         # sparse version: v0.6.1-174-g094d5a94-dirty
> >         git checkout d0e3c3fdf000bacd3fb11c6eb97a38ca27fe915c
> >         make ARCH=x86_64 allmodconfig
> >         make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
> > 
> > If you fix the issue, kindly add following tag
> > Reported-by: kbuild test robot <lkp@intel.com>
> 
> There is a merge mistake, causing this building failure.
> 
> And, Long Li's patch introduced a new zero-lengh array in struct pci_bus_relations2:
> ae685159fb7c ("PCI: hv: Add support for protocol 1.3 and support PCI_BUS_RELATIONS2")
> 
> The below patch fixes the 2 issues above. I also attached the patch FYI.

Applied, sorry I messed up the merge with other code in the pci/hv
branch as you noted.

Thanks for fixing it,
Lorenzo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-06 10:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-05 20:56 [lpieralisi-pci:pci/hv 5/5] drivers/pci/controller/pci-hyperv.c:2101:26: sparse: sparse: incorrect type in assignment (different base types) kbuild test robot
2020-03-05 23:30 ` Dexuan Cui
     [not found] <HK0P153MB02738BCFE37BCCB900F0BE71BFE20@HK0P153MB0273.APCP153.PROD.OUTLOOK.COM>
2020-03-06 10:47 ` Lorenzo Pieralisi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.