From patchwork Wed Dec 4 07:46:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13893318 X-Patchwork-Delegate: kuba@kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 898F718E750 for ; Wed, 4 Dec 2024 07:47:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733298449; cv=none; b=meMT9izunecYXpcPn2VBETbWqvSpKsimhZDMGwMDGUslbGCTC5R/RoG4kiUx/MO2tjyLiRtS7Yc37RZ1dVAqqmbA8HK3faquTPRfVKJ1A/iGUNtOWKrOf79UIt6hgQGk3R1oI0mjjUIbsR0UnUdCyAkxXhMerLfFdZJcHR8sywQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733298449; c=relaxed/simple; bh=xPmCsKpMpyS+IEf8Bve9mFZNuarXhCK8VeBON/LWLlE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sAvIMYbJMoPfl9aw8RniZvoy9qO7ZnSvcr5ccyNGv+EPG52+JcWSwIjbyTnxQsz/znReky5goLC5f3Xu2qK1inul6FCMuBl+HCmd+ySCRn+AfIUVooSOGTToUt5Gg+dj1ToqO4x1CUODmryHDyAjYopZgii64u3hPk0810l+lks= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=RzmjPUNe; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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="RzmjPUNe" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733298446; 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=K9ysnB8wbhWhwEUuu4La2Q5hcuWjOlDcwGDAFBtqHkY=; b=RzmjPUNeag9W4L4PPVm8+tr+Ay57GpMzCBgonO+q6VOBbMN7I9AWmKpwoetx/O7R21OBTb cf79P++Ive8JBLgM6K+tie+6LwQv30a1zH3fGewzwdV8618LFfFgKpXrZpr8z2eBT8tSRb +SrE+tvqcpHKTl+CbC4QrHkXfh5C5p8= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-623-hl0F6zMpMsmkZEde4NIExg-1; Wed, 04 Dec 2024 02:47:23 -0500 X-MC-Unique: hl0F6zMpMsmkZEde4NIExg-1 X-Mimecast-MFC-AGG-ID: hl0F6zMpMsmkZEde4NIExg 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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B12EF1955F3C; Wed, 4 Dec 2024 07:47:21 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.42.28.48]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 542371956048; Wed, 4 Dec 2024 07:47:18 +0000 (UTC) From: David Howells To: netdev@vger.kernel.org Cc: David Howells , Marc Dionne , Yunsheng Lin , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org, Thomas Gleixner Subject: [PATCH net-next v2 01/39] ktime: Add us_to_ktime() Date: Wed, 4 Dec 2024 07:46:29 +0000 Message-ID: <20241204074710.990092-2-dhowells@redhat.com> In-Reply-To: <20241204074710.990092-1-dhowells@redhat.com> References: <20241204074710.990092-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Patchwork-Delegate: kuba@kernel.org Add a us_to_ktime() helper to go with ms_to_ktime() and ns_to_ktime(). Signed-off-by: David Howells cc: Thomas Gleixner cc: Jakub Kicinski cc: Marc Dionne cc: "David S. Miller" cc: Eric Dumazet cc: Paolo Abeni cc: linux-afs@lists.infradead.org cc: netdev@vger.kernel.org --- include/linux/ktime.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 3a4e723eae0f..383ed9985802 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h @@ -222,6 +222,11 @@ static inline ktime_t ns_to_ktime(u64 ns) return ns; } +static inline ktime_t us_to_ktime(u64 us) +{ + return us * NSEC_PER_USEC; +} + static inline ktime_t ms_to_ktime(u64 ms) { return ms * NSEC_PER_MSEC;