From patchwork Mon Oct 30 22:29:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 117508 Delivered-To: patches@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3120346qgn; Mon, 30 Oct 2017 15:29:30 -0700 (PDT) X-Received: by 10.99.154.18 with SMTP id o18mr8889597pge.18.1509402569968; Mon, 30 Oct 2017 15:29:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509402569; cv=none; d=google.com; s=arc-20160816; b=t4XXKZ4vrFxspZUAAToKsSAvaaDpJ8r+q64Jw2l5xXxKdoGshM08N2I+zlp4nh4ZV0 Q3VCv1fBCK+piGdo1UV4pT92oVOCmEG6K9MsQYo8q6V8VIUJ8/qfqBrpKmpo9CyE+DUj DNd+LRFZvAEdo7JA+mM7rlr8Aw+4Enxsdz0RdfnL227TLvDS8O6jpBERRyjBS7oT+l4f 9SPqy/Dpla/obV+bXraCDCbOiUHE4E20DbMiTJx+gCviqFN5QaoaBcvsipdRuasV2c0T e15xXUJNyGKQ15yv47D5WIQawGCEYlLxpDT8dfQX6iLG2otDfRnaMg76BCxcYdUqmc2j bfmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=+t5v60/lBsJv/2HCuJrnV4Tg64928uHOpN9NI1hwglk=; b=02Y2hvcjAnKbN/d1EOE18d58nncvvqAwCwneC+Z5EMdAFJhK20jyUdveLU4AWhcNMq hl0h7ug1SzaTZw+lVZqi05FrOS1r50IZ37Wy7sL1gkL+AEd5lQmvdz5Dz5oZeWATl54m cOTK/R31etSlfxaOKYLD8JgVTnGV8pICTDNAIqtgC71mkVqscuuxTqEB6h7iGoQXQpWd JsO8hD5PnDokyQbJi9RRt8w/J7vKoWQpG/rLVXqwi4vEqLWzouKKKC528o8f0+Es8sIl 9ZsCfUe6vTBrNgOrtUwH1/JmzgSJ/ErmZlxwd0iGkdECh53+lzKsAQyjTCOBjsLJqY4u X1Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d8m/zjwm; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id u9sor2419pfh.13.2017.10.30.15.29.29 for (Google Transport Security); Mon, 30 Oct 2017 15:29:29 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d8m/zjwm; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+t5v60/lBsJv/2HCuJrnV4Tg64928uHOpN9NI1hwglk=; b=d8m/zjwmKd0AXAt5gjkstMOJqINYDidZ1nT1cyuiX7vVsTfZBeuCKBR7lxXSuhD44L u5z1rWeWQ11HUo/xZSHvS4tpd9RcmwEd4lluASKMdIN1cyeHR/090X+Y/8apTskSk1YB ygQP1qD6d616dryAa6LbkDIT1Ula1YyV7mjfI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+t5v60/lBsJv/2HCuJrnV4Tg64928uHOpN9NI1hwglk=; b=Se3e7hd9Hof/lQqRJZ3v5fhbK7tvJwvy5aNikZekGt4c3EB4KZagOZQ4r5+1ACIk1q MWW1ZOoHZhZg1r1UgUyAmpCUd+1CcGaBnxLIIj4DSI9owHHvB3C6RVaoQGZXRg8YlGg6 zoXaOUD+heVYcI1Rx4ebcKftzMNVVqxnLk8Bvu2h7X6xGlQ83ivcbL9kCUkOiBmHYZv3 ujuY1G7G71AfHMKMPy36bK0mFBZ8Ax3iepVaiKoR4OGhgFKf9PTCvW30d4Ot+jTn6fcF Xt5n569ZR1H06E6SOAUNX87jPzugR4Y40+6R5vSAWcPc2G5FUQxgpQ7taYQlSnmlIV91 UlsQ== X-Gm-Message-State: AMCzsaV0YlJy7S0b6MpuKoX/XO7zOQFgBf1z9GL03Q8/ri+lcUxRHeIL J3Vu4/cFflJqEMng8kx3OCdcAdzZ X-Google-Smtp-Source: ABhQp+Ry94OHDzP7JiWRasuFfGQ8VzwjplB6yjkj1jlGb0ZrUmOb3YpM8kS7TV3kNU3o173UKQ2H4g== X-Received: by 10.98.148.9 with SMTP id m9mr10026751pfe.111.1509402569575; Mon, 30 Oct 2017 15:29:29 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id g13sm27479320pfm.130.2017.10.30.15.29.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 30 Oct 2017 15:29:28 -0700 (PDT) From: John Stultz To: lkml Cc: Arnd Bergmann , Thomas Gleixner , Ingo Molnar , Miroslav Lichvar , Richard Cochran , Prarit Bhargava , Stephen Boyd , John Stultz Subject: [PATCH 4/7] time: Remove unused functions Date: Mon, 30 Oct 2017 15:29:11 -0700 Message-Id: <1509402554-18437-5-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509402554-18437-1-git-send-email-john.stultz@linaro.org> References: <1509402554-18437-1-git-send-email-john.stultz@linaro.org> From: Arnd Bergmann 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. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Miroslav Lichvar Cc: Richard Cochran Cc: Prarit Bhargava Cc: Stephen Boyd Signed-off-by: Arnd Bergmann Signed-off-by: John Stultz --- include/linux/time.h | 18 ------------------ include/linux/time64.h | 28 ---------------------------- kernel/time/time.c | 18 ------------------ 3 files changed, 64 deletions(-) -- 2.7.4 diff --git a/include/linux/time.h b/include/linux/time.h index c0fbad0..0e8a809 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 980c71b..402b595c7 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 04684e2..947fb61 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.