[xlnx:master 2022/2087] drivers//of/configfs.c:52:15: warning: assignment makes pointer from integer without a cast

From: kbuild test robot <hidden>
Date: 2018-12-28 12:23:35

tree:   https://github.com/Xilinx/linux-xlnx master
head:   4d97746570a6e51f834bbf2758a4b4c33308428d
commit: a81ef2e987559945592741160965e21229083dca [2022/2087] of: configfs: Fix memory leak in create overlay
config: sparc64-allyesconfig (attached as .config)
compiler: sparc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout a81ef2e987559945592741160965e21229083dca
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=sparc64 

All warnings (new ones prefixed by >>):

   drivers//of/configfs.c: In function 'create_overlay':
   drivers//of/configfs.c:52:17: error: implicit declaration of function 'of_fdt_unflatten_tree'; did you mean 'of_pdt_build_devicetree'? [-Werror=implicit-function-declaration]
     overlay->mem = of_fdt_unflatten_tree(blob, NULL, &overlay->overlay);
                    ^~~~~~~~~~~~~~~~~~~~~
                    of_pdt_build_devicetree
quoted
drivers//of/configfs.c:52:15: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     overlay->mem = of_fdt_unflatten_tree(blob, NULL, &overlay->overlay);
                  ^
   In file included from include/linux/kernel.h:14:0,
                    from include/linux/list.h:9,
                    from include/linux/kobject.h:20,
                    from include/linux/device.h:17,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from drivers//of/configfs.c:12:
   drivers//of/configfs.c: In function 'cfs_overlay_item_dtbo_read':
   drivers//of/configfs.c:162:11: warning: format '%u' expects argument of type 'unsigned int', but argument 5 has type 'size_t {aka long unsigned int}' [-Wformat=]
     pr_debug("%s: buf=%p max_count=%u\n", __func__,
              ^
   include/linux/printk.h:286:21: note: in definition of macro 'pr_fmt'
    #define pr_fmt(fmt) fmt
                        ^~~
   include/linux/printk.h:334:2: note: in expansion of macro 'dynamic_pr_debug'
     dynamic_pr_debug(fmt, ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~
   drivers//of/configfs.c:162:2: note: in expansion of macro 'pr_debug'
     pr_debug("%s: buf=%p max_count=%u\n", __func__,
     ^~~~~~~~
   cc1: some warnings being treated as errors

vim +52 drivers//of/configfs.c

    46	
    47	static int create_overlay(struct cfs_overlay_item *overlay, void *blob)
    48	{
    49		int err;
    50	
    51		/* unflatten the tree */
  > 52		overlay->mem = of_fdt_unflatten_tree(blob, NULL, &overlay->overlay);
    53		if (overlay->overlay == NULL) {
    54			pr_err("%s: failed to unflatten tree\n", __func__);
    55			return -EINVAL;
    56		}
    57		pr_debug("%s: unflattened OK\n", __func__);
    58	
    59		/* mark it as detached */
    60		of_node_set_flag(overlay->overlay, OF_DETACHED);
    61	
    62		/* Lock while resolving phandles and applying overlay */
    63		mutex_lock(&overlay_lock);
    64	
    65		/* perform resolution */
    66		err = of_resolve_phandles(overlay->overlay);
    67		if (err != 0) {
    68			mutex_unlock(&overlay_lock);
    69			pr_err("%s: Failed to resolve tree\n", __func__);
    70			return err;
    71		}
    72		pr_debug("%s: resolved OK\n", __func__);
    73	
    74		err = of_overlay_create(overlay->overlay);
    75		mutex_unlock(&overlay_lock);
    76	
    77		if (err < 0) {
    78			pr_err("%s: Failed to create overlay (err=%d)\n",
    79					__func__, err);
    80			return err;
    81		}
    82		overlay->ov_id = err;
    83	
    84		return 0;
    85	}
    86	

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

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help