Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1508685lqt; Wed, 20 Mar 2024 06:19:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVzjpwoSnK5TZN9cvbxNWwWG+3YaIkBRkZoerBgtkp4Z7/b3wnAcJNGTlXQpiD7iPbufNhiTJY26nJ48AxlZrErugtE6wXh1XdoZ4igjQ== X-Google-Smtp-Source: AGHT+IGOqKpmBNy/tE+ZX7Xi6F0gYoBAnhPcra2hb8ESmmN/fn7y5nJJDvlT39ywCpz2u2t/JI5K X-Received: by 2002:a05:6a20:748d:b0:1a3:69d6:d0f8 with SMTP id p13-20020a056a20748d00b001a369d6d0f8mr8208819pzd.12.1710940744113; Wed, 20 Mar 2024 06:19:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710940744; cv=pass; d=google.com; s=arc-20160816; b=HCEgj3bDbDpsWyTbkmLN7xtrYh26funuOfoBTviGacD5zIUc+UC27xvqB+zy2PRiL8 Mq3Bg5NGlg7Es+pNXKe7DEkt+qSfr6V3f0EASpPD050jiKeFwzSebo6fGcO0gcmdrFoz Y61IOifxsbt/6GNt0Eh7PUab1P/0GQ0kh+rqhO+sn4uWiN3z0gHer5xBSGKeTB0IoXSR ZYyel6C5YZ86OU6AyP6fWyDx3Wu+R5gWy0fJpyBEBRLiK947mQZqQuuEdVaJeFWzuz9O 8Su+fO5guMXWXiJHMvruJm93jjJsSlG+/xM5gYCuvj7yAhDnxbOqdx12C9IBfwP0eEAk jonA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=RUNpdgzqhkxsescD5mhvB4F0uZWIG7XsxVM/4+Kxi2A=; fh=FCR4UmfxQvtnYQIyQVFRwzBXW+h1tOP6L5zMB2Ylht0=; b=KwbpJeByn3WstuYxgUuz5xaj2FJKvn+FNQ4CqBk7eHv7gexWgOuH/2W+CK08KRHOGV XGvKR7nv4S6/1U9hYFVtiElTlu7ffKBeiOwCe9ilZ1EdGhvTFTy2OCGVub9CRaBRvX/9 dLf64XjzL+iWV8EMAVn4V9tTK6uv1ey+ROoOw0KZDo2q2Yofq08F+3Y/3SEUrevfRVAS q8CrRZ4e6g/p0lHC4G9Dc7Cq1FJuZNzrFTV5FnM0I/+GnkT4Hn/KmWvLXpeMfs1XVDwp ekxaYoK00927FHJFWlZCZMgSJkZT/UXiBGZUUdNRmM9gBQQlIdY7GQ5gdq/fdROOm4Mg ZDqA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=FE4nGxSY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-108934-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108934-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h6-20020a170902680600b001e04ce72e28si2785175plk.41.2024.03.20.06.19.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 06:19:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-108934-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=FE4nGxSY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-108934-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108934-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C5FC3281E24 for ; Wed, 20 Mar 2024 13:19:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B334D40C09; Wed, 20 Mar 2024 13:18:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="FE4nGxSY"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="FRfQcawU" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 816E93CF6A; Wed, 20 Mar 2024 13:18:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710940734; cv=none; b=dCfYmnL/1M1mp9hlJyTYh8k+lhVDLxq+1hpUQaziq5dBkF4/eYtMAI8guMND3CnLbI1WW3khy6AoR1H9SA4l7dd2vaIJzR9neaD810CTEzCKJxK/isx20IjgABgMOrT2Sd4DfWytNVvTbrk1E+yLEfGR0///plND4+7ilp0irV4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710940734; c=relaxed/simple; bh=+jpXXIEeaJenKyQ3XK/8Tixii9tnHPTCZ6gd0CUF5zY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=ZdK308K55hAjXCy0b4iNFY2eprW/64i+pRPX/aMqmleGDVkeDTraAo99SxAQjXfNep7eWEujybGXdzGImKpZkK+qREvBpdTPA5vRtuWY03FZZb+ljFTJu/ukI//JiLOboKFPjsdEfGp3h1KZU/zO9LCPHQEmrzM1+vwIyfgNjwQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=FE4nGxSY; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=FRfQcawU; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1710940731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RUNpdgzqhkxsescD5mhvB4F0uZWIG7XsxVM/4+Kxi2A=; b=FE4nGxSYwpRBStfHyUjT+4PiPihErxEaVjuhOlRr/HKxEfC0IqmYETFdRFVAr81EQ/4v6n UJinrGfXFjMDVE4EFTw12v7JHcIMOlWGygjWMjD0SSgP+UTDTNEciAjagvALM9YUS17HyE kctfz8bgptLH2HY6/yJOYCIJIsmJ6N1FNFWedCepcxOdUs9j9XRobEVvg63MP5LB5uqzcS HgphbGcD/CFcoD24VldwsVuoDqVcewSJvnRLbqiBnSG4bYLkNerj+Bs0vR/WYEaa7oSAFC MWik0cEHP7RoSiQgWojMYEDyC/M1l4c9Bq4EcmWxfSHSOINe3G3VVkUEI9IAMg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1710940731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RUNpdgzqhkxsescD5mhvB4F0uZWIG7XsxVM/4+Kxi2A=; b=FRfQcawU0uVk8FY/gWbFxDwCOjjtfLWgpRcIfpq8WZO8zoxBjiqHpqdKLjL2OAcg1IPyDj zY5A6kwkvhepr8Cw== To: Alice Ryhl , Miguel Ojeda , John Stultz , Stephen Boyd Cc: Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Alice Ryhl Subject: Re: [PATCH] rust: time: add Ktime In-Reply-To: <20240320-rust-ktime_ms_delta-v1-1-ccb8672a0941@google.com> References: <20240320-rust-ktime_ms_delta-v1-1-ccb8672a0941@google.com> Date: Wed, 20 Mar 2024 14:18:51 +0100 Message-ID: <87wmpxghxg.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Wed, Mar 20 2024 at 10:08, Alice Ryhl wrote: > +impl Ktime { > + /// Create a `Ktime` from a raw `ktime_t`. > + #[inline] > + pub fn from_raw(inner: bindings::ktime_t) -> Self { > + Self { inner } > + } > + > + /// Get the current time using `CLOCK_MONOTONIC`. > + #[inline] > + pub fn ktime_get() -> Self { > + // SAFETY: It is always safe to call `ktime_get`. That's not entirely correct. ktime_get() cannot be safely invoked from NMI context. That won't matter for driver writers obviously. Looks sensible otherwise. Thanks, tglx