From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFF31274FEB for ; Fri, 30 Jan 2026 19:39:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769801956; cv=none; b=HJHHP3ZUlpS1sDWaz1qTmy/k7pL65VLiB4j4kQrppXYL5EOhToyO8MX/1fdGbyreroNf+XAceJEYqE5mbkwSLIq2zTUrawvaEgXk1HU/hQ+LcGrcdmUdQn0DWS6AxHcRVWPTmNRJZ/H7GTSWd7j6O7p/32FNhT/YkJiUvWHgkHQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769801956; c=relaxed/simple; bh=A9yFI1raQdvO4cNdf9MH+kUav71i5xVfHOPCFTkdiJM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Mzn2FHCGJSBlhpQMCA/ag4bwrI8lvNoxATcVlmY6ILk1GeZBq3Q0BKVSTZJ2YAvYPEAzdzpPT0f22qEIc52cLYP+7qOaVn3DGQtidRTt7FOkTEQt/evHbeHc/GvD7zI9u6evLpwm9c0rUiFGw5NZfOJWLb3vGs8CsXFSB1mI/lM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZBVEewqE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZBVEewqE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 238CDC4CEF7; Fri, 30 Jan 2026 19:39:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769801956; bh=A9yFI1raQdvO4cNdf9MH+kUav71i5xVfHOPCFTkdiJM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZBVEewqESlakShqKVBIyJQqt8Pqndqfnp8/GSh6A0Lk2wdUA9BtgXxZ2mar9UxlFQ AlQtCGD6/TxSeC1OfctmEhWhhNC04da3qf3eLlwJOcMxxRd9+6U1Dc0lIW0aScZRPr HA3y4TE+feDrOOPjuhUdHtMuJ6+p9us6I/NOo44PlmI/5Szhght4srJzvccJzM7dwQ IzKifcuabuurbziZlL4JezONmlJlP9JYDuuKo0VPPxmcx+ljP2zOHvbRj5B7Ifxe2p IBt4iNHnxojIV4Iz21NZLiB1gGbxypr6NTlBxpNgu2nLcPT5xwgX11ibU76NyMJKxN Q6XTxqQc1ezMA== Date: Fri, 30 Jan 2026 19:39:12 +0000 From: Mark Brown To: Jinjie Ruan 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 Message-ID: References: <20260123080940.335474-1-ruanjinjie@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yz2K3Wx/gTXjYhU0" Content-Disposition: inline In-Reply-To: X-Cookie: War is an equal opportunity destroyer. --yz2K3Wx/gTXjYhU0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: >=20 > > 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. --yz2K3Wx/gTXjYhU0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAml9CN8ACgkQJNaLcl1U h9DWXgf/ah/arh+PKs4HEEUcztYMqJWzJLIrQcd8AG70pFgRnO2QjpRki0MedqSj oBz3JWbhjDkb47lDputnxAf0O5v1O26YtRW3qj8DyvVPH4FtTXdpyF+JhPT7iJ74 G1q6h7GklbKAj+H0QpzWWHlSxTdX0avJsjS4/TVQAgJkImaySdy/Ny14uLtrLRL3 6ybJMrH5m+e3jn/pUJmBThDaulVym35Vcg/eQifYR/ST2fPsIGeIBJYirJ7f5LSW U85j4kTX4cQpzyO8iJL0eWoeyS5J2bGGD85ZqgxZH1Rels4g+6agWo05P8rKZcfe dHwuCvWKfz1BjWqI5my8rv31Iyh1aQ== =wk7Z -----END PGP SIGNATURE----- --yz2K3Wx/gTXjYhU0--