public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cassio Neri <cassio.neri@gmail.com>
To: a.zummo@towertech.it, alexandre.belloni@bootlin.com
Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Cassio Neri <cassio.neri@gmail.com>,
	kernel test robot <lkp@intel.com>
Subject: [PATCH v2] rtc: Improve performance of rtc_time64_to_tm. Add tests.
Date: Sun, 30 May 2021 02:31:59 +0100	[thread overview]
Message-ID: <20210530013159.383230-1-cassio.neri@gmail.com> (raw)

Signed-off-by: Cassio Neri <cassio.neri@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>

---

Fix link issue on 32 bit platforms raised from the v1.

---
 drivers/rtc/lib_test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/rtc/lib_test.c b/drivers/rtc/lib_test.c
index 0060e3a72b50..e50513c8e086 100644
--- a/drivers/rtc/lib_test.c
+++ b/drivers/rtc/lib_test.c
@@ -45,13 +45,16 @@ static void rtc_time64_to_tm_test_date_range(struct kunit *test)
 
 	struct rtc_time result;
 	time64_t secs;
+	s64      days;
 
 	for (secs = 0; secs <= total_secs; secs += 86400) {
 
 		rtc_time64_to_tm(secs, &result);
 
+		days = div_s64(secs, 86400);
+
 		#define FAIL_MSG "%d/%02d/%02d (%2d) : %ld", \
-			year, month, mday, yday, secs/86400
+			year, month, mday, yday, days
 
 		KUNIT_ASSERT_EQ_MSG(test, year - 1900, result.tm_year, FAIL_MSG);
 		KUNIT_ASSERT_EQ_MSG(test, month - 1, result.tm_mon, FAIL_MSG);

base-commit: bcae59d0d45b866d5b9525ea8ece6d671e6767c8
prerequisite-patch-id: ea804a9b3d52cd4f6bfbbf1c53260cb8f2d2c60b
-- 
2.31.0


             reply	other threads:[~2021-05-30  1:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-30  1:31 Cassio Neri [this message]
2021-05-30  2:31 ` [PATCH v2] rtc: Improve performance of rtc_time64_to_tm. Add tests Alexandre Belloni

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=20210530013159.383230-1-cassio.neri@gmail.com \
    --to=cassio.neri@gmail.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=lkp@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox