All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] rtc: Improve performance of rtc_time64_to_tm. Add tests.
@ 2021-05-30  1:31 Cassio Neri
  2021-05-30  2:31 ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Cassio Neri @ 2021-05-30  1:31 UTC (permalink / raw)
  To: a.zummo, alexandre.belloni
  Cc: linux-rtc, linux-kernel, Cassio Neri, kernel test robot

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


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

* Re: [PATCH v2] rtc: Improve performance of rtc_time64_to_tm. Add tests.
  2021-05-30  1:31 [PATCH v2] rtc: Improve performance of rtc_time64_to_tm. Add tests Cassio Neri
@ 2021-05-30  2:31 ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2021-05-30  2:31 UTC (permalink / raw)
  To: Cassio Neri; +Cc: a.zummo, linux-rtc, linux-kernel, kernel test robot

Hello,

Your v2 as to be self contained, not a simple patch on top of v1.

On 30/05/2021 02:31:59+0100, Cassio Neri wrote:
> 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
> 

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2021-05-30  2:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-30  1:31 [PATCH v2] rtc: Improve performance of rtc_time64_to_tm. Add tests Cassio Neri
2021-05-30  2:31 ` Alexandre Belloni

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.