All of lore.kernel.org
 help / color / mirror / Atom feed
* [robh:for-kernelci 17/17] drivers/cdx/cdx.c:575:20: warning: assignment to 'struct platform_device *' from 'int' makes pointer from integer without a cast
@ 2023-11-16  7:04 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-11-16  7:04 UTC (permalink / raw)
  To: Rob Herring; +Cc: oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-kernelci
head:   30bd4c46bf0b9c85631b39f39c6bfc901846dbc9
commit: 30bd4c46bf0b9c85631b39f39c6bfc901846dbc9 [17/17] of: header cleanups
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20231116/202311161510.QeT26SWo-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231116/202311161510.QeT26SWo-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311161510.QeT26SWo-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/cdx/cdx.c: In function 'rescan_store':
   drivers/cdx/cdx.c:575:22: error: implicit declaration of function 'of_find_device_by_node'; did you mean 'bus_find_device_by_fwnode'? [-Werror=implicit-function-declaration]
     575 |                 pd = of_find_device_by_node(np);
         |                      ^~~~~~~~~~~~~~~~~~~~~~
         |                      bus_find_device_by_fwnode
>> drivers/cdx/cdx.c:575:20: warning: assignment to 'struct platform_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     575 |                 pd = of_find_device_by_node(np);
         |                    ^
   drivers/cdx/cdx.c:579:23: error: implicit declaration of function 'platform_get_drvdata' [-Werror=implicit-function-declaration]
     579 |                 cdx = platform_get_drvdata(pd);
         |                       ^~~~~~~~~~~~~~~~~~~~
>> drivers/cdx/cdx.c:579:21: warning: assignment to 'struct cdx_controller *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     579 |                 cdx = platform_get_drvdata(pd);
         |                     ^
   drivers/cdx/cdx.c:583:31: error: invalid use of undefined type 'struct platform_device'
     583 |                 put_device(&pd->dev);
         |                               ^~
   cc1: some warnings being treated as errors


vim +575 drivers/cdx/cdx.c

48a6c7bced2a78 Nipun Gupta      2023-03-13  550  
d06f5a3f714092 Linus Torvalds   2023-04-27  551  static ssize_t rescan_store(const struct bus_type *bus,
2959ab247061e6 Nipun Gupta      2023-03-13  552  			    const char *buf, size_t count)
2959ab247061e6 Nipun Gupta      2023-03-13  553  {
2959ab247061e6 Nipun Gupta      2023-03-13  554  	struct cdx_controller *cdx;
54b406e10f0334 Abhijit Gangurde 2023-10-17  555  	struct platform_device *pd;
54b406e10f0334 Abhijit Gangurde 2023-10-17  556  	struct device_node *np;
2959ab247061e6 Nipun Gupta      2023-03-13  557  	bool val;
2959ab247061e6 Nipun Gupta      2023-03-13  558  
2959ab247061e6 Nipun Gupta      2023-03-13  559  	if (kstrtobool(buf, &val) < 0)
2959ab247061e6 Nipun Gupta      2023-03-13  560  		return -EINVAL;
2959ab247061e6 Nipun Gupta      2023-03-13  561  
2959ab247061e6 Nipun Gupta      2023-03-13  562  	if (!val)
2959ab247061e6 Nipun Gupta      2023-03-13  563  		return -EINVAL;
2959ab247061e6 Nipun Gupta      2023-03-13  564  
f0af816834667b Abhijit Gangurde 2023-10-17  565  	mutex_lock(&cdx_controller_lock);
f0af816834667b Abhijit Gangurde 2023-10-17  566  
2959ab247061e6 Nipun Gupta      2023-03-13  567  	/* Unregister all the devices on the bus */
2959ab247061e6 Nipun Gupta      2023-03-13  568  	cdx_unregister_devices(&cdx_bus_type);
2959ab247061e6 Nipun Gupta      2023-03-13  569  
2959ab247061e6 Nipun Gupta      2023-03-13  570  	/* Rescan all the devices */
54b406e10f0334 Abhijit Gangurde 2023-10-17  571  	for_each_compatible_node(np, NULL, compat_node_name) {
54b406e10f0334 Abhijit Gangurde 2023-10-17  572  		if (!np)
54b406e10f0334 Abhijit Gangurde 2023-10-17  573  			return -EINVAL;
2959ab247061e6 Nipun Gupta      2023-03-13  574  
54b406e10f0334 Abhijit Gangurde 2023-10-17 @575  		pd = of_find_device_by_node(np);
54b406e10f0334 Abhijit Gangurde 2023-10-17  576  		if (!pd)
54b406e10f0334 Abhijit Gangurde 2023-10-17  577  			return -EINVAL;
54b406e10f0334 Abhijit Gangurde 2023-10-17  578  
54b406e10f0334 Abhijit Gangurde 2023-10-17 @579  		cdx = platform_get_drvdata(pd);
54b406e10f0334 Abhijit Gangurde 2023-10-17  580  		if (cdx && cdx->controller_registered && cdx->ops->scan)
54b406e10f0334 Abhijit Gangurde 2023-10-17  581  			cdx->ops->scan(cdx);
54b406e10f0334 Abhijit Gangurde 2023-10-17  582  
54b406e10f0334 Abhijit Gangurde 2023-10-17  583  		put_device(&pd->dev);
2959ab247061e6 Nipun Gupta      2023-03-13  584  	}
2959ab247061e6 Nipun Gupta      2023-03-13  585  
f0af816834667b Abhijit Gangurde 2023-10-17  586  	mutex_unlock(&cdx_controller_lock);
f0af816834667b Abhijit Gangurde 2023-10-17  587  
2959ab247061e6 Nipun Gupta      2023-03-13  588  	return count;
2959ab247061e6 Nipun Gupta      2023-03-13  589  }
2959ab247061e6 Nipun Gupta      2023-03-13  590  static BUS_ATTR_WO(rescan);
2959ab247061e6 Nipun Gupta      2023-03-13  591  

:::::: The code at line 575 was first introduced by commit
:::::: 54b406e10f0334ee0245d5129c8def444a49cd9b cdx: Remove cdx controller list from cdx bus system

:::::: TO: Abhijit Gangurde <abhijit.gangurde@amd.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

only message in thread, other threads:[~2023-11-16  7:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-16  7:04 [robh:for-kernelci 17/17] drivers/cdx/cdx.c:575:20: warning: assignment to 'struct platform_device *' from 'int' makes pointer from integer without a cast kernel test robot

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.