From patchwork Fri Dec 7 13:48:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 153160 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp522316ljp; Fri, 7 Dec 2018 05:50:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/XNkWgZs3UuAFHDMzB241XE7lRAGNsVCHtAmhHiMoR96ez28q4KxuftnMkQ8fWKwr2pdj05 X-Received: by 2002:a63:e348:: with SMTP id o8mr2000752pgj.158.1544190622035; Fri, 07 Dec 2018 05:50:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544190622; cv=none; d=google.com; s=arc-20160816; b=ZOdpSWNaW1q8d5X5iyxcjdU0zDgkHUXMHSkOF6WNYk6DsIT8L0/s8+UZKoojfPD/BE IjPu+j+5llfgj36AxlEQZXymrZvepyxfYFUOu+8bd98Dy2AslD1dlzBxe0oHrBYlE3Ja ufsq5C3U7602r9RBvsFduNzoM/+1FkBijgwWw0xdMa/H3CHTWTZSKkm2/RvoAmvEXw5H EF2ZxuzH4RVNIIQ3KgECKjUJezVnJ3wXRd9qPxj29Tn474x0fbyRJJyWeou924ikp6E4 riZoCmHC8NUO5zdmjmT21IIL4JPoxN6X59Jad3sUh/50b2LDWM/41kby68//IqW9tMbl Aabg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=NdbZkoKM0KHtBLh7up/ctbbIkM24ExnsWuorWRjXVlg=; b=p6jBkipaRRfoWxwyDHfZWnEeZ3lkb1A/e/i1/7FDraEn7i7QtP0C5GnickeKQySjZM F2cv/BrwtHov8uVU02Mse2T8VFL0lz2Dys+E192VBOwSt/wbkk2p2/h+EItnyxXSDuAs rd4M4pzbz59C8A9tpsyUoxt4eJgEYNYKW9L/tnh9Fuitsm9dNAZOAGLlANlV/60jbYEy LnrbbhyZOOdjUuLPB+J8cuhSX1/Ytr5bavqrb8cBrGda09ds1ExXO52X+X1H+Ru2jKle xRjR0q7PZGHq94PIGyvkb7Kh+HFCVW9mifgIKHsXAgDJIP/LvR2dzpQZkW8JGwwBA5zG BRSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i90si3026156pli.135.2018.12.07.05.50.21; Fri, 07 Dec 2018 05:50:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726237AbeLGNuT (ORCPT + 31 others); Fri, 7 Dec 2018 08:50:19 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:57529 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726041AbeLGNt0 (ORCPT ); Fri, 7 Dec 2018 08:49:26 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1MD9jV-1geJ3d3Uqf-009BCl; Fri, 07 Dec 2018 14:49:00 +0100 From: Arnd Bergmann To: y2038@lists.linaro.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-sh@vger.kernel.org, Baolin Wang , Andrew Morton , John Stultz , Alexander Viro , Thomas Gleixner , Rich Felker , Yoshinori Sato , Arnd Bergmann Subject: [PATCH 6/8] timekeeping: remove timespec_add/timespec_del Date: Fri, 7 Dec 2018 14:48:22 +0100 Message-Id: <20181207134824.300024-7-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181207134824.300024-1-arnd@arndb.de> References: <20181207134824.300024-1-arnd@arndb.de> X-Provags-ID: V03:K1:n5iXzgH3nz5j9ExoE7qeuRv71WW7HzR6W7USLlnDWkgVtakGuZV ulpq/wbfp699MXOSqTyLpFkgJOmlJr+/311bmNo4Rs7Ov77JnwLxlftbYWaKDpKvWF3JpAM i1vPFM7N5qyXy33KHSkH0qS0MX0z7ZqWIX+Zfj/otckG+fjKDXQ+ufRbvIMQv8lGfkf7gNQ 2BrMmZoZr9cdVlqAo6Q5A== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:NvnXQW6PUSU=:EHXeZBX2RY6J18BcziALTu Vg3NPc6w5qYSOTM5UNR8TNXi6jYQh5ASIupGaqhjkylS/gnpkQrled9WsSDg4W4000gvNbsxl d/HHm42gNV7PeRiQd0edvWA9sE9A8lVLd6aIu6C1850rdIvY6fuKo+y2V6dBp7t1ie36Ie6CS P6Q8aOfNKoFL81No4AVsekuL5MCU1cFv76RC/dziFQgsSoGDem+/oQlyD7W8jU2YxjNNs/jCE HX7KKtV5WCi7OLm91Z7cw9PRoZFQv9i/GCX9AK8OSfzK/3rQx2vIKT4yHky3Mt/hccfLiMFw7 OrOKwPq3MIiPyRrEqO0qLwnTQGKrVHOjaFz003tFE/+IxK8rekpOwcdI1ycMtksnMQ1o33kQY z+ZgELeoOHTCFxp2Gew6kWQ/1MwMWPf2/22mcxLMJYeGcMS2JiOVKvqidjKEARaPfmAEY6CxJ 8EakQk0w5xz/851VDJ1TrCWNC7h19V/7g6sd7uRXsgy+QjB2TbMqqUlLr9zCNzIyHSgg+/xSr AbrtJ3Sewkaj1BmC6BTqzDduU80dNKnbA79AGmSylltyYEI2kcPRY4o3RFKjStUUHSfsDuVES EJys4wmfMdyNDJsttXtKqSb9X93CT426rdJs5QOhjUTW8dVMOHrSToV/WVRdbYG8qIPln5JMm MK5DLI4tqqricrQwL0DsiNaIDYJbPc81ldhY7MFLzOLbt/ETLCk/iJ/p+WDXV1s+FW1NyXl48 s2Qw5bmsr3cNWhJcg0yr/Y+1CG6xpkXOIsHDjw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The last users were removed a while ago since everyone moved to ktime_t, so we can remove the two unused interfaces for old timespec structures. With those two gone, set_normalized_timespec() is also unused, so remove that as well. Signed-off-by: Arnd Bergmann --- include/linux/time32.h | 25 ------------------------- kernel/time/time.c | 36 ------------------------------------ 2 files changed, 61 deletions(-) -- 2.18.0 Acked-by: John Stultz diff --git a/include/linux/time32.h b/include/linux/time32.h index 61904a6c098f..118b9977080c 100644 --- a/include/linux/time32.h +++ b/include/linux/time32.h @@ -96,31 +96,6 @@ static inline int timespec_compare(const struct timespec *lhs, const struct time return lhs->tv_nsec - rhs->tv_nsec; } -extern void set_normalized_timespec(struct timespec *ts, time_t sec, s64 nsec); - -static inline struct timespec timespec_add(struct timespec lhs, - struct timespec rhs) -{ - struct timespec ts_delta; - - set_normalized_timespec(&ts_delta, lhs.tv_sec + rhs.tv_sec, - lhs.tv_nsec + rhs.tv_nsec); - return ts_delta; -} - -/* - * sub = lhs - rhs, in normalized form - */ -static inline struct timespec timespec_sub(struct timespec lhs, - struct timespec rhs) -{ - struct timespec ts_delta; - - set_normalized_timespec(&ts_delta, lhs.tv_sec - rhs.tv_sec, - lhs.tv_nsec - rhs.tv_nsec); - return ts_delta; -} - /* * Returns true if the timespec is norm, false if denorm: */ diff --git a/kernel/time/time.c b/kernel/time/time.c index ad204cf6d001..532bb560252d 100644 --- a/kernel/time/time.c +++ b/kernel/time/time.c @@ -386,42 +386,6 @@ time64_t mktime64(const unsigned int year0, const unsigned int mon0, } EXPORT_SYMBOL(mktime64); -/** - * set_normalized_timespec - set timespec sec and nsec parts and normalize - * - * @ts: pointer to timespec variable to be set - * @sec: seconds to set - * @nsec: nanoseconds to set - * - * Set seconds and nanoseconds field of a timespec variable and - * normalize to the timespec storage format - * - * Note: The tv_nsec part is always in the range of - * 0 <= tv_nsec < NSEC_PER_SEC - * For negative values only the tv_sec field is negative ! - */ -void set_normalized_timespec(struct timespec *ts, time_t sec, s64 nsec) -{ - while (nsec >= NSEC_PER_SEC) { - /* - * The following asm() prevents the compiler from - * optimising this loop into a modulo operation. See - * also __iter_div_u64_rem() in include/linux/time.h - */ - asm("" : "+rm"(nsec)); - nsec -= NSEC_PER_SEC; - ++sec; - } - while (nsec < 0) { - asm("" : "+rm"(nsec)); - nsec += NSEC_PER_SEC; - --sec; - } - ts->tv_sec = sec; - ts->tv_nsec = nsec; -} -EXPORT_SYMBOL(set_normalized_timespec); - /** * ns_to_timespec - Convert nanoseconds to timespec * @nsec: the nanoseconds value to be converted