All of lore.kernel.org
 help / color / mirror / Atom feed
* [shenki:dev-5.5 95/117] drivers/soc/aspeed/aspeed-lpc-ctrl.c:247:17: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'resource_size_t {aka long long unsigned int}'
@ 2020-01-30  8:10 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-01-30  8:10 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 5436 bytes --]

tree:   https://github.com/shenki/linux dev-5.5
head:   f547d16b9b97b8e9661b61ad0bc83f9729be3d73
commit: b77722515453e048e356d2b606bb16b144bc3e57 [95/117] soc: aspeed: Fail probe of lpc-ctrl if reserved memory is not aligned
config: x86_64-randconfig-a003-20200129 (attached as .config)
compiler: gcc-6 (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
reproduce:
        git checkout b77722515453e048e356d2b606bb16b144bc3e57
        # 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 <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/miscdevice.h:7:0,
                    from drivers/soc/aspeed/aspeed-lpc-ctrl.c:9:
   drivers/soc/aspeed/aspeed-lpc-ctrl.c: In function 'aspeed_lpc_ctrl_probe':
>> drivers/soc/aspeed/aspeed-lpc-ctrl.c:247:17: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'resource_size_t {aka long long unsigned int}' [-Wformat=]
       dev_err(dev, "Reserved memory size must be a power of 2, got %zu\n",
                    ^
   include/linux/device.h:1691:22: note: in definition of macro 'dev_fmt'
    #define dev_fmt(fmt) fmt
                         ^~~
>> drivers/soc/aspeed/aspeed-lpc-ctrl.c:247:4: note: in expansion of macro 'dev_err'
       dev_err(dev, "Reserved memory size must be a power of 2, got %zu\n",
       ^~~~~~~
   drivers/soc/aspeed/aspeed-lpc-ctrl.c:253:17: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'resource_size_t {aka long long unsigned int}' [-Wformat=]
       dev_err(dev, "Reserved memory must be naturally aligned for size %zu\n",
                    ^
   include/linux/device.h:1691:22: note: in definition of macro 'dev_fmt'
    #define dev_fmt(fmt) fmt
                         ^~~
   drivers/soc/aspeed/aspeed-lpc-ctrl.c:253:4: note: in expansion of macro 'dev_err'
       dev_err(dev, "Reserved memory must be naturally aligned for size %zu\n",
       ^~~~~~~

vim +247 drivers/soc/aspeed/aspeed-lpc-ctrl.c

   197	
   198	static int aspeed_lpc_ctrl_probe(struct platform_device *pdev)
   199	{
   200		struct aspeed_lpc_ctrl *lpc_ctrl;
   201		struct device_node *node;
   202		struct resource resm;
   203		struct device *dev;
   204		int rc;
   205	
   206		dev = &pdev->dev;
   207	
   208		lpc_ctrl = devm_kzalloc(dev, sizeof(*lpc_ctrl), GFP_KERNEL);
   209		if (!lpc_ctrl)
   210			return -ENOMEM;
   211	
   212		/* If flash is described in device tree then store */
   213		node = of_parse_phandle(dev->of_node, "flash", 0);
   214		if (!node) {
   215			dev_dbg(dev, "Didn't find host pnor flash node\n");
   216		} else {
   217			rc = of_address_to_resource(node, 1, &resm);
   218			of_node_put(node);
   219			if (rc) {
   220				dev_err(dev, "Couldn't address to resource for flash\n");
   221				return rc;
   222			}
   223	
   224			lpc_ctrl->pnor_size = resource_size(&resm);
   225			lpc_ctrl->pnor_base = resm.start;
   226		}
   227	
   228	
   229		dev_set_drvdata(&pdev->dev, lpc_ctrl);
   230	
   231		/* If memory-region is described in device tree then store */
   232		node = of_parse_phandle(dev->of_node, "memory-region", 0);
   233		if (!node) {
   234			dev_dbg(dev, "Didn't find reserved memory\n");
   235		} else {
   236			rc = of_address_to_resource(node, 0, &resm);
   237			of_node_put(node);
   238			if (rc) {
   239				dev_err(dev, "Couldn't address to resource for reserved memory\n");
   240				return -ENXIO;
   241			}
   242	
   243			lpc_ctrl->mem_size = resource_size(&resm);
   244			lpc_ctrl->mem_base = resm.start;
   245	
   246			if (!is_power_of_2(lpc_ctrl->mem_size)) {
 > 247				dev_err(dev, "Reserved memory size must be a power of 2, got %zu\n",
   248				       lpc_ctrl->mem_size);
   249				return -EINVAL;
   250			}
   251	
   252			if (!IS_ALIGNED(lpc_ctrl->mem_base, lpc_ctrl->mem_size)) {
   253				dev_err(dev, "Reserved memory must be naturally aligned for size %zu\n",
   254				       lpc_ctrl->mem_size);
   255				return -EINVAL;
   256			}
   257		}
   258	
   259		lpc_ctrl->regmap = syscon_node_to_regmap(
   260				pdev->dev.parent->of_node);
   261		if (IS_ERR(lpc_ctrl->regmap)) {
   262			dev_err(dev, "Couldn't get regmap\n");
   263			return -ENODEV;
   264		}
   265	
   266		lpc_ctrl->clk = devm_clk_get(dev, NULL);
   267		if (IS_ERR(lpc_ctrl->clk)) {
   268			dev_err(dev, "couldn't get clock\n");
   269			return PTR_ERR(lpc_ctrl->clk);
   270		}
   271		rc = clk_prepare_enable(lpc_ctrl->clk);
   272		if (rc) {
   273			dev_err(dev, "couldn't enable clock\n");
   274			return rc;
   275		}
   276	
   277		lpc_ctrl->miscdev.minor = MISC_DYNAMIC_MINOR;
   278		lpc_ctrl->miscdev.name = DEVICE_NAME;
   279		lpc_ctrl->miscdev.fops = &aspeed_lpc_ctrl_fops;
   280		lpc_ctrl->miscdev.parent = dev;
   281		rc = misc_register(&lpc_ctrl->miscdev);
   282		if (rc) {
   283			dev_err(dev, "Unable to register device\n");
   284			goto err;
   285		}
   286	
   287		return 0;
   288	
   289	err:
   290		clk_disable_unprepare(lpc_ctrl->clk);
   291		return rc;
   292	}
   293	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36148 bytes --]

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

only message in thread, other threads:[~2020-01-30  8:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-30  8:10 [shenki:dev-5.5 95/117] drivers/soc/aspeed/aspeed-lpc-ctrl.c:247:17: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'resource_size_t {aka long long unsigned int}' kbuild 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.