Hi Enric,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.20-rc4 next-20181126]
[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/Enric-Balletbo-i-Serra/mfd-platform-cros_ec-move-cros_ec-sysfs-attributes-to-its-own-drivers/20181127-032421
config: x86_64-randconfig-x017-201847 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

Note: the 
linux-review/Enric-Balletbo-i-Serra/mfd-platform-cros_ec-move-cros_ec-sysfs-attributes-to-its-own-drivers/20181127-032421
 HEAD 08af4d071e30b3c486bdef3b3834f0f106f98187 builds fine.
      It only hurts bisectibility.

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

   drivers//mfd/cros_ec_dev.c: In function 'ec_device_probe':
>> drivers//mfd/cros_ec_dev.c:487:2: error: 'node' undeclared (first use in 
>> this function); did you mean 'inode'?
     node = ec->ec_dev->dev->of_node;
     ^~~~
     inode
   drivers//mfd/cros_ec_dev.c:487:2: note: each undeclared identifier is 
reported only once for each function it appears in
>> drivers//mfd/cros_ec_dev.c:488:6: error: implicit declaration of function 
>> 'of_property_read_bool' [-Werror=implicit-function-declaration]
     if (of_property_read_bool(node, "google,has-vbc-nvram")) {
         ^~~~~~~~~~~~~~~~~~~~~
>> drivers//mfd/cros_ec_dev.c:490:7: error: 'cros_ec_vbc_cells' undeclared 
>> (first use in this function); did you mean 'cros_ec_rtc_cells'?
          cros_ec_vbc_cells,
          ^~~~~~~~~~~~~~~~~
          cros_ec_rtc_cells
   In file included from include/linux/kernel.h:15:0,
                    from include/linux/list.h:9,
                    from include/linux/wait.h:7,
                    from include/linux/wait_bit.h:8,
                    from include/linux/fs.h:6,
                    from drivers//mfd/cros_ec_dev.c:20:
>> include/linux/build_bug.h:29:45: error: bit-field '<anonymous>' width not an 
>> integer constant
    #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:(-!!(e)); }))
                                                ^
   include/linux/compiler.h:379:28: note: in expansion of macro 
'BUILD_BUG_ON_ZERO'
    #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
                               ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:72:59: note: in expansion of macro '__must_be_array'
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + 
__must_be_array(arr))
                                                              ^~~~~~~~~~~~~~~
>> drivers//mfd/cros_ec_dev.c:491:7: note: in expansion of macro 'ARRAY_SIZE'
          ARRAY_SIZE(cros_ec_vbc_cells),
          ^~~~~~~~~~
   cc1: some warnings being treated as errors
--
   drivers/mfd/cros_ec_dev.c: In function 'ec_device_probe':
   drivers/mfd/cros_ec_dev.c:487:2: error: 'node' undeclared (first use in this 
function); did you mean 'inode'?
     node = ec->ec_dev->dev->of_node;
     ^~~~
     inode
   drivers/mfd/cros_ec_dev.c:487:2: note: each undeclared identifier is 
reported only once for each function it appears in
   drivers/mfd/cros_ec_dev.c:488:6: error: implicit declaration of function 
'of_property_read_bool' [-Werror=implicit-function-declaration]
     if (of_property_read_bool(node, "google,has-vbc-nvram")) {
         ^~~~~~~~~~~~~~~~~~~~~
   drivers/mfd/cros_ec_dev.c:490:7: error: 'cros_ec_vbc_cells' undeclared 
(first use in this function); did you mean 'cros_ec_rtc_cells'?
          cros_ec_vbc_cells,
          ^~~~~~~~~~~~~~~~~
          cros_ec_rtc_cells
   In file included from include/linux/kernel.h:15:0,
                    from include/linux/list.h:9,
                    from include/linux/wait.h:7,
                    from include/linux/wait_bit.h:8,
                    from include/linux/fs.h:6,
                    from drivers/mfd/cros_ec_dev.c:20:
>> include/linux/build_bug.h:29:45: error: bit-field '<anonymous>' width not an 
>> integer constant
    #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:(-!!(e)); }))
                                                ^
   include/linux/compiler.h:379:28: note: in expansion of macro 
'BUILD_BUG_ON_ZERO'
    #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
                               ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:72:59: note: in expansion of macro '__must_be_array'
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + 
__must_be_array(arr))
                                                              ^~~~~~~~~~~~~~~
   drivers/mfd/cros_ec_dev.c:491:7: note: in expansion of macro 'ARRAY_SIZE'
          ARRAY_SIZE(cros_ec_vbc_cells),
          ^~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/of_property_read_bool +488 drivers//mfd/cros_ec_dev.c

   395  
   396  static int ec_device_probe(struct platform_device *pdev)
   397  {
   398          int retval = -ENOMEM;
   399          struct device *dev = &pdev->dev;
   400          struct cros_ec_platform *ec_platform = dev_get_platdata(dev);
   401          struct cros_ec_dev *ec = devm_kzalloc(dev, sizeof(*ec), 
GFP_KERNEL);
   402  
   403          if (!ec)
   404                  return retval;
   405  
   406          dev_set_drvdata(dev, ec);
   407          ec->ec_dev = dev_get_drvdata(dev->parent);
   408          ec->dev = dev;
   409          ec->cmd_offset = ec_platform->cmd_offset;
   410          ec->features[0] = -1U; /* Not cached yet */
   411          ec->features[1] = -1U; /* Not cached yet */
   412          device_initialize(&ec->class_dev);
   413          cdev_init(&ec->cdev, &fops);
   414  
   415          /*
   416           * Add the class device
   417           * Link to the character device for creating the /dev entry
   418           * in devtmpfs.
   419           */
   420          ec->class_dev.devt = MKDEV(ec_major, pdev->id);
   421          ec->class_dev.class = &cros_class;
   422          ec->class_dev.parent = dev;
   423  
   424          retval = dev_set_name(&ec->class_dev, "%s", 
ec_platform->ec_name);
   425          if (retval) {
   426                  dev_err(dev, "dev_set_name failed => %d\n", retval);
   427                  goto failed;
   428          }
   429  
   430          /* check whether this EC is a sensor hub. */
   431          if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE))
   432                  cros_ec_sensors_register(ec);
   433  
   434          /* Check whether this EC instance has CEC host command support 
*/
   435          if (cros_ec_check_features(ec, EC_FEATURE_CEC)) {
   436                  retval = mfd_add_devices(ec->dev, PLATFORM_DEVID_AUTO,
   437                                           cros_ec_cec_cells,
   438                                           ARRAY_SIZE(cros_ec_cec_cells),
   439                                           NULL, 0, NULL);
   440                  if (retval)
   441                          dev_err(ec->dev,
   442                                  "failed to add cros-ec-cec device: 
%d\n",
   443                                  retval);
   444          }
   445  
   446          /* Check whether this EC instance has RTC host command support 
*/
   447          if (cros_ec_check_features(ec, EC_FEATURE_RTC)) {
   448                  retval = mfd_add_devices(ec->dev, PLATFORM_DEVID_AUTO,
   449                                           cros_ec_rtc_cells,
   450                                           ARRAY_SIZE(cros_ec_rtc_cells),
   451                                           NULL, 0, NULL);
   452                  if (retval)
   453                          dev_err(ec->dev,
   454                                  "failed to add cros-ec-rtc device: 
%d\n",
   455                                  retval);
   456          }
   457  
   458          /* Check whether this EC instance has the PD charge manager */
   459          if (cros_ec_check_features(ec, EC_FEATURE_USB_PD)) {
   460                  retval = mfd_add_devices(ec->dev, PLATFORM_DEVID_AUTO,
   461                                           cros_usbpd_charger_cells,
   462                                           
ARRAY_SIZE(cros_usbpd_charger_cells),
   463                                           NULL, 0, NULL);
   464                  if (retval)
   465                          dev_err(ec->dev,
   466                                  "failed to add cros-usbpd-charger 
device: %d\n",
   467                                  retval);
   468          }
   469  
   470          /* We can now add the sysfs class, we know which parameter to 
show */
   471          retval = cdev_device_add(&ec->cdev, &ec->class_dev);
   472          if (retval) {
   473                  dev_err(dev, "cdev_device_add failed => %d\n", retval);
   474                  goto failed;
   475          }
   476  
   477          retval = mfd_add_devices(ec->dev, PLATFORM_DEVID_AUTO,
   478                                   cros_ec_platform_cells,
   479                                   ARRAY_SIZE(cros_ec_platform_cells),
   480                                   NULL, 0, NULL);
   481          if (retval)
   482                  dev_warn(ec->dev,
   483                           "failed to add cros-ec platform devices: %d\n",
   484                           retval);
   485  
   486          /* Check whether this EC instance has a VBC NVRAM */
 > 487          node = ec->ec_dev->dev->of_node;
 > 488          if (of_property_read_bool(node, "google,has-vbc-nvram")) {
   489                  retval = mfd_add_devices(ec->dev, PLATFORM_DEVID_AUTO,
 > 490                                           cros_ec_vbc_cells,
 > 491                                           ARRAY_SIZE(cros_ec_vbc_cells),
   492                                           NULL, 0, NULL);
   493                  if (retval)
   494                          dev_warn(ec->dev, "failed to add VBC devices: 
%d\n",
   495                                   retval);
   496          }
   497  
   498          if (cros_ec_debugfs_init(ec))
   499                  dev_warn(dev, "failed to create debugfs directory\n");
   500  
   501          return 0;
   502  
   503  failed:
   504          put_device(&ec->class_dev);
   505          return retval;
   506  }
   507  

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

Attachment: .config.gz
Description: application/gzip

Reply via email to