mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Jinjie Ruan <ruanjinjie@huawei.com>
Cc: jstultz@google.com, tglx@kernel.org, sboyd@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kunit: time: use is_leap_year() helper
Date: Fri, 30 Jan 2026 19:39:12 +0000	[thread overview]
Message-ID: <f200cf10-0905-4e2b-b0b6-62b0f67ff2bf@sirena.org.uk> (raw)
In-Reply-To: <ebff4525-b25d-477b-9d79-d32d2b7829a7@sirena.org.uk>

[-- Attachment #1: Type: text/plain, Size: 914 bytes --]

On Fri, Jan 30, 2026 at 03:11:17PM +0000, Mark Brown wrote:
> On Fri, Jan 23, 2026 at 04:09:40PM +0800, Jinjie Ruan wrote:
> 
> > Use the is_leap_year() helper from rtc.h instead of
> > writing it by hand

> This patch introduces a regression:

> > -static bool is_leap(long year)

> gets replaced by is_leap_year() which is:

> static inline bool is_leap_year(unsigned int year)

> which looks like it ought to work out the same from a quick look
> although it is written less clearly.  I'll look properly later when I've
> got through the rest of the pile of regressions.

The issue here is, of course, the change from using long for the new to
using unsigned long.  The test is considering times up to 8000 years
before 1970 which results in us trying to convert a negative year to a
positive value before testing if it's a leap year which gives us the
wrong answer.  I'll send a revert.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2026-01-30 19:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-23  8:09 Jinjie Ruan
2026-01-26 15:22 ` [tip: timers/core] time/kunit: Use " tip-bot2 for Jinjie Ruan
2026-01-30 15:11 ` [PATCH] kunit: time: use " Mark Brown
2026-01-30 19:39   ` Mark Brown [this message]
2026-01-30 21:13     ` Thomas Gleixner
2026-01-31 13:31       ` Mark Brown

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=f200cf10-0905-4e2b-b0b6-62b0f67ff2bf@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ruanjinjie@huawei.com \
    --cc=sboyd@kernel.org \
    --cc=tglx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®