DriverDev-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [driver-core:device_h_splitup 34/35] drivers//base/devcon.c:161:40: error: passing argument 2 of 'bus_find_device_by_fwnode' from incompatible pointer type
@ 2019-11-03 18:16 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2019-11-03 18:16 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: devel, kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git device_h_splitup
head:   8ac09706c581716b3ca938773ad29e50854fa674
commit: bfe8e3fa1f0d3946158a6526aefccc5160b51cb9 [34/35] device.h: move 'struct bus' stuff out to device/bus.h
config: i386-tinyconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        git checkout bfe8e3fa1f0d3946158a6526aefccc5160b51cb9
        # save the attached .config to linux build tree
        make ARCH=i386 

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

All error/warnings (new ones prefixed by >>):

   In file included from include/linux/device.h:29:0,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from arch/x86//kernel/irq.c:5:
>> include/linux/device/bus.h:193:62: warning: 'struct fwnode_handle' declared inside parameter list will not be visible outside of this definition or declaration
    bus_find_device_by_fwnode(struct bus_type *bus, const struct fwnode_handle *fwnode)
                                                                 ^~~~~~~~~~~~~
--
   In file included from include/linux/device.h:29:0,
                    from drivers//base/devcon.c:9:
>> include/linux/device/bus.h:193:62: warning: 'struct fwnode_handle' declared inside parameter list will not be visible outside of this definition or declaration
    bus_find_device_by_fwnode(struct bus_type *bus, const struct fwnode_handle *fwnode)
                                                                 ^~~~~~~~~~~~~
   drivers//base/devcon.c: In function 'device_connection_fwnode_match':
>> drivers//base/devcon.c:161:40: error: passing argument 2 of 'bus_find_device_by_fwnode' from incompatible pointer type [-Werror=incompatible-pointer-types]
      dev = bus_find_device_by_fwnode(bus, con->fwnode);
                                           ^~~
   In file included from include/linux/device.h:29:0,
                    from drivers//base/devcon.c:9:
   include/linux/device/bus.h:193:1: note: expected 'const struct fwnode_handle *' but argument is of type 'struct fwnode_handle *'
    bus_find_device_by_fwnode(struct bus_type *bus, const struct fwnode_handle *fwnode)
    ^~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/bus_find_device_by_fwnode +161 drivers//base/devcon.c

f2d9b66d84f3ff Heikki Krogerus  2018-03-20   @9  #include <linux/device.h>
637e9e52b185e5 Heikki Krogerus  2019-02-13   10  #include <linux/property.h>
f2d9b66d84f3ff Heikki Krogerus  2018-03-20   11  
f2d9b66d84f3ff Heikki Krogerus  2018-03-20   12  static DEFINE_MUTEX(devcon_lock);
f2d9b66d84f3ff Heikki Krogerus  2018-03-20   13  static LIST_HEAD(devcon_list);
f2d9b66d84f3ff Heikki Krogerus  2018-03-20   14  
637e9e52b185e5 Heikki Krogerus  2019-02-13   15  static void *
637e9e52b185e5 Heikki Krogerus  2019-02-13   16  fwnode_graph_devcon_match(struct fwnode_handle *fwnode, const char *con_id,
637e9e52b185e5 Heikki Krogerus  2019-02-13   17  			  void *data, devcon_match_fn_t match)
637e9e52b185e5 Heikki Krogerus  2019-02-13   18  {
637e9e52b185e5 Heikki Krogerus  2019-02-13   19  	struct device_connection con = { .id = con_id };
637e9e52b185e5 Heikki Krogerus  2019-02-13   20  	struct fwnode_handle *ep;
637e9e52b185e5 Heikki Krogerus  2019-02-13   21  	void *ret;
637e9e52b185e5 Heikki Krogerus  2019-02-13   22  
637e9e52b185e5 Heikki Krogerus  2019-02-13   23  	fwnode_graph_for_each_endpoint(fwnode, ep) {
637e9e52b185e5 Heikki Krogerus  2019-02-13   24  		con.fwnode = fwnode_graph_get_remote_port_parent(ep);
637e9e52b185e5 Heikki Krogerus  2019-02-13   25  		if (!fwnode_device_is_available(con.fwnode))
637e9e52b185e5 Heikki Krogerus  2019-02-13   26  			continue;
637e9e52b185e5 Heikki Krogerus  2019-02-13   27  
637e9e52b185e5 Heikki Krogerus  2019-02-13   28  		ret = match(&con, -1, data);
637e9e52b185e5 Heikki Krogerus  2019-02-13   29  		fwnode_handle_put(con.fwnode);
637e9e52b185e5 Heikki Krogerus  2019-02-13   30  		if (ret) {
637e9e52b185e5 Heikki Krogerus  2019-02-13   31  			fwnode_handle_put(ep);
637e9e52b185e5 Heikki Krogerus  2019-02-13   32  			return ret;
637e9e52b185e5 Heikki Krogerus  2019-02-13   33  		}
637e9e52b185e5 Heikki Krogerus  2019-02-13   34  	}
637e9e52b185e5 Heikki Krogerus  2019-02-13   35  	return NULL;
637e9e52b185e5 Heikki Krogerus  2019-02-13   36  }
637e9e52b185e5 Heikki Krogerus  2019-02-13   37  
fde777791eb83f Heikki Krogerus  2019-05-31   38  static void *
fde777791eb83f Heikki Krogerus  2019-05-31   39  fwnode_devcon_match(struct fwnode_handle *fwnode, const char *con_id,
fde777791eb83f Heikki Krogerus  2019-05-31   40  		    void *data, devcon_match_fn_t match)
fde777791eb83f Heikki Krogerus  2019-05-31   41  {
fde777791eb83f Heikki Krogerus  2019-05-31   42  	struct device_connection con = { };
fde777791eb83f Heikki Krogerus  2019-05-31   43  	void *ret;
fde777791eb83f Heikki Krogerus  2019-05-31   44  	int i;
fde777791eb83f Heikki Krogerus  2019-05-31   45  
fde777791eb83f Heikki Krogerus  2019-05-31   46  	for (i = 0; ; i++) {
fde777791eb83f Heikki Krogerus  2019-05-31   47  		con.fwnode = fwnode_find_reference(fwnode, con_id, i);
fde777791eb83f Heikki Krogerus  2019-05-31   48  		if (IS_ERR(con.fwnode))
fde777791eb83f Heikki Krogerus  2019-05-31   49  			break;
fde777791eb83f Heikki Krogerus  2019-05-31   50  
fde777791eb83f Heikki Krogerus  2019-05-31   51  		ret = match(&con, -1, data);
fde777791eb83f Heikki Krogerus  2019-05-31   52  		fwnode_handle_put(con.fwnode);
fde777791eb83f Heikki Krogerus  2019-05-31   53  		if (ret)
fde777791eb83f Heikki Krogerus  2019-05-31   54  			return ret;
fde777791eb83f Heikki Krogerus  2019-05-31   55  	}
fde777791eb83f Heikki Krogerus  2019-05-31   56  
fde777791eb83f Heikki Krogerus  2019-05-31   57  	return NULL;
fde777791eb83f Heikki Krogerus  2019-05-31   58  }
fde777791eb83f Heikki Krogerus  2019-05-31   59  
44493062abc38e Heikki Krogerus  2019-08-29   60  /**
44493062abc38e Heikki Krogerus  2019-08-29   61   * fwnode_connection_find_match - Find connection from a device node
44493062abc38e Heikki Krogerus  2019-08-29   62   * @fwnode: Device node with the connection
44493062abc38e Heikki Krogerus  2019-08-29   63   * @con_id: Identifier for the connection
44493062abc38e Heikki Krogerus  2019-08-29   64   * @data: Data for the match function
44493062abc38e Heikki Krogerus  2019-08-29   65   * @match: Function to check and convert the connection description
44493062abc38e Heikki Krogerus  2019-08-29   66   *
44493062abc38e Heikki Krogerus  2019-08-29   67   * Find a connection with unique identifier @con_id between @fwnode and another
44493062abc38e Heikki Krogerus  2019-08-29   68   * device node. @match will be used to convert the connection description to
44493062abc38e Heikki Krogerus  2019-08-29   69   * data the caller is expecting to be returned.
44493062abc38e Heikki Krogerus  2019-08-29   70   */
44493062abc38e Heikki Krogerus  2019-08-29   71  void *fwnode_connection_find_match(struct fwnode_handle *fwnode,
44493062abc38e Heikki Krogerus  2019-08-29   72  				   const char *con_id, void *data,
44493062abc38e Heikki Krogerus  2019-08-29   73  				   devcon_match_fn_t match)
44493062abc38e Heikki Krogerus  2019-08-29   74  {
44493062abc38e Heikki Krogerus  2019-08-29   75  	void *ret;
44493062abc38e Heikki Krogerus  2019-08-29   76  
44493062abc38e Heikki Krogerus  2019-08-29   77  	if (!fwnode || !match)
44493062abc38e Heikki Krogerus  2019-08-29   78  		return NULL;
44493062abc38e Heikki Krogerus  2019-08-29   79  
44493062abc38e Heikki Krogerus  2019-08-29   80  	ret = fwnode_graph_devcon_match(fwnode, con_id, data, match);
44493062abc38e Heikki Krogerus  2019-08-29   81  	if (ret)
44493062abc38e Heikki Krogerus  2019-08-29   82  		return ret;
44493062abc38e Heikki Krogerus  2019-08-29   83  
44493062abc38e Heikki Krogerus  2019-08-29   84  	return fwnode_devcon_match(fwnode, con_id, data, match);
44493062abc38e Heikki Krogerus  2019-08-29   85  }
44493062abc38e Heikki Krogerus  2019-08-29   86  EXPORT_SYMBOL_GPL(fwnode_connection_find_match);
44493062abc38e Heikki Krogerus  2019-08-29   87  
f2d9b66d84f3ff Heikki Krogerus  2018-03-20   88  /**
f2d9b66d84f3ff Heikki Krogerus  2018-03-20   89   * device_connection_find_match - Find physical connection to a device
f2d9b66d84f3ff Heikki Krogerus  2018-03-20   90   * @dev: Device with the connection
f2d9b66d84f3ff Heikki Krogerus  2018-03-20   91   * @con_id: Identifier for the connection
f2d9b66d84f3ff Heikki Krogerus  2018-03-20   92   * @data: Data for the match function
f2d9b66d84f3ff Heikki Krogerus  2018-03-20   93   * @match: Function to check and convert the connection description
f2d9b66d84f3ff Heikki Krogerus  2018-03-20   94   *
f2d9b66d84f3ff Heikki Krogerus  2018-03-20   95   * Find a connection with unique identifier @con_id between @dev and another
f2d9b66d84f3ff Heikki Krogerus  2018-03-20   96   * device. @match will be used to convert the connection description to data the
f2d9b66d84f3ff Heikki Krogerus  2018-03-20   97   * caller is expecting to be returned.
f2d9b66d84f3ff Heikki Krogerus  2018-03-20   98   */
f2d9b66d84f3ff Heikki Krogerus  2018-03-20   99  void *device_connection_find_match(struct device *dev, const char *con_id,
637e9e52b185e5 Heikki Krogerus  2019-02-13  100  				   void *data, devcon_match_fn_t match)
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  101  {
637e9e52b185e5 Heikki Krogerus  2019-02-13  102  	struct fwnode_handle *fwnode = dev_fwnode(dev);
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  103  	const char *devname = dev_name(dev);
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  104  	struct device_connection *con;
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  105  	void *ret = NULL;
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  106  	int ep;
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  107  
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  108  	if (!match)
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  109  		return NULL;
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  110  
44493062abc38e Heikki Krogerus  2019-08-29  111  	ret = fwnode_connection_find_match(fwnode, con_id, data, match);
637e9e52b185e5 Heikki Krogerus  2019-02-13  112  	if (ret)
637e9e52b185e5 Heikki Krogerus  2019-02-13  113  		return ret;
fde777791eb83f Heikki Krogerus  2019-05-31  114  
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  115  	mutex_lock(&devcon_lock);
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  116  
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  117  	list_for_each_entry(con, &devcon_list, list) {
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  118  		ep = match_string(con->endpoint, 2, devname);
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  119  		if (ep < 0)
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  120  			continue;
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  121  
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  122  		if (con_id && strcmp(con->id, con_id))
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  123  			continue;
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  124  
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  125  		ret = match(con, !ep, data);
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  126  		if (ret)
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  127  			break;
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  128  	}
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  129  
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  130  	mutex_unlock(&devcon_lock);
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  131  
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  132  	return ret;
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  133  }
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  134  EXPORT_SYMBOL_GPL(device_connection_find_match);
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  135  
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  136  extern struct bus_type platform_bus_type;
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  137  extern struct bus_type pci_bus_type;
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  138  extern struct bus_type i2c_bus_type;
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  139  extern struct bus_type spi_bus_type;
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  140  
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  141  static struct bus_type *generic_match_buses[] = {
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  142  	&platform_bus_type,
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  143  #ifdef CONFIG_PCI
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  144  	&pci_bus_type,
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  145  #endif
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  146  #ifdef CONFIG_I2C
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  147  	&i2c_bus_type,
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  148  #endif
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  149  #ifdef CONFIG_SPI_MASTER
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  150  	&spi_bus_type,
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  151  #endif
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  152  	NULL,
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  153  };
f2d9b66d84f3ff Heikki Krogerus  2018-03-20  154  
80e04837a40f6f Heikki Krogerus  2019-02-13  155  static void *device_connection_fwnode_match(struct device_connection *con)
80e04837a40f6f Heikki Krogerus  2019-02-13  156  {
80e04837a40f6f Heikki Krogerus  2019-02-13  157  	struct bus_type *bus;
80e04837a40f6f Heikki Krogerus  2019-02-13  158  	struct device *dev;
80e04837a40f6f Heikki Krogerus  2019-02-13  159  
80e04837a40f6f Heikki Krogerus  2019-02-13  160  	for (bus = generic_match_buses[0]; bus; bus++) {
67843bbaf36eb0 Suzuki K Poulose 2019-07-23 @161  		dev = bus_find_device_by_fwnode(bus, con->fwnode);
80e04837a40f6f Heikki Krogerus  2019-02-13  162  		if (dev && !strncmp(dev_name(dev), con->id, strlen(con->id)))
80e04837a40f6f Heikki Krogerus  2019-02-13  163  			return dev;
80e04837a40f6f Heikki Krogerus  2019-02-13  164  
80e04837a40f6f Heikki Krogerus  2019-02-13  165  		put_device(dev);
80e04837a40f6f Heikki Krogerus  2019-02-13  166  	}
80e04837a40f6f Heikki Krogerus  2019-02-13  167  	return NULL;
80e04837a40f6f Heikki Krogerus  2019-02-13  168  }
80e04837a40f6f Heikki Krogerus  2019-02-13  169  

:::::: The code at line 161 was first introduced by commit
:::::: 67843bbaf36eb087714f40e783ee78e99e9e4b86 drivers: Introduce device lookup variants by fwnode

:::::: TO: Suzuki K Poulose <suzuki.poulose@arm.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

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

[-- Attachment #3: Type: text/plain, Size: 169 bytes --]

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-03 18:16 [driver-core:device_h_splitup 34/35] drivers//base/devcon.c:161:40: error: passing argument 2 of 'bus_find_device_by_fwnode' from incompatible pointer type kbuild test robot

DriverDev-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/driverdev-devel/0 driverdev-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 driverdev-devel driverdev-devel/ https://lore.kernel.org/driverdev-devel \
		driverdev-devel@linuxdriverproject.org devel@driverdev.osuosl.org
	public-inbox-index driverdev-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxdriverproject.driverdev-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git