From patchwork Fri Apr 29 16:39:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 8984041 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B74A99F1D3 for ; Fri, 29 Apr 2016 16:41:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CE2EC201FA for ; Fri, 29 Apr 2016 16:41:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D920B201DD for ; Fri, 29 Apr 2016 16:41:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752886AbcD2QlR (ORCPT ); Fri, 29 Apr 2016 12:41:17 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36679 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752746AbcD2Qk7 (ORCPT ); Fri, 29 Apr 2016 12:40:59 -0400 Received: by mail-pf0-f196.google.com with SMTP id p185so15126780pfb.3; Fri, 29 Apr 2016 09:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RhOv46eCZaDdf6m2gl43uDQcTliDB0jWoeqd+1fnu9o=; b=ZiJEU7TeSNr/7+C8AIt073GFQb+G7Sv/9/7Klldp6oyEn2/uP/WKKo2u423A+RKLq4 Cp1HrCofYvVeE70CQ7ad91/LV0RkNe0wRCbLxg4Uh7vg6Ec2Xq5ffZB14GsEzm9Z37yV z/T/F83HheCtCY7L6mwF0v8RH8lDnIFzQG6Cn0NJRwG16kM+D5m/KbtVkNQrG05FIVJH hcfbUjLbTSDHwd5JzKzk82VhZIbuPJRRTTrxRnLsFeR0Bg2uuZwWrfzoJbBlk5VBq9nv TsjECT6VyYJCdPCyA2Plxz3L8jIuyy/xI4Jyhj9/KMFOoJHlmEj7LMWtwJLeYe5Dt9DI d9xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RhOv46eCZaDdf6m2gl43uDQcTliDB0jWoeqd+1fnu9o=; b=OByTdo/AT7wv7ZfE1tiOBkv8xCzuNgpwcWRsFJ3InlG+MCwIIQFfJFSiGnNJPdUesv kjrPieNXiZVw7pVT7I//A73DZ01oxjm2YU1Z8IM+IUxKE2Mh1N18XJ5xIZBVuvzQpKsk R2+YJFNmSQ+kt+FFGfl4ysHIrW6BnbLHH7XgXsJhYZVDt13m6AF16CmoY5GMzBJu8MwK TRKlEyD7RjUQjg2HrWZC7GdUYlu1OaYhUt18eOvU6eR8LGMRZ92AYHnTf/HbWRFVBiA/ 52imMmefSSPR2IcyUtY48S94u1w/70wjHTl8WRQkGRvcQkK6P2r+s7yMylIuJEkfgrJj mXeQ== X-Gm-Message-State: AOPr4FVBRXqgwb+qYP2uu7aQ0I4V4nSqUkZEoktzH/gGIyfG3DGMcRROh+BOIEvvGzSy7w== X-Received: by 10.98.86.24 with SMTP id k24mr30552746pfb.87.1461948058740; Fri, 29 Apr 2016 09:40:58 -0700 (PDT) Received: from deepa-ubuntu.hsd1.ca.comcast.net (c-73-252-251-201.hsd1.ca.comcast.net. [73.252.251.201]) by smtp.gmail.com with ESMTPSA id b64sm24666578pfa.48.2016.04.29.09.40.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Apr 2016 09:40:58 -0700 (PDT) From: Deepa Dinamani To: linux-kernel@vger.kernel.org Cc: arnd@arndb.de, y2038@lists.linaro.org, linux-fsdevel@vger.kernel.org, John Stultz , Thomas Gleixner Subject: [PATCH 3/3] time: Remove timespec_add_safe() Date: Fri, 29 Apr 2016 09:39:49 -0700 Message-Id: <1461947989-21926-4-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461947989-21926-1-git-send-email-deepa.kernel@gmail.com> References: <1461947989-21926-1-git-send-email-deepa.kernel@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All references to timespec_add_safe() now use timespec64_add_safe(). The plan is to replace struct timespec references with struct timespec64 throughout the kernel as timespec is not y2038 safe. Drop timespec_add_safe() and use timespec64_add_safe() for all architectures. Signed-off-by: Deepa Dinamani Cc: John Stultz Cc: Thomas Gleixner --- include/linux/time64.h | 15 +++++++-------- kernel/time/time.c | 4 ---- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/include/linux/time64.h b/include/linux/time64.h index 1778937..7e5d2fa 100644 --- a/include/linux/time64.h +++ b/include/linux/time64.h @@ -65,7 +65,6 @@ static inline struct itimerspec64 itimerspec_to_itimerspec64(struct itimerspec * # define timespec64_equal timespec_equal # define timespec64_compare timespec_compare # define set_normalized_timespec64 set_normalized_timespec -# define timespec64_add_safe timespec_add_safe # define timespec64_add timespec_add # define timespec64_sub timespec_sub # define timespec64_valid timespec_valid @@ -134,13 +133,6 @@ static inline int timespec64_compare(const struct timespec64 *lhs, const struct extern void set_normalized_timespec64(struct timespec64 *ts, time64_t sec, s64 nsec); -/* - * timespec64_add_safe assumes both values are positive and checks for - * overflow. It will return TIME64_MAX in case of overflow. - */ -extern struct timespec64 timespec64_add_safe(const struct timespec64 lhs, - const struct timespec64 rhs); - static inline struct timespec64 timespec64_add(struct timespec64 lhs, struct timespec64 rhs) { @@ -222,4 +214,11 @@ static __always_inline void timespec64_add_ns(struct timespec64 *a, u64 ns) #endif +/* + * timespec64_add_safe assumes both values are positive and checks for + * overflow. It will return TIME64_MAX in case of overflow. + */ +extern struct timespec64 timespec64_add_safe(const struct timespec64 lhs, + const struct timespec64 rhs); + #endif /* _LINUX_TIME64_H */ diff --git a/kernel/time/time.c b/kernel/time/time.c index 558f5fe..703306a 100644 --- a/kernel/time/time.c +++ b/kernel/time/time.c @@ -770,8 +770,6 @@ struct timespec timespec_add_safe(const struct timespec lhs, return res; } -#if __BITS_PER_LONG != 64 - /* * Add two timespec64 values and do a safety check for overflow. * It's assumed that both values are valid (>= 0). @@ -792,5 +790,3 @@ struct timespec64 timespec64_add_safe(const struct timespec64 lhs, return res; } - -#endif