All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Crews <ncrews@chromium.org>
To: bleung@chromium.org,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Alessandro Zummo <a.zummo@towertech.it>
Cc: enric.balletbo@collabora.com, linux-kernel@vger.kernel.org,
	dlaurie@chromium.org, Nick Crews <ncrews@chromium.org>
Subject: [PATCH v2 1/2] rtc: wilco-ec: Remove yday and wday calculations
Date: Mon, 16 Sep 2019 12:12:15 -0600	[thread overview]
Message-ID: <20190916181215.501-1-ncrews@chromium.org> (raw)

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


             reply	other threads:[~2019-09-16 18:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-16 18:12 Nick Crews [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190916181215.501-1-ncrews@chromium.org \
    --to=ncrews@chromium.org \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bleung@chromium.org \
    --cc=dlaurie@chromium.org \
    --cc=enric.balletbo@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.