[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202301061721.OeBmJgAJ-lkp@intel.com>
Date: Fri, 6 Jan 2023 17:49:01 +0800
From: kernel test robot <lkp@...el.com>
To: Qin Jian <qinjian@...lus1.com>
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
linux-kernel@...r.kernel.org, Arnd Bergmann <arnd@...db.de>
Subject: drivers/rtc/rtc-sunplus.c:244:3: warning: format specifies type
'unsigned int' but the argument has type 'resource_size_t' (aka 'unsigned
long long')
Hi Qin,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1f5abbd77e2c1787e74b7c2caffac97def78ba52
commit: 0aa94eea8d955c82014e5368a843da93f1dc58f8 ARM: sunplus: Add initial support for Sunplus SP7021 SoC
date: 6 months ago
config: arm-randconfig-r031-20230106
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 8d9828ef5aa9688500657d36cd2aefbe12bbd162)
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
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# 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=clang make.cross W=1 O=build_dir ARCH=arm olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang 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 >>):
>> drivers/rtc/rtc-sunplus.c:244:3: warning: format specifies type 'unsigned int' but the argument has type 'resource_size_t' (aka 'unsigned long long') [-Wformat]
sp_rtc->res->start, (unsigned long)sp_rtc->reg_base);
^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:155:39: note: expanded from macro 'dev_dbg'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/dynamic_debug.h:167:19: note: expanded from macro 'dynamic_dev_dbg'
dev, fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/dynamic_debug.h:152:56: note: expanded from macro '_dynamic_func_call'
__dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
^~~~~~~~~~~
include/linux/dynamic_debug.h:134:15: note: expanded from macro '__dynamic_func_call'
func(&id, ##__VA_ARGS__); \
^~~~~~~~~~~
1 warning generated.
vim +244 drivers/rtc/rtc-sunplus.c
fad6cbe9b2b413 Vincent Shih 2021-12-03 228
fad6cbe9b2b413 Vincent Shih 2021-12-03 229 static int sp_rtc_probe(struct platform_device *plat_dev)
fad6cbe9b2b413 Vincent Shih 2021-12-03 230 {
fad6cbe9b2b413 Vincent Shih 2021-12-03 231 struct sunplus_rtc *sp_rtc;
fad6cbe9b2b413 Vincent Shih 2021-12-03 232 int ret;
fad6cbe9b2b413 Vincent Shih 2021-12-03 233
fad6cbe9b2b413 Vincent Shih 2021-12-03 234 sp_rtc = devm_kzalloc(&plat_dev->dev, sizeof(*sp_rtc), GFP_KERNEL);
fad6cbe9b2b413 Vincent Shih 2021-12-03 235 if (!sp_rtc)
fad6cbe9b2b413 Vincent Shih 2021-12-03 236 return -ENOMEM;
fad6cbe9b2b413 Vincent Shih 2021-12-03 237
fad6cbe9b2b413 Vincent Shih 2021-12-03 238 sp_rtc->res = platform_get_resource_byname(plat_dev, IORESOURCE_MEM, RTC_REG_NAME);
fad6cbe9b2b413 Vincent Shih 2021-12-03 239 sp_rtc->reg_base = devm_ioremap_resource(&plat_dev->dev, sp_rtc->res);
fad6cbe9b2b413 Vincent Shih 2021-12-03 240 if (IS_ERR(sp_rtc->reg_base))
5ceee540fdc7f1 Yang Yingliang 2022-01-06 241 return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->reg_base),
fad6cbe9b2b413 Vincent Shih 2021-12-03 242 "%s devm_ioremap_resource fail\n", RTC_REG_NAME);
fad6cbe9b2b413 Vincent Shih 2021-12-03 243 dev_dbg(&plat_dev->dev, "res = 0x%x, reg_base = 0x%lx\n",
fad6cbe9b2b413 Vincent Shih 2021-12-03 @244 sp_rtc->res->start, (unsigned long)sp_rtc->reg_base);
fad6cbe9b2b413 Vincent Shih 2021-12-03 245
fad6cbe9b2b413 Vincent Shih 2021-12-03 246 sp_rtc->irq = platform_get_irq(plat_dev, 0);
fad6cbe9b2b413 Vincent Shih 2021-12-03 247 if (sp_rtc->irq < 0)
fad6cbe9b2b413 Vincent Shih 2021-12-03 248 return dev_err_probe(&plat_dev->dev, sp_rtc->irq, "platform_get_irq failed\n");
fad6cbe9b2b413 Vincent Shih 2021-12-03 249
fad6cbe9b2b413 Vincent Shih 2021-12-03 250 ret = devm_request_irq(&plat_dev->dev, sp_rtc->irq, sp_rtc_irq_handler,
fad6cbe9b2b413 Vincent Shih 2021-12-03 251 IRQF_TRIGGER_RISING, "rtc irq", plat_dev);
fad6cbe9b2b413 Vincent Shih 2021-12-03 252 if (ret)
fad6cbe9b2b413 Vincent Shih 2021-12-03 253 return dev_err_probe(&plat_dev->dev, ret, "devm_request_irq failed:\n");
fad6cbe9b2b413 Vincent Shih 2021-12-03 254
fad6cbe9b2b413 Vincent Shih 2021-12-03 255 sp_rtc->rtcclk = devm_clk_get(&plat_dev->dev, NULL);
fad6cbe9b2b413 Vincent Shih 2021-12-03 256 if (IS_ERR(sp_rtc->rtcclk))
fad6cbe9b2b413 Vincent Shih 2021-12-03 257 return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->rtcclk),
fad6cbe9b2b413 Vincent Shih 2021-12-03 258 "devm_clk_get fail\n");
fad6cbe9b2b413 Vincent Shih 2021-12-03 259
fad6cbe9b2b413 Vincent Shih 2021-12-03 260 sp_rtc->rstc = devm_reset_control_get_exclusive(&plat_dev->dev, NULL);
fad6cbe9b2b413 Vincent Shih 2021-12-03 261 if (IS_ERR(sp_rtc->rstc))
fad6cbe9b2b413 Vincent Shih 2021-12-03 262 return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->rstc),
fad6cbe9b2b413 Vincent Shih 2021-12-03 263 "failed to retrieve reset controller\n");
fad6cbe9b2b413 Vincent Shih 2021-12-03 264
fad6cbe9b2b413 Vincent Shih 2021-12-03 265 ret = clk_prepare_enable(sp_rtc->rtcclk);
fad6cbe9b2b413 Vincent Shih 2021-12-03 266 if (ret)
fad6cbe9b2b413 Vincent Shih 2021-12-03 267 goto free_clk;
fad6cbe9b2b413 Vincent Shih 2021-12-03 268
fad6cbe9b2b413 Vincent Shih 2021-12-03 269 ret = reset_control_deassert(sp_rtc->rstc);
fad6cbe9b2b413 Vincent Shih 2021-12-03 270 if (ret)
fad6cbe9b2b413 Vincent Shih 2021-12-03 271 goto free_reset_assert;
fad6cbe9b2b413 Vincent Shih 2021-12-03 272
fad6cbe9b2b413 Vincent Shih 2021-12-03 273 device_init_wakeup(&plat_dev->dev, 1);
fad6cbe9b2b413 Vincent Shih 2021-12-03 274 dev_set_drvdata(&plat_dev->dev, sp_rtc);
fad6cbe9b2b413 Vincent Shih 2021-12-03 275
fad6cbe9b2b413 Vincent Shih 2021-12-03 276 sp_rtc->rtc = devm_rtc_allocate_device(&plat_dev->dev);
fad6cbe9b2b413 Vincent Shih 2021-12-03 277 if (IS_ERR(sp_rtc->rtc)) {
fad6cbe9b2b413 Vincent Shih 2021-12-03 278 ret = PTR_ERR(sp_rtc->rtc);
fad6cbe9b2b413 Vincent Shih 2021-12-03 279 goto free_reset_assert;
fad6cbe9b2b413 Vincent Shih 2021-12-03 280 }
fad6cbe9b2b413 Vincent Shih 2021-12-03 281
fad6cbe9b2b413 Vincent Shih 2021-12-03 282 sp_rtc->rtc->range_max = U32_MAX;
fad6cbe9b2b413 Vincent Shih 2021-12-03 283 sp_rtc->rtc->range_min = 0;
fad6cbe9b2b413 Vincent Shih 2021-12-03 284 sp_rtc->rtc->ops = &sp_rtc_ops;
fad6cbe9b2b413 Vincent Shih 2021-12-03 285
fad6cbe9b2b413 Vincent Shih 2021-12-03 286 ret = devm_rtc_register_device(sp_rtc->rtc);
fad6cbe9b2b413 Vincent Shih 2021-12-03 287 if (ret)
fad6cbe9b2b413 Vincent Shih 2021-12-03 288 goto free_reset_assert;
fad6cbe9b2b413 Vincent Shih 2021-12-03 289
fad6cbe9b2b413 Vincent Shih 2021-12-03 290 /* Setup trickle charger */
fad6cbe9b2b413 Vincent Shih 2021-12-03 291 if (plat_dev->dev.of_node)
fad6cbe9b2b413 Vincent Shih 2021-12-03 292 sp_rtc_set_trickle_charger(plat_dev->dev);
fad6cbe9b2b413 Vincent Shih 2021-12-03 293
fad6cbe9b2b413 Vincent Shih 2021-12-03 294 /* Keep RTC from system reset */
fad6cbe9b2b413 Vincent Shih 2021-12-03 295 writel(DIS_SYS_RST_RTC_MASK_BIT | DIS_SYS_RST_RTC, sp_rtc->reg_base + RTC_CTRL);
fad6cbe9b2b413 Vincent Shih 2021-12-03 296
fad6cbe9b2b413 Vincent Shih 2021-12-03 297 return 0;
fad6cbe9b2b413 Vincent Shih 2021-12-03 298
fad6cbe9b2b413 Vincent Shih 2021-12-03 299 free_reset_assert:
fad6cbe9b2b413 Vincent Shih 2021-12-03 300 reset_control_assert(sp_rtc->rstc);
fad6cbe9b2b413 Vincent Shih 2021-12-03 301 free_clk:
fad6cbe9b2b413 Vincent Shih 2021-12-03 302 clk_disable_unprepare(sp_rtc->rtcclk);
fad6cbe9b2b413 Vincent Shih 2021-12-03 303
fad6cbe9b2b413 Vincent Shih 2021-12-03 304 return ret;
fad6cbe9b2b413 Vincent Shih 2021-12-03 305 }
fad6cbe9b2b413 Vincent Shih 2021-12-03 306
:::::: The code at line 244 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://github.com/intel/lkp-tests
View attachment "config" of type "text/plain" (179373 bytes)
Powered by blists - more mailing lists