lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 16 Nov 2022 23:57:31 +0800
From:   kernel test robot <lkp@...el.com>
To:     Qin Jian <qinjian@...lus1.com>
Cc:     oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Arnd Bergmann <arnd@...db.de>
Subject: drivers/rtc/rtc-sunplus.c:243:33: warning: format '%x' expects
 argument of type 'unsigned int', but argument 4 has type 'resource_size_t'
 {aka 'long long unsigned int'}

Hi Qin,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   59d0d52c30d4991ac4b329f049cc37118e00f5b0
commit: 0aa94eea8d955c82014e5368a843da93f1dc58f8 ARM: sunplus: Add initial support for Sunplus SP7021 SoC
date:   4 months ago
config: arm-randconfig-r013-20221116
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0aa94eea8d955c82014e5368a843da93f1dc58f8
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 0aa94eea8d955c82014e5368a843da93f1dc58f8
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/rtc/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/device.h:15,
                    from include/linux/platform_device.h:13,
                    from drivers/rtc/rtc-sunplus.c:16:
   drivers/rtc/rtc-sunplus.c: In function 'sp_rtc_probe':
>> drivers/rtc/rtc-sunplus.c:243:33: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Wformat=]
     243 |         dev_dbg(&plat_dev->dev, "res = 0x%x, reg_base = 0x%lx\n",
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:129:41: note: in definition of macro 'dev_printk'
     129 |                 _dev_printk(level, dev, fmt, ##__VA_ARGS__);            \
         |                                         ^~~
   include/linux/dev_printk.h:163:45: note: in expansion of macro 'dev_fmt'
     163 |                 dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
         |                                             ^~~~~~~
   drivers/rtc/rtc-sunplus.c:243:9: note: in expansion of macro 'dev_dbg'
     243 |         dev_dbg(&plat_dev->dev, "res = 0x%x, reg_base = 0x%lx\n",
         |         ^~~~~~~
   drivers/rtc/rtc-sunplus.c:243:43: note: format string is defined here
     243 |         dev_dbg(&plat_dev->dev, "res = 0x%x, reg_base = 0x%lx\n",
         |                                          ~^
         |                                           |
         |                                           unsigned int
         |                                          %llx


vim +243 drivers/rtc/rtc-sunplus.c

fad6cbe9b2b4137 Vincent Shih   2021-12-03  228  
fad6cbe9b2b4137 Vincent Shih   2021-12-03  229  static int sp_rtc_probe(struct platform_device *plat_dev)
fad6cbe9b2b4137 Vincent Shih   2021-12-03  230  {
fad6cbe9b2b4137 Vincent Shih   2021-12-03  231  	struct sunplus_rtc *sp_rtc;
fad6cbe9b2b4137 Vincent Shih   2021-12-03  232  	int ret;
fad6cbe9b2b4137 Vincent Shih   2021-12-03  233  
fad6cbe9b2b4137 Vincent Shih   2021-12-03  234  	sp_rtc = devm_kzalloc(&plat_dev->dev, sizeof(*sp_rtc), GFP_KERNEL);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  235  	if (!sp_rtc)
fad6cbe9b2b4137 Vincent Shih   2021-12-03  236  		return -ENOMEM;
fad6cbe9b2b4137 Vincent Shih   2021-12-03  237  
fad6cbe9b2b4137 Vincent Shih   2021-12-03  238  	sp_rtc->res = platform_get_resource_byname(plat_dev, IORESOURCE_MEM, RTC_REG_NAME);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  239  	sp_rtc->reg_base = devm_ioremap_resource(&plat_dev->dev, sp_rtc->res);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  240  	if (IS_ERR(sp_rtc->reg_base))
5ceee540fdc7f1d Yang Yingliang 2022-01-06  241  		return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->reg_base),
fad6cbe9b2b4137 Vincent Shih   2021-12-03  242  					    "%s devm_ioremap_resource fail\n", RTC_REG_NAME);
fad6cbe9b2b4137 Vincent Shih   2021-12-03 @243  	dev_dbg(&plat_dev->dev, "res = 0x%x, reg_base = 0x%lx\n",
fad6cbe9b2b4137 Vincent Shih   2021-12-03  244  		sp_rtc->res->start, (unsigned long)sp_rtc->reg_base);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  245  
fad6cbe9b2b4137 Vincent Shih   2021-12-03  246  	sp_rtc->irq = platform_get_irq(plat_dev, 0);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  247  	if (sp_rtc->irq < 0)
fad6cbe9b2b4137 Vincent Shih   2021-12-03  248  		return dev_err_probe(&plat_dev->dev, sp_rtc->irq, "platform_get_irq failed\n");
fad6cbe9b2b4137 Vincent Shih   2021-12-03  249  
fad6cbe9b2b4137 Vincent Shih   2021-12-03  250  	ret = devm_request_irq(&plat_dev->dev, sp_rtc->irq, sp_rtc_irq_handler,
fad6cbe9b2b4137 Vincent Shih   2021-12-03  251  			       IRQF_TRIGGER_RISING, "rtc irq", plat_dev);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  252  	if (ret)
fad6cbe9b2b4137 Vincent Shih   2021-12-03  253  		return dev_err_probe(&plat_dev->dev, ret, "devm_request_irq failed:\n");
fad6cbe9b2b4137 Vincent Shih   2021-12-03  254  
fad6cbe9b2b4137 Vincent Shih   2021-12-03  255  	sp_rtc->rtcclk = devm_clk_get(&plat_dev->dev, NULL);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  256  	if (IS_ERR(sp_rtc->rtcclk))
fad6cbe9b2b4137 Vincent Shih   2021-12-03  257  		return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->rtcclk),
fad6cbe9b2b4137 Vincent Shih   2021-12-03  258  					    "devm_clk_get fail\n");
fad6cbe9b2b4137 Vincent Shih   2021-12-03  259  
fad6cbe9b2b4137 Vincent Shih   2021-12-03  260  	sp_rtc->rstc = devm_reset_control_get_exclusive(&plat_dev->dev, NULL);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  261  	if (IS_ERR(sp_rtc->rstc))
fad6cbe9b2b4137 Vincent Shih   2021-12-03  262  		return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->rstc),
fad6cbe9b2b4137 Vincent Shih   2021-12-03  263  					    "failed to retrieve reset controller\n");
fad6cbe9b2b4137 Vincent Shih   2021-12-03  264  
fad6cbe9b2b4137 Vincent Shih   2021-12-03  265  	ret = clk_prepare_enable(sp_rtc->rtcclk);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  266  	if (ret)
fad6cbe9b2b4137 Vincent Shih   2021-12-03  267  		goto free_clk;
fad6cbe9b2b4137 Vincent Shih   2021-12-03  268  
fad6cbe9b2b4137 Vincent Shih   2021-12-03  269  	ret = reset_control_deassert(sp_rtc->rstc);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  270  	if (ret)
fad6cbe9b2b4137 Vincent Shih   2021-12-03  271  		goto free_reset_assert;
fad6cbe9b2b4137 Vincent Shih   2021-12-03  272  
fad6cbe9b2b4137 Vincent Shih   2021-12-03  273  	device_init_wakeup(&plat_dev->dev, 1);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  274  	dev_set_drvdata(&plat_dev->dev, sp_rtc);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  275  
fad6cbe9b2b4137 Vincent Shih   2021-12-03  276  	sp_rtc->rtc = devm_rtc_allocate_device(&plat_dev->dev);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  277  	if (IS_ERR(sp_rtc->rtc)) {
fad6cbe9b2b4137 Vincent Shih   2021-12-03  278  		ret = PTR_ERR(sp_rtc->rtc);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  279  		goto free_reset_assert;
fad6cbe9b2b4137 Vincent Shih   2021-12-03  280  	}
fad6cbe9b2b4137 Vincent Shih   2021-12-03  281  
fad6cbe9b2b4137 Vincent Shih   2021-12-03  282  	sp_rtc->rtc->range_max = U32_MAX;
fad6cbe9b2b4137 Vincent Shih   2021-12-03  283  	sp_rtc->rtc->range_min = 0;
fad6cbe9b2b4137 Vincent Shih   2021-12-03  284  	sp_rtc->rtc->ops = &sp_rtc_ops;
fad6cbe9b2b4137 Vincent Shih   2021-12-03  285  
fad6cbe9b2b4137 Vincent Shih   2021-12-03  286  	ret = devm_rtc_register_device(sp_rtc->rtc);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  287  	if (ret)
fad6cbe9b2b4137 Vincent Shih   2021-12-03  288  		goto free_reset_assert;
fad6cbe9b2b4137 Vincent Shih   2021-12-03  289  
fad6cbe9b2b4137 Vincent Shih   2021-12-03  290  	/* Setup trickle charger */
fad6cbe9b2b4137 Vincent Shih   2021-12-03  291  	if (plat_dev->dev.of_node)
fad6cbe9b2b4137 Vincent Shih   2021-12-03  292  		sp_rtc_set_trickle_charger(plat_dev->dev);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  293  
fad6cbe9b2b4137 Vincent Shih   2021-12-03  294  	/* Keep RTC from system reset */
fad6cbe9b2b4137 Vincent Shih   2021-12-03  295  	writel(DIS_SYS_RST_RTC_MASK_BIT | DIS_SYS_RST_RTC, sp_rtc->reg_base + RTC_CTRL);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  296  
fad6cbe9b2b4137 Vincent Shih   2021-12-03  297  	return 0;
fad6cbe9b2b4137 Vincent Shih   2021-12-03  298  
fad6cbe9b2b4137 Vincent Shih   2021-12-03  299  free_reset_assert:
fad6cbe9b2b4137 Vincent Shih   2021-12-03  300  	reset_control_assert(sp_rtc->rstc);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  301  free_clk:
fad6cbe9b2b4137 Vincent Shih   2021-12-03  302  	clk_disable_unprepare(sp_rtc->rtcclk);
fad6cbe9b2b4137 Vincent Shih   2021-12-03  303  
fad6cbe9b2b4137 Vincent Shih   2021-12-03  304  	return ret;
fad6cbe9b2b4137 Vincent Shih   2021-12-03  305  }
fad6cbe9b2b4137 Vincent Shih   2021-12-03  306  

:::::: The code at line 243 was first introduced by commit
:::::: fad6cbe9b2b4137f5af5355d4ee7e4eb38221e7e rtc: Add driver for RTC in Sunplus SP7021

:::::: TO: Vincent Shih <vincent.sunplus@...il.com>
:::::: CC: Alexandre Belloni <alexandre.belloni@...tlin.com>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (185389 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ