From patchwork Thu Apr 30 08:09:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 47760 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 100E62121F for ; Thu, 30 Apr 2015 08:09:54 +0000 (UTC) Received: by lbbqq2 with SMTP id qq2sf12446131lbb.0 for ; Thu, 30 Apr 2015 01:09:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=GWQipT+6+sM33IXMUY6DEELjar+s4v7pNha7H9aqvUM=; b=IWqTbMTnXQ/QyjJiexYDD489k6HSVhH5+TQJZpWHtiF/hsWxkOAdHtDIe8TMDZYsuR MttsLvzyYts1Qp4OV3STwd/jND0lX20ArH/RuYAeADzZv+n95ECjNNyZVvWlcE7QapGv PbA8i/l3S35byTaXIg1pQnpEf9EXHK7SYqkvScOSFws7XeQjzXLFLGVG9N5qgrMHUu/v 7kEZDx/SvGQw/uwHSviQLXoGkrjYWCgUvhQ3LPlavKEBjk8Yc44FCbCqFDAhrtQgFMOY BjEStaCYTVlYWw5fhD13wQieWnUgoCh8EAQNlY76uDtS91DxHYF8tkV6xs79b5OcaZBH WQpw== X-Gm-Message-State: ALoCoQnRkj2QQ9ohFlasluOYQkcvDGa9NeFXUDC5gCdQc26GcldxNpPbHiGE9zvzTaGe7Ud17kYS X-Received: by 10.112.46.172 with SMTP id w12mr1879113lbm.18.1430381392209; Thu, 30 Apr 2015 01:09:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.103 with SMTP id kx7ls343954lac.62.gmail; Thu, 30 Apr 2015 01:09:51 -0700 (PDT) X-Received: by 10.152.37.65 with SMTP id w1mr2643471laj.111.1430381391874; Thu, 30 Apr 2015 01:09:51 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id u8si1206682laz.27.2015.04.30.01.09.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Apr 2015 01:09:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbbqq2 with SMTP id qq2so38457736lbb.3 for ; Thu, 30 Apr 2015 01:09:51 -0700 (PDT) X-Received: by 10.152.2.227 with SMTP id 3mr2664505lax.73.1430381391628; Thu, 30 Apr 2015 01:09:51 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp2963593lbt; Thu, 30 Apr 2015 01:09:50 -0700 (PDT) X-Received: by 10.67.30.65 with SMTP id kc1mr5813209pad.91.1430381389462; Thu, 30 Apr 2015 01:09:49 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pc6si2344196pbb.209.2015.04.30.01.09.48; Thu, 30 Apr 2015 01:09:49 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751167AbbD3IJm (ORCPT + 28 others); Thu, 30 Apr 2015 04:09:42 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:35618 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750768AbbD3IJb (ORCPT ); Thu, 30 Apr 2015 04:09:31 -0400 Received: by pdbqd1 with SMTP id qd1so53470398pdb.2 for ; Thu, 30 Apr 2015 01:09:31 -0700 (PDT) X-Received: by 10.70.93.69 with SMTP id cs5mr5838829pdb.165.1430381370991; Thu, 30 Apr 2015 01:09:30 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([114.30.40.58]) by mx.google.com with ESMTPSA id ms7sm1373617pdb.11.2015.04.30.01.09.27 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Apr 2015 01:09:29 -0700 (PDT) From: Baolin Wang To: tglx@linutronix.de Cc: arnd@arndb.de, john.stultz@linaro.org, linux-kernel@vger.kernel.org, baolin.wang@linaro.org, y2038@lists.linaro.org Subject: [PATCH v2 01/15] linux/time64.h:Introduce the 'struct itimerspec64' for 64bit Date: Thu, 30 Apr 2015 16:09:08 +0800 Message-Id: <1430381348-26230-1-git-send-email-baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: baolin.wang@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch introduces the 'struct itimerspec64' for 64bit to replace itimerspec, and also introduces the conversion methods: itimerspec64_to_itimerspec() and itimerspec_to_itimerspec64(), that makes itimerspec ready for 2038 year. Signed-off-by: Baolin Wang --- include/linux/time64.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/include/linux/time64.h b/include/linux/time64.h index a383147..61dc4cb 100644 --- a/include/linux/time64.h +++ b/include/linux/time64.h @@ -11,11 +11,18 @@ typedef __s64 time64_t; */ #if __BITS_PER_LONG == 64 # define timespec64 timespec +#define itimerspec64 itimerspec #else struct timespec64 { time64_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; + +struct itimerspec64 { + struct timespec64 it_interval; /* timer period */ + struct timespec64 it_value; /* timer expiration */ +}; + #endif /* Parameters used to convert the timespec values: */ @@ -43,6 +50,16 @@ 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 @@ -75,6 +92,24 @@ 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) {