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

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

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

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

All errors (new ones prefixed by >>):

   In file included from include/linux/device.h:29:0,
                    from include/linux/usb/role.h:6,
                    from drivers/usb/roles/class.c:10:
   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:30:0,
                    from include/linux/usb/role.h:6,
                    from drivers/usb/roles/class.c:10:
   include/linux/device/class.h:152:21: warning: 'struct fwnode_handle' declared inside parameter list will not be visible outside of this definition or declaration
           const struct fwnode_handle *fwnode)
                        ^~~~~~~~~~~~~
   drivers/usb/roles/class.c: In function 'usb_role_switch_match':
>> drivers/usb/roles/class.c:97:49: error: passing argument 2 of 'class_find_device_by_fwnode' from incompatible pointer type [-Werror=incompatible-pointer-types]
      dev = class_find_device_by_fwnode(role_class, con->fwnode);
                                                    ^~~
   In file included from include/linux/device.h:30:0,
                    from include/linux/usb/role.h:6,
                    from drivers/usb/roles/class.c:10:
   include/linux/device/class.h:151:1: note: expected 'const struct fwnode_handle *' but argument is of type 'struct fwnode_handle *'
    class_find_device_by_fwnode(struct class *class,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/roles/class.c: In function 'usb_role_switch_is_parent':
   drivers/usb/roles/class.c:114:48: error: passing argument 2 of 'class_find_device_by_fwnode' from incompatible pointer type [-Werror=incompatible-pointer-types]
     dev = class_find_device_by_fwnode(role_class, parent);
                                                   ^~~~~~
   In file included from include/linux/device.h:30:0,
                    from include/linux/usb/role.h:6,
                    from drivers/usb/roles/class.c:10:
   include/linux/device/class.h:151:1: note: expected 'const struct fwnode_handle *' but argument is of type 'struct fwnode_handle *'
    class_find_device_by_fwnode(struct class *class,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from include/linux/device.h:29:0,
                    from drivers/usb/typec/class.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)
                                                                 ^~~~~~~~~~~~~
   In file included from include/linux/device.h:30:0,
                    from drivers/usb/typec/class.c:9:
   include/linux/device/class.h:152:21: warning: 'struct fwnode_handle' declared inside parameter list will not be visible outside of this definition or declaration
           const struct fwnode_handle *fwnode)
                        ^~~~~~~~~~~~~
   drivers/usb/typec/class.c: In function 'typec_port_match':
>> drivers/usb/typec/class.c:217:51: error: passing argument 2 of 'class_find_device_by_fwnode' from incompatible pointer type [-Werror=incompatible-pointer-types]
      return class_find_device_by_fwnode(typec_class, con->fwnode);
                                                      ^~~
   In file included from include/linux/device.h:30:0,
                    from drivers/usb/typec/class.c:9:
   include/linux/device/class.h:151:1: note: expected 'const struct fwnode_handle *' but argument is of type 'struct fwnode_handle *'
    class_find_device_by_fwnode(struct class *class,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/class_find_device_by_fwnode +97 drivers/usb/roles/class.c

fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20  @10  #include <linux/usb/role.h>
ec69e9533c4879 drivers/usb/roles/class.c  Heikki Krogerus  2019-02-13   11  #include <linux/property.h>
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   12  #include <linux/device.h>
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   13  #include <linux/module.h>
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   14  #include <linux/mutex.h>
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   15  #include <linux/slab.h>
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   16  
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   17  static struct class *role_class;
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   18  
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   19  struct usb_role_switch {
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   20  	struct device dev;
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   21  	struct mutex lock; /* device lock*/
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   22  	enum usb_role role;
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   23  
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   24  	/* From descriptor */
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   25  	struct device *usb2_port;
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   26  	struct device *usb3_port;
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   27  	struct device *udc;
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   28  	usb_role_switch_set_t set;
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   29  	usb_role_switch_get_t get;
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   30  	bool allow_userspace_control;
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   31  };
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   32  
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   33  #define to_role_switch(d)	container_of(d, struct usb_role_switch, dev)
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   34  
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   35  /**
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   36   * usb_role_switch_set_role - Set USB role for a switch
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   37   * @sw: USB role switch
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   38   * @role: USB role to be switched to
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   39   *
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   40   * Set USB role @role for @sw.
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   41   */
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   42  int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role)
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   43  {
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   44  	int ret;
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   45  
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   46  	if (IS_ERR_OR_NULL(sw))
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   47  		return 0;
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   48  
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   49  	mutex_lock(&sw->lock);
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   50  
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   51  	ret = sw->set(sw->dev.parent, role);
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   52  	if (!ret)
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   53  		sw->role = role;
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   54  
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   55  	mutex_unlock(&sw->lock);
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   56  
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   57  	return ret;
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   58  }
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   59  EXPORT_SYMBOL_GPL(usb_role_switch_set_role);
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   60  
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   61  /**
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   62   * usb_role_switch_get_role - Get the USB role for a switch
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   63   * @sw: USB role switch
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   64   *
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   65   * Depending on the role-switch-driver this function returns either a cached
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   66   * value of the last set role, or reads back the actual value from the hardware.
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   67   */
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   68  enum usb_role usb_role_switch_get_role(struct usb_role_switch *sw)
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   69  {
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   70  	enum usb_role role;
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   71  
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   72  	if (IS_ERR_OR_NULL(sw))
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   73  		return USB_ROLE_NONE;
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   74  
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   75  	mutex_lock(&sw->lock);
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   76  
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   77  	if (sw->get)
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   78  		role = sw->get(sw->dev.parent);
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   79  	else
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   80  		role = sw->role;
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   81  
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   82  	mutex_unlock(&sw->lock);
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   83  
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   84  	return role;
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   85  }
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   86  EXPORT_SYMBOL_GPL(usb_role_switch_get_role);
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   87  
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   88  static void *usb_role_switch_match(struct device_connection *con, int ep,
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   89  				   void *data)
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   90  {
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   91  	struct device *dev;
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20   92  
ec69e9533c4879 drivers/usb/roles/class.c  Heikki Krogerus  2019-02-13   93  	if (con->fwnode) {
fde777791eb83f drivers/usb/roles/class.c  Heikki Krogerus  2019-05-31   94  		if (con->id && !fwnode_property_present(con->fwnode, con->id))
ec69e9533c4879 drivers/usb/roles/class.c  Heikki Krogerus  2019-02-13   95  			return NULL;
ec69e9533c4879 drivers/usb/roles/class.c  Heikki Krogerus  2019-02-13   96  
67843bbaf36eb0 drivers/usb/roles/class.c  Suzuki K Poulose 2019-07-23  @97  		dev = class_find_device_by_fwnode(role_class, con->fwnode);
ec69e9533c4879 drivers/usb/roles/class.c  Heikki Krogerus  2019-02-13   98  	} else {
6cda08a20dbde4 drivers/usb/roles/class.c  Suzuki K Poulose 2019-07-23   99  		dev = class_find_device_by_name(role_class, con->endpoint[ep]);
ec69e9533c4879 drivers/usb/roles/class.c  Heikki Krogerus  2019-02-13  100  	}
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20  101  
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20  102  	return dev ? to_role_switch(dev) : ERR_PTR(-EPROBE_DEFER);
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20  103  }
fde0aa6c175a4d drivers/usb/common/roles.c Heikki Krogerus  2018-03-20  104  

:::::: The code at line 97 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: 26721 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:48 [driver-core:device_h_splitup 35/35] drivers/usb/roles/class.c:97:49: error: passing argument 2 of 'class_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