[PATCH 2/3] rtc: support for the Amlogic on-chip RTC
kernel test robot
lkp at intel.com
Mon Aug 26 05:57:58 PDT 2024
Hi Xianwei,
kernel test robot noticed the following build warnings:
[auto build test WARNING on dff71e5c6076314f3eefe700abd6af834c57bd64]
url: https://github.com/intel-lab-lkp/linux/commits/Xianwei-Zhao-via-B4-Relay/dt-bindings-rtc-Add-Amlogic-A311L2-and-A113X2-rtc/20240826-125504
base: dff71e5c6076314f3eefe700abd6af834c57bd64
patch link: https://lore.kernel.org/r/20240823-rtc-v1-2-6f70381da283%40amlogic.com
patch subject: [PATCH 2/3] rtc: support for the Amlogic on-chip RTC
config: i386-buildonly-randconfig-003-20240826 (https://download.01.org/0day-ci/archive/20240826/202408262035.4BysJ5CK-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240826/202408262035.4BysJ5CK-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408262035.4BysJ5CK-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/rtc/rtc-amlogic.c:159:6: warning: variable 'alarm_sec' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
159 | if (alarm->enabled) {
| ^~~~~~~~~~~~~~
drivers/rtc/rtc-amlogic.c:173:19: note: uninitialized use occurs here
173 | alarm->enabled, alarm_sec);
| ^~~~~~~~~
include/linux/dev_printk.h:168:46: note: expanded from macro 'dev_dbg'
168 | dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~
include/linux/dev_printk.h:129:34: note: expanded from macro 'dev_printk'
129 | _dev_printk(level, dev, fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
drivers/rtc/rtc-amlogic.c:159:2: note: remove the 'if' if its condition is always true
159 | if (alarm->enabled) {
| ^~~~~~~~~~~~~~~~~~~
drivers/rtc/rtc-amlogic.c:157:20: note: initialize the variable 'alarm_sec' to silence this warning
157 | time64_t alarm_sec;
| ^
| = 0
>> drivers/rtc/rtc-amlogic.c:565:34: warning: unused variable 'aml_rtc_device_id' [-Wunused-const-variable]
565 | static const struct of_device_id aml_rtc_device_id[] = {
| ^~~~~~~~~~~~~~~~~
2 warnings generated.
vim +159 drivers/rtc/rtc-amlogic.c
153
154 static int aml_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
155 {
156 struct aml_rtc_data *rtc = dev_get_drvdata(dev);
157 time64_t alarm_sec;
158
> 159 if (alarm->enabled) {
160 regmap_update_bits(rtc->map, RTC_CTRL,
161 RTC_ALRM0_EN, RTC_ALRM0_EN);
162 regmap_update_bits(rtc->map, RTC_INT_MASK,
163 RTC_ALRM0_IRQ_MSK, 0);
164
165 alarm_sec = rtc_tm_to_time64(&alarm->time);
166 if (alarm_sec > U32_MAX) {
167 dev_err(dev, "alarm value invalid!\n");
168 return -EINVAL;
169 }
170 aml_set_alarm(rtc, alarm_sec);
171 }
172 dev_dbg(dev, "%s: alarm->enabled=%d alarm_set=%llds\n", __func__,
173 alarm->enabled, alarm_sec);
174
175 return 0;
176 }
177
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
More information about the linux-amlogic
mailing list