linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] rtc: wilco-ec: Remove yday and wday calculations
@ 2019-09-16 18:12 Nick Crews
  2019-09-16 18:12 ` [PATCH v2 2/2] rtc: wilco-ec: Fix license to GPL from GPLv2 Nick Crews
  2019-09-22 16:13 ` [PATCH v2 1/2] rtc: wilco-ec: Remove yday and wday calculations Pavel Machek
  0 siblings, 2 replies; 12+ messages in thread
From: Nick Crews @ 2019-09-16 18:12 UTC (permalink / raw)
  To: bleung, Alexandre Belloni, Alessandro Zummo
  Cc: enric.balletbo, linux-kernel, dlaurie, Nick Crews

The tm_yday and tm_wday fields are not used by userspace,
so since they aren't needed within the driver, don't
bother calculating them. This is especially needed since
the rtc_year_days() call was crashing if the HW returned
an invalid time.

Signed-off-by: Nick Crews <ncrews@chromium.org>
---
 drivers/rtc/rtc-wilco-ec.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/rtc/rtc-wilco-ec.c b/drivers/rtc/rtc-wilco-ec.c
index 8ad4c4e6d557..e84faa268caf 100644
--- a/drivers/rtc/rtc-wilco-ec.c
+++ b/drivers/rtc/rtc-wilco-ec.c
@@ -110,10 +110,6 @@ static int wilco_ec_rtc_read(struct device *dev, struct rtc_time *tm)
 	tm->tm_mday	= rtc.day;
 	tm->tm_mon	= rtc.month - 1;
 	tm->tm_year	= rtc.year + (rtc.century * 100) - 1900;
-	tm->tm_yday	= rtc_year_days(tm->tm_mday, tm->tm_mon, tm->tm_year);
-
-	/* Don't compute day of week, we don't need it. */
-	tm->tm_wday = -1;
 
 	return 0;
 }
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-09-25 20:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-16 18:12 [PATCH v2 1/2] rtc: wilco-ec: Remove yday and wday calculations Nick Crews
2019-09-16 18:12 ` [PATCH v2 2/2] rtc: wilco-ec: Fix license to GPL from GPLv2 Nick Crews
2019-09-22 20:29   ` Pavel Machek
2019-09-22 20:43     ` Alexandre Belloni
2019-09-23 17:12       ` Nick Crews
2019-09-24  7:55       ` Pavel Machek
2019-09-24 14:37         ` Nick Crews
2019-09-22 16:13 ` [PATCH v2 1/2] rtc: wilco-ec: Remove yday and wday calculations Pavel Machek
2019-09-22 19:05   ` Alexandre Belloni
2019-09-23 17:20     ` Nick Crews
2019-09-23 20:19       ` Alexandre Belloni
2019-09-25 20:13         ` Nick Crews

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).