From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 501482EA737 for ; Thu, 21 Aug 2025 19:33:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755804813; cv=none; b=QltIGSucafW1+j1Yui2dnzRN6/ti/AqaQLq8LxAYXR9xV1BUSevQ57YjlgBEvPhk4V70hZjg/6jYrzDxlVr4iwqZKStTXggT3Mz9v8CYA0bwZJf+vhwUo48274AGI/4zmsKsMs9w5FzxTrxWCLVdeva/8NaNTKQa6UB4BMc5v8I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755804813; c=relaxed/simple; bh=+wzIYFm7HBgKwCOSy9EFwHPyfPxep0WgbIxkXPongsE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SPBUvnWZkbUEpHpo0A+4dEcbo2dhKTrWb/zy9VboJU1DKZSZGOJn1a6NsKLWzlRk2FGNtIaKrRbv0h4rsCGFoF7pEsgUSDlKMxU9dc4RV2cdX8frmEBEclrQ/FEm0sa0gbhr0Lqo7vcdP3btISXIjyexP51Ql4RJalB1E2gdc8o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=cWtBZfUb; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cWtBZfUb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1755804811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4a7oEyPNBxhjMx3DnT1g8ru/QEOUUr1PYi92/P1Icd4=; b=cWtBZfUbNiwTKVncXme2RPmGRoVYLLMCdW7fKopBLTxl0ovDtACGsOf3n2AJLIvZ8s8CyW DIxCgGW12pc3L5N58/xGp3n28vSf+yTsEQG4Xodn60eWH8XOlXyq++o3eeAf0DdVqpK6Cn FoLZcNpaor+JObBxNv/u56hFuDBveug= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-64-TEgLSAs3OYO4dLKewPXrvg-1; Thu, 21 Aug 2025 15:33:27 -0400 X-MC-Unique: TEgLSAs3OYO4dLKewPXrvg-1 X-Mimecast-MFC-AGG-ID: TEgLSAs3OYO4dLKewPXrvg_1755804805 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5CD79180035B; Thu, 21 Aug 2025 19:33:25 +0000 (UTC) Received: from chopper.redhat.com (unknown [10.22.89.200]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 514921955F24; Thu, 21 Aug 2025 19:33:21 +0000 (UTC) From: Lyude Paul To: Cc: Andreas Hindborg , Daniel Almeida , 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=B6rn=20Roy=20Baron?= , Benno Lossin , Alice Ryhl , Trevor Gross , Danilo Krummrich , rust-for-linux@vger.kernel.org (open list:DELAY, SLEEP, TIMEKEEPING, TIMERS [RUST]), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v9 2/7] rust: hrtimer: Add HrTimerInstant Date: Thu, 21 Aug 2025 15:32:42 -0400 Message-ID: <20250821193259.964504-3-lyude@redhat.com> In-Reply-To: <20250821193259.964504-1-lyude@redhat.com> References: <20250821193259.964504-1-lyude@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Since we want to add HrTimer methods that can accept Instants, we will want to make sure that for each method we are using the correct Clocksource for the given HrTimer. This would get a bit overly-verbose, so add a simple HrTimerInstant type-alias to handle this for us. Signed-off-by: Lyude Paul Reviewed-by: Andreas Hindborg Reviewed-by: Daniel Almeida --- rust/kernel/time/hrtimer.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rust/kernel/time/hrtimer.rs b/rust/kernel/time/hrtimer.rs index 6bfc0223f4f57..be1bad4aacaad 100644 --- a/rust/kernel/time/hrtimer.rs +++ b/rust/kernel/time/hrtimer.rs @@ -72,6 +72,11 @@ use core::marker::PhantomData; use pin_init::PinInit; +/// A type-alias to refer to the [`Instant`] for a given `T` from [`HrTimer`]. +/// +/// Where `C` is the [`ClockSource`] of the [`HrTimer`]. +pub type HrTimerInstant = Instant<<>::TimerMode as HrTimerMode>::Clock>; + /// A timer backed by a C `struct hrtimer`. /// /// # Invariants -- 2.50.0