Skip to contentSkip to conversation

drivers/rtc/rtc-cros-ec.c:112 cros_ec_rtc_set_time() error: uninitialized symbol 'time'.

PATCH New Dan Carpenter 1 participant 1 message Oct 16, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 34/39 drivers/rtc/rtc-cros-ec.c:112 cros_ec_rtc_set_time() error: uninitialized symbol 'time'.

tree:   https://github.com/alexandrebelloni/linux rtc-misc
head:   bb9a5d739ffaf1c6f33d267e865c02b123b4792f
commit: f8d8bea4a97442957ea627754319f0b7a05f399c [34/39] rtc: cros-ec: let the core handle rtc range

If you fix the issue, kindly add following tag

smatch warnings:
drivers/rtc/rtc-cros-ec.c:112 cros_ec_rtc_set_time() error: uninitialized symbol 'time'.

# https://github.com/alexandrebelloni/linux/commit/f8d8bea4a97442957ea627754319f0b7a05f399c
git remote add alexandrebelloni https://github.com/alexandrebelloni/linux
git remote update alexandrebelloni
git checkout f8d8bea4a97442957ea627754319f0b7a05f399c
vim +/time +112 drivers/rtc/rtc-cros-ec.c

6f2a71a31afd73 Stephen Barber 2017-11-10  104  /* Set the current EC time. */
6f2a71a31afd73 Stephen Barber 2017-11-10  105  static int cros_ec_rtc_set_time(struct device *dev, struct rtc_time *tm)
6f2a71a31afd73 Stephen Barber 2017-11-10  106  {
6f2a71a31afd73 Stephen Barber 2017-11-10  107  	struct cros_ec_rtc *cros_ec_rtc = dev_get_drvdata(dev);
6f2a71a31afd73 Stephen Barber 2017-11-10  108  	struct cros_ec_device *cros_ec = cros_ec_rtc->cros_ec;
6f2a71a31afd73 Stephen Barber 2017-11-10  109  	int ret;
6f2a71a31afd73 Stephen Barber 2017-11-10  110  	time64_t time;
                                                ^^^^^^^^^^^^^

Part of the commit is missing?

6f2a71a31afd73 Stephen Barber 2017-11-10 111

6f2a71a31afd73 Stephen Barber 2017-11-10 @112  	ret = cros_ec_rtc_set(cros_ec, EC_CMD_RTC_SET_VALUE, (u32)time);
                                                                                                     ^^^^^^^^^
6f2a71a31afd73 Stephen Barber 2017-11-10  113  	if (ret < 0) {
6f2a71a31afd73 Stephen Barber 2017-11-10  114  		dev_err(dev, "error setting time: %d\n", ret);
6f2a71a31afd73 Stephen Barber 2017-11-10  115  		return ret;
6f2a71a31afd73 Stephen Barber 2017-11-10  116  	}
6f2a71a31afd73 Stephen Barber 2017-11-10  117  
6f2a71a31afd73 Stephen Barber 2017-11-10  118  	return 0;
6f2a71a31afd73 Stephen Barber 2017-11-10  119  }

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