From patchwork Thu Oct 19 11:14:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 116362 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp365822qgn; Thu, 19 Oct 2017 04:15:21 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RiGLfAhBxEvtuAb0ImAe3J6yafonY/k2OQs6Ynd9rTV/WqJh4Bt/2Hh7gW7JHOef6UYsIH X-Received: by 10.98.36.135 with SMTP id k7mr1175680pfk.63.1508411721276; Thu, 19 Oct 2017 04:15:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508411721; cv=none; d=google.com; s=arc-20160816; b=z4o8bQbKcUW1MIjNCvWl9TpKSEO63VIBV2z+ISHkTyMo6xRvhuVuPb4a1O7uN3mn3H LPDQJUES8M7bjA3Db5fqn+o+J/eNFTzrtnSksrPR02AsWyRfKUk+yMqLWpKuVT1JgSsw CE+R/l+hS0rvJmrAHWcGoi9Nd0rMm5p7molgU3Mssp/I2k27gJoEM44/tLHwsuEcpkP1 zPcaXkfdPD/6YGMb01zFlK7oJw3BoNWcMrARsgkv308uRuKjfU5ZZ2a5oEbq0+iTyNSg f0qapaHDJUs5K41Q92GwWGR9ms8qjVvsSJ0VZzuZPI7W2exmd+2YImA8zmgrp9SFQ+HV S4rw== 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:arc-authentication-results; bh=AsSy0Xygrvna68+Inq63g9D34WXdFS21hJWzi610Rv8=; b=XcGd/dF/MFZywACMXVmDRErNxdB+HQlJs0dORa50NnAgSl4+l3m6SAQeICAERrrJG5 uf6bMILETHqkwdx6simevyN4EjniR1h3xCdGoJ7dCuFKK3DUoDynl85i1e7m2LE/1GMT 4VLb7hilyPy3ULuRLPCJlIO/xc0tDFwphjxdu/ZpfUtTsC/XNJcsvRVxdOyXj1eVBPmL qRu+wsw7w905I89r25AkRWg5OrC82pBwgi8+/XHUHt5q2EkrUxgr1Y1rjAbGkp6RGdIO xtAmk4s8Xw/e/SFEuf+FQl1vOJgJ4esiTWWB0aIuDRhZRGCIOIu3WFmicDG4S2fDbqbE fGMQ== 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 m3si2657345pgs.564.2017.10.19.04.15.20; Thu, 19 Oct 2017 04:15:21 -0700 (PDT) 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 S1752785AbdJSLPS (ORCPT + 27 others); Thu, 19 Oct 2017 07:15:18 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:55573 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752462AbdJSLPP (ORCPT ); Thu, 19 Oct 2017 07:15:15 -0400 Received: from wuerfel.lan ([46.223.139.202]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0MYvOV-1dk5YR2z2J-00VkBq; Thu, 19 Oct 2017 13:15:04 +0200 From: Arnd Bergmann To: Thomas Gleixner , y2038@lists.linaro.org Cc: Deepa Dinamani , John Stultz , Stephen Boyd , linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 3/7] time: remove unused functions Date: Thu, 19 Oct 2017 13:14:46 +0200 Message-Id: <20171019111450.3702205-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20171019111450.3702205-1-arnd@arndb.de> References: <20171019111450.3702205-1-arnd@arndb.de> X-Provags-ID: V03:K0:AmvLWk+bOiolk6+Idvd+bwr7w12IAsdVMbDGgwbjTBO4oNCJVaj 8apFE92AHXnJRT6/GxJWCY03nDIfWkZonbCvcbMXs5prNHFEUJuFQH9ytiLcLjPSAZlZW2R 9tGA3RIzxWpnv27b9ELLse1eyeMahIY2E2gKLoD/ydseKlCtKGaDz0Gf/rKAZlUJhF7PoZk USJEQOWAfnq1yVnamSEFg== X-UI-Out-Filterresults: notjunk:1; V01:K0:Gl6I8tFFY8Q=:guvzrRiutNKqFvAVsGT+a+ 4+PChk5dGlOn0p7WRdyoQ1ICWGfq/F2OWITekCn6RcxixL35XBXPzhbQY8afEL/Kwt+3dWKHf n1gjrm6rhNTCof+AB5+RcBB/2PPWc3DPiC0na/pYlCq37jVaP/dfJfx6ODxlXGK1FI601XZK5 pQQVOp5FuHAwqFkO/ZXNTEXCMgbWpycqbl02vMwhrc5idWdre/YEFq0P/DbMMOLD5GsxVHEmi Tt1Lb9JDa6ZBLo5z5NLykUeTnQhfqHJnrPTGE+I61kAjUPKMO1QNyFyaH1WkRF9YGcFT2kUBT 9zQq9BNmvjffe3J2pQXAYFUZOcR3X7MR73iawMLVtmEnvGs9IWTCpMyP8sWU0M2HdFeKA9OkB rQaixVD8Ga7WacKMxgmNCdmPjDcvgr7NoxWLDtb5aL0eGt01fWa7ddvAnQqEVhf+y4LpGfOvX jxUBTFY9rDKQLo7EtjRNT43AMwaCZufpGdhhic6qr9B4UrNCZbTWhR06ggewOKne2FfDA6gp+ w9jDLykILOtVAi3gwSGa43WQwlwabs4ijVAA/dRtIGnzBqUWEBR2vfbot6P7EoNVQ6fp1QHlg DHPibDpztZeIJ8et70mY77xiBqNk2WBh1EMV6f+evQRyunR6MyRhxs49SZs1qwaauNXYXKrra 3oEKiWlFhU6XiBaiCrgnyIERzTpg9vTARVZ8OfXS8806NrjWM6zT0UfvMcyQ8x5t5goqqqUJZ u9Cgwgk4tzRFv7wvqmicwZuXCGGVgUF0UVJh0g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The (slow but) ongoing work on conversion from timespec to timespec64 has led some timespec based helper functions to become unused. No new code should use them, so we can remove the functions entirely. I'm planning to obsolete additional interfaces next and remove more of these. Signed-off-by: Arnd Bergmann --- include/linux/time.h | 18 ------------------ include/linux/time64.h | 28 ---------------------------- kernel/time/time.c | 18 ------------------ 3 files changed, 64 deletions(-) -- 2.9.0 diff --git a/include/linux/time.h b/include/linux/time.h index c0fbad08448f..0e8a80918484 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -39,15 +39,6 @@ static inline int timespec_compare(const struct timespec *lhs, const struct time return lhs->tv_nsec - rhs->tv_nsec; } -static inline int timeval_compare(const struct timeval *lhs, const struct timeval *rhs) -{ - if (lhs->tv_sec < rhs->tv_sec) - return -1; - if (lhs->tv_sec > rhs->tv_sec) - return 1; - return lhs->tv_usec - rhs->tv_usec; -} - extern time64_t mktime64(const unsigned int year, const unsigned int mon, const unsigned int day, const unsigned int hour, const unsigned int min, const unsigned int sec); @@ -65,15 +56,6 @@ static inline unsigned long mktime(const unsigned int year, extern void set_normalized_timespec(struct timespec *ts, time_t sec, s64 nsec); -/* - * timespec_add_safe assumes both values are positive and checks - * for overflow. It will return TIME_T_MAX if the reutrn would be - * smaller then either of the arguments. - */ -extern struct timespec timespec_add_safe(const struct timespec lhs, - const struct timespec rhs); - - static inline struct timespec timespec_add(struct timespec lhs, struct timespec rhs) { diff --git a/include/linux/time64.h b/include/linux/time64.h index 980c71b3001a..402b595c76d2 100644 --- a/include/linux/time64.h +++ b/include/linux/time64.h @@ -53,16 +53,6 @@ static inline struct timespec64 timespec_to_timespec64(const struct timespec ts) return ts; } -static inline struct itimerspec itimerspec64_to_itimerspec(struct itimerspec64 *its64) -{ - return *its64; -} - -static inline struct itimerspec64 itimerspec_to_itimerspec64(struct itimerspec *its) -{ - return *its; -} - # define timespec64_equal timespec_equal # define timespec64_compare timespec_compare # define set_normalized_timespec64 set_normalized_timespec @@ -94,24 +84,6 @@ static inline struct timespec64 timespec_to_timespec64(const struct timespec ts) return ret; } -static inline struct itimerspec itimerspec64_to_itimerspec(struct itimerspec64 *its64) -{ - struct itimerspec ret; - - ret.it_interval = timespec64_to_timespec(its64->it_interval); - ret.it_value = timespec64_to_timespec(its64->it_value); - return ret; -} - -static inline struct itimerspec64 itimerspec_to_itimerspec64(struct itimerspec *its) -{ - struct itimerspec64 ret; - - ret.it_interval = timespec_to_timespec64(its->it_interval); - ret.it_value = timespec_to_timespec64(its->it_value); - return ret; -} - static inline int timespec64_equal(const struct timespec64 *a, const struct timespec64 *b) { diff --git a/kernel/time/time.c b/kernel/time/time.c index 04684e294f00..947fb614c78f 100644 --- a/kernel/time/time.c +++ b/kernel/time/time.c @@ -819,24 +819,6 @@ unsigned long nsecs_to_jiffies(u64 n) EXPORT_SYMBOL_GPL(nsecs_to_jiffies); /* - * Add two timespec values and do a safety check for overflow. - * It's assumed that both values are valid (>= 0) - */ -struct timespec timespec_add_safe(const struct timespec lhs, - const struct timespec rhs) -{ - struct timespec res; - - set_normalized_timespec(&res, lhs.tv_sec + rhs.tv_sec, - lhs.tv_nsec + rhs.tv_nsec); - - if (res.tv_sec < lhs.tv_sec || res.tv_sec < rhs.tv_sec) - res.tv_sec = TIME_T_MAX; - - return res; -} - -/* * Add two timespec64 values and do a safety check for overflow. * It's assumed that both values are valid (>= 0). * And, each timespec64 is in normalized form.