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 CC2B52F8BC4; Tue, 26 Aug 2025 08:21:06 +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=1756196466; cv=none; b=uhxFOHNnWUFF98ey7pMd1rR3a/3dM1pUz8AhvbV4saHKd/qt+/IkpUlHiNrDVcjhpPRtscTqZejRomzmyMWq74ZIDTpWWuIO2FbPdB/ZHAteXdRAlQFTctaWTQPfJR9bnFQznKiy/OdqYQsxhDaYFD9XozL+FVFrNUG27TeOBGA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756196466; c=relaxed/simple; bh=VHtPe5jrCC23n5pXuxslMt4jtqxbQWQxIqRz+ykRYqc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=CmsQiHQqfdjAYwK9c2zYYb39QTJEqFv4BPkujdaBGLyjvKbDsO3oeHfDzepl/nZeDGcSkz/Df8A0nQdgSwH6w1yhGiCr3qBjPHKn2Mz83HanwZpjp1rXszxi/xDTeI9VqUEYwKj2kosxaHrEfjtGKSEMdCcN5gbysTYKxrNy+uQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HGNy944t; 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="HGNy944t" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7165C4CEF4; Tue, 26 Aug 2025 08:21:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756196466; bh=VHtPe5jrCC23n5pXuxslMt4jtqxbQWQxIqRz+ykRYqc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=HGNy944tw/PICNv7AoXNC0FsSXtnZbGeCHi9OGTo65v0cSjqyPCJx3jLvlCbJC7v8 t4MwE8i7uS6CF3XbGr5hixkiJlbkQiwADfNjAs6Pm3F34BK69ETVkMjoV1Ns/A7FKM F9j9sN4hqXU728ujPag2Ie5fT3+CesjF0QFkNIVYpr4IhXkJJa4d2WKACWXN6FZI2n A0hPWPxEqf2WsC1/7UznfsDWq8q22LhPh9R934ft07dZj+PdxKSKUkCapVqd3HFjmX SCCk8uImjWjfu37uk8vo6BB4kNd3WhqLT6oHpIUqVpAXsGqs4EFzRtD80QuV7ZMk0/ lA1futi7WAQRQ== From: Andreas Hindborg To: Alice Ryhl , Lyude Paul Cc: Boqun Feng , FUJITA Tomonori , Frederic Weisbecker , Thomas Gleixner , Anna-Maria Behnsen , John Stultz , Stephen Boyd , Miguel Ojeda , Alex Gaynor , Gary Guo , =?utf-8?Q?Bj=C3=B6r?= =?utf-8?Q?n?= Roy Baron , Benno Lossin , Trevor Gross , Danilo Krummrich , "open list:DELAY, SLEEP, TIMEKEEPING, TIMERS [RUST]" , open list Subject: Re: [PATCH v9 6/7] rust: time: Add Instant::from_ktime() In-Reply-To: References: <20250821193259.964504-1-lyude@redhat.com> <20250821193259.964504-7-lyude@redhat.com> <9xg5ZgDe4l4OXDVVwdu6JhDCXp6ox0Xzh4q2NU-SbGcTRu--I6ik0F0jtI_s46L6ieRFIpXWw8mkjNFiHAsOKQ==@protonmail.internalid> Date: Tue, 26 Aug 2025 10:20:56 +0200 Message-ID: <87jz2qwl1z.fsf@t14s.mail-host-address-is-not-set> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable "Alice Ryhl" writes: > On Thu, Aug 21, 2025 at 9:34=E2=80=AFPM Lyude Paul wro= te: >> > >> + #[inline] >> + pub(crate) unsafe fn from_ktime(ktime: bindings::ktime_t) -> Self { >> + debug_assert!(ktime >=3D 0); > > If you're going to have a debug assertion, perhaps it would make sense > to check both bounds? The upper bound is bindings::ktime_t::MAX, so it would be a useless check. Best regards, Andreas Hindborg