tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 
device_h_splitup
head:   f9582e3b228292a3c646866487a437e075fc0ee5
commit: 43ed4c24a977067ac76d7b6051829934fb59ae2f [56/57] device.h: move 'struct 
bus' stuff out to device/bus.h
config: x86_64-randconfig-s0-201945 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        git checkout 43ed4c24a977067ac76d7b6051829934fb59ae2f
        # 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 <l...@intel.com>

All errors (new ones prefixed by >>):

   In file included from <command-line>:0:0:
   include/linux/device/bus.h:87:43: warning: 'struct kobj_uevent_env' declared 
inside parameter list will not be visible outside of this definition or 
declaration
     int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
                                              ^~~~~~~~~~~~~~~
>> include/linux/device/bus.h:96:37: error: unknown type name 'pm_message_t'
     int (*suspend)(struct device *dev, pm_message_t state);
                                        ^~~~~~~~~~~~
>> include/linux/device/bus.h:108:24: error: field 'lock_key' has incomplete 
>> type
     struct lock_class_key lock_key;
                           ^~~~~~~~
>> include/linux/device/bus.h:110:2: error: unknown type name 'bool'
     bool need_parent_lock;
     ^~~~
>> include/linux/device/bus.h:120:19: error: field 'attr' has incomplete type
     struct attribute attr;
                      ^~~~
>> include/linux/device/bus.h:121:2: error: expected specifier-qualifier-list 
>> before 'ssize_t'
     ssize_t (*show)(struct bus_type *bus, char *buf);
     ^~~~~~~
>> include/linux/device/bus.h:146:21: error: field 'ki' has incomplete type
     struct klist_iter  ki;
                        ^~
   include/linux/device/bus.h:182:63: warning: 'struct device_node' declared 
inside parameter list will not be visible outside of this definition or 
declaration
    bus_find_device_by_of_node(struct bus_type *bus, const struct device_node 
*np)
                                                                  ^~~~~~~~~~~
   include/linux/device/bus.h: In function 'bus_find_device_by_of_node':
>> include/linux/device/bus.h:184:30: error: 'NULL' undeclared (first use in 
>> this function)
     return bus_find_device(bus, NULL, np, device_match_of_node);
                                 ^~~~
   include/linux/device/bus.h:184:30: note: each undeclared identifier is 
reported only once for each function it appears in
   include/linux/device/bus.h: In function 'bus_find_device_by_fwnode':
   include/linux/device/bus.h:196:30: error: 'NULL' undeclared (first use in 
this function)
     return bus_find_device(bus, NULL, fwnode, device_match_fwnode);
                                 ^~~~
   include/linux/device/bus.h: At top level:
>> include/linux/device/bus.h:206:12: error: unknown type name 'dev_t'
               dev_t devt)
               ^~~~~
   include/linux/device/bus.h: In function 'bus_find_next_device':
   include/linux/device/bus.h:220:35: error: 'NULL' undeclared (first use in 
this function)
     return bus_find_device(bus, cur, NULL, device_match_any);
                                      ^~~~
   include/linux/device/bus.h: In function 'bus_find_device_by_acpi_dev':
   include/linux/device/bus.h:235:30: error: 'NULL' undeclared (first use in 
this function)
     return bus_find_device(bus, NULL, adev, device_match_acpi_dev);
                                 ^~~~

vim +/pm_message_t +96 include/linux/device/bus.h

    19  
    20  /**
    21   * struct bus_type - The bus type of the device
    22   *
    23   * @name:       The name of the bus.
    24   * @dev_name:   Used for subsystems to enumerate devices like ("foo%u", 
dev->id).
    25   * @dev_root:   Default device to use as the parent.
    26   * @bus_groups: Default attributes of the bus.
    27   * @dev_groups: Default attributes of the devices on the bus.
    28   * @drv_groups: Default attributes of the device drivers on the bus.
    29   * @match:      Called, perhaps multiple times, whenever a new device 
or driver
    30   *              is added for this bus. It should return a positive 
value if the
    31   *              given device can be handled by the given driver and zero
    32   *              otherwise. It may also return error code if determining 
that
    33   *              the driver supports the device is not possible. In case 
of
    34   *              -EPROBE_DEFER it will queue the device for deferred 
probing.
    35   * @uevent:     Called when a device is added, removed, or a few other 
things
    36   *              that generate uevents to add the environment variables.
    37   * @probe:      Called when a new device or driver add to this bus, and 
callback
    38   *              the specific driver's probe to initial the matched 
device.
    39   * @sync_state: Called to sync device state to software state after all 
the
    40   *              state tracking consumers linked to this device (present 
at
    41   *              the time of late_initcall) have successfully bound to a
    42   *              driver. If the device has no consumers, this function 
will
    43   *              be called at late_initcall_sync level. If the device has
    44   *              consumers that are never bound to a driver, this 
function
    45   *              will never get called until they do.
    46   * @remove:     Called when a device removed from this bus.
    47   * @shutdown:   Called at shut-down time to quiesce the device.
    48   *
    49   * @online:     Called to put the device back online (after offlining 
it).
    50   * @offline:    Called to put the device offline for hot-removal. May 
fail.
    51   *
    52   * @suspend:    Called when a device on this bus wants to go to sleep 
mode.
    53   * @resume:     Called to bring a device on this bus out of sleep mode.
    54   * @num_vf:     Called to find out how many virtual functions a device 
on this
    55   *              bus supports.
    56   * @dma_configure:      Called to setup DMA configuration on a device on
    57   *                      this bus.
    58   * @pm:         Power management operations of this bus, callback the 
specific
    59   *              device driver's pm-ops.
    60   * @iommu_ops:  IOMMU specific operations for this bus, used to attach 
IOMMU
    61   *              driver implementations to a bus and allow the driver to 
do
    62   *              bus-specific setup
    63   * @p:          The private data of the driver core, only the driver 
core can
    64   *              touch this.
    65   * @lock_key:   Lock class key for use by the lock validator
    66   * @need_parent_lock:   When probing or removing a device on this bus, 
the
    67   *                      device core should lock the device's parent.
    68   *
    69   * A bus is a channel between the processor and one or more devices. 
For the
    70   * purposes of the device model, all devices are connected via a bus, 
even if
    71   * it is an internal, virtual, "platform" bus. Buses can plug into each 
other.
    72   * A USB controller is usually a PCI device, for example. The device 
model
    73   * represents the actual connections between buses and the devices they 
control.
    74   * A bus is represented by the bus_type structure. It contains the 
name, the
    75   * default attributes, the bus' methods, PM operations, and the driver 
core's
    76   * private data.
    77   */
    78  struct bus_type {
    79          const char              *name;
    80          const char              *dev_name;
    81          struct device           *dev_root;
    82          const struct attribute_group **bus_groups;
    83          const struct attribute_group **dev_groups;
    84          const struct attribute_group **drv_groups;
    85  
    86          int (*match)(struct device *dev, struct device_driver *drv);
  > 87          int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
    88          int (*probe)(struct device *dev);
    89          void (*sync_state)(struct device *dev);
    90          int (*remove)(struct device *dev);
    91          void (*shutdown)(struct device *dev);
    92  
    93          int (*online)(struct device *dev);
    94          int (*offline)(struct device *dev);
    95  
  > 96          int (*suspend)(struct device *dev, pm_message_t state);
    97          int (*resume)(struct device *dev);
    98  
    99          int (*num_vf)(struct device *dev);
   100  
   101          int (*dma_configure)(struct device *dev);
   102  
   103          const struct dev_pm_ops *pm;
   104  
   105          const struct iommu_ops *iommu_ops;
   106  
   107          struct subsys_private *p;
 > 108          struct lock_class_key lock_key;
   109  
 > 110          bool need_parent_lock;
   111  };
   112  
   113  extern int __must_check bus_register(struct bus_type *bus);
   114  
   115  extern void bus_unregister(struct bus_type *bus);
   116  
   117  extern int __must_check bus_rescan_devices(struct bus_type *bus);
   118  
   119  struct bus_attribute {
 > 120          struct attribute        attr;
 > 121          ssize_t (*show)(struct bus_type *bus, char *buf);
   122          ssize_t (*store)(struct bus_type *bus, const char *buf, size_t 
count);
   123  };
   124  
   125  #define BUS_ATTR_RW(_name) \
   126          struct bus_attribute bus_attr_##_name = __ATTR_RW(_name)
   127  #define BUS_ATTR_RO(_name) \
   128          struct bus_attribute bus_attr_##_name = __ATTR_RO(_name)
   129  #define BUS_ATTR_WO(_name) \
   130          struct bus_attribute bus_attr_##_name = __ATTR_WO(_name)
   131  
   132  extern int __must_check bus_create_file(struct bus_type *,
   133                                          struct bus_attribute *);
   134  extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
   135  
   136  /* Generic device matching functions that all busses can use to match 
with */
   137  int device_match_name(struct device *dev, const void *name);
   138  int device_match_of_node(struct device *dev, const void *np);
   139  int device_match_fwnode(struct device *dev, const void *fwnode);
   140  int device_match_devt(struct device *dev, const void *pdevt);
   141  int device_match_acpi_dev(struct device *dev, const void *adev);
   142  int device_match_any(struct device *dev, const void *unused);
   143  
   144  /* iterator helpers for buses */
   145  struct subsys_dev_iter {
 > 146          struct klist_iter               ki;
   147          const struct device_type        *type;
   148  };
   149  void subsys_dev_iter_init(struct subsys_dev_iter *iter,
   150                           struct bus_type *subsys,
   151                           struct device *start,
   152                           const struct device_type *type);
   153  struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter);
   154  void subsys_dev_iter_exit(struct subsys_dev_iter *iter);
   155  
   156  int bus_for_each_dev(struct bus_type *bus, struct device *start, void 
*data,
   157                       int (*fn)(struct device *dev, void *data));
   158  struct device *bus_find_device(struct bus_type *bus, struct device 
*start,
   159                                 const void *data,
   160                                 int (*match)(struct device *dev, const 
void *data));
   161  /**
   162   * bus_find_device_by_name - device iterator for locating a particular 
device
   163   * of a specific name.
   164   * @bus: bus type
   165   * @start: Device to begin with
   166   * @name: name of the device to match
   167   */
   168  static inline struct device *bus_find_device_by_name(struct bus_type 
*bus,
   169                                                       struct device 
*start,
   170                                                       const char *name)
   171  {
   172          return bus_find_device(bus, start, name, device_match_name);
   173  }
   174  
   175  /**
   176   * bus_find_device_by_of_node : device iterator for locating a 
particular device
   177   * matching the of_node.
   178   * @bus: bus type
   179   * @np: of_node of the device to match.
   180   */
   181  static inline struct device *
   182  bus_find_device_by_of_node(struct bus_type *bus, const struct 
device_node *np)
   183  {
 > 184          return bus_find_device(bus, NULL, np, device_match_of_node);
   185  }
   186  
   187  /**
   188   * bus_find_device_by_fwnode : device iterator for locating a 
particular device
   189   * matching the fwnode.
   190   * @bus: bus type
   191   * @fwnode: fwnode of the device to match.
   192   */
   193  static inline struct device *
   194  bus_find_device_by_fwnode(struct bus_type *bus, const struct 
fwnode_handle *fwnode)
   195  {
   196          return bus_find_device(bus, NULL, fwnode, device_match_fwnode);
   197  }
   198  
   199  /**
   200   * bus_find_device_by_devt : device iterator for locating a particular 
device
   201   * matching the device type.
   202   * @bus: bus type
   203   * @devt: device type of the device to match.
   204   */
   205  static inline struct device *bus_find_device_by_devt(struct bus_type 
*bus,
 > 206                                                       dev_t devt)
   207  {
   208          return bus_find_device(bus, NULL, &devt, device_match_devt);
   209  }
   210  

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

Attachment: .config.gz
Description: application/gzip

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

Reply via email to