Re: [PATCH 1/1] mfd: Make a best effort attempt to match devices with the correct of_nodes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Lee,

I love your patch! Yet something to improve:

[auto build test ERROR on ljones-mfd/for-mfd-next]
[also build test ERROR on v5.7 next-20200611]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Lee-Jones/mfd-Make-a-best-effort-attempt-to-match-devices-with-the-correct-of_nodes/20200611-165650
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
config: x86_64-randconfig-s021-20200611 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-250-g42323db3-dirty
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=x86_64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>, old ones prefixed by <<):

drivers/mfd/mfd-core.c: In function 'mfd_match_of_node_to_dev':
>> drivers/mfd/mfd-core.c:152:17: error: implicit declaration of function 'of_read_number' [-Werror=implicit-function-declaration]
152 |  of_node_addr = of_read_number(reg, of_n_addr_cells(np));
|                 ^~~~~~~~~~~~~~
cc1: some warnings being treated as errors

vim +/of_read_number +152 drivers/mfd/mfd-core.c

   119	
   120	static int mfd_match_of_node_to_dev(struct platform_device *pdev,
   121					    struct device_node *np,
   122					    const struct mfd_cell *cell)
   123	{
   124		struct mfd_of_node_entry *of_entry;
   125		const __be32 *reg;
   126		u64 of_node_addr;
   127		bool of_node_used;
   128	
   129		/* Skip devices 'disabled' by Device Tree */
   130		if (!of_device_is_available(np))
   131			return -ENODEV;
   132	
   133		/* Skip if OF node has previously been allocated to a device */
   134		of_node_used = false;
   135		list_for_each_entry(of_entry, &mfd_of_node_list, list)
   136			if (of_entry->np == np)
   137				of_node_used = true;
   138	
   139		if (of_node_used)
   140			return -EAGAIN;
   141	
   142		if (!cell->of_reg)
   143			/* No match defined - allocate the first free matching node */
   144			goto allocate_of_node;
   145	
   146		/* We only care about each node's first defined address */
   147		reg = of_get_address(np, 0, NULL, NULL);
   148		if (!reg)
   149			/* OF node does not contatin a 'reg' property to match to */
   150			return -EAGAIN;
   151	
 > 152		of_node_addr = of_read_number(reg, of_n_addr_cells(np));
   153	
   154		if (cell->of_reg != of_node_addr)
   155			/* No match */
   156			return -EAGAIN;
   157	
   158	allocate_of_node:
   159		of_entry = kzalloc(sizeof(*of_entry), GFP_KERNEL);
   160		if (!of_entry)
   161			return -ENOMEM;
   162	
   163		of_entry->dev = &pdev->dev;
   164		of_entry->np = np;
   165		list_add_tail(&of_entry->list, &mfd_of_node_list);
   166	
   167		pdev->dev.of_node = np;
   168		pdev->dev.fwnode = &np->fwnode;
   169	
   170		return 0;
   171	}
   172	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux