From patchwork Mon May 11 11:10:48 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: 48237 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E50FD21550 for ; Mon, 11 May 2015 11:11:15 +0000 (UTC) Received: by wizk4 with SMTP id k4sf24883411wiz.2 for ; Mon, 11 May 2015 04:11:15 -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=GXv6grhBUVP1nh1/fi/yorigagklEQ3DM39OmzPhGRzTm7Gkxe0RZ4PbSAj4UNChWU FO31GFxu2HRj6/eM+4+V2A6c0ODQQTRgBAmmnA+Khy/ObD/fDjS4kR1vtbNqyWwc4fTj NCSMqj7St/tIT5Zzo+TLeghvnBUuEUkY+t8IQwaNFmP0zeKo4TekcpmPb9ezyajpnBlc YtV61ASyMzo9HWgnjkV6RCukIFFtUxbYQgg0J3SQveoT05vaKN+rhFthGl9PDIdw7u6S zAoSqBBJG5y4qlUBLfrV4fDUld/Zif66zK5K+QiTRFQqsFJF8h3ql7k7B1MTEXqjo1ib gD0A== X-Gm-Message-State: ALoCoQncFpZTMhb4WOg3StA+szbHFWi5/31XqI2zqKgZZySaOohq3NA4d+WNwzTXjr/BB3eLC/gU X-Received: by 10.194.189.110 with SMTP id gh14mr720209wjc.3.1431342675287; Mon, 11 May 2015 04:11:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.178.195 with SMTP id da3ls621364lac.43.gmail; Mon, 11 May 2015 04:11:15 -0700 (PDT) X-Received: by 10.112.77.234 with SMTP id v10mr7564593lbw.119.1431342675089; Mon, 11 May 2015 04:11:15 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id l4si8160019lag.119.2015.05.11.04.11.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 04:11:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by labbd9 with SMTP id bd9so90646808lab.2 for ; Mon, 11 May 2015 04:11:15 -0700 (PDT) X-Received: by 10.112.13.6 with SMTP id d6mr7529613lbc.117.1431342674957; Mon, 11 May 2015 04:11:14 -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.108.230 with SMTP id hn6csp1440672lbb; Mon, 11 May 2015 04:11:13 -0700 (PDT) X-Received: by 10.68.246.38 with SMTP id xt6mr18065460pbc.20.1431342673058; Mon, 11 May 2015 04:11:13 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g16si17525997pdl.216.2015.05.11.04.11.11; Mon, 11 May 2015 04:11:13 -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 S1753736AbbEKLLH (ORCPT + 28 others); Mon, 11 May 2015 07:11:07 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:36740 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753296AbbEKLLG (ORCPT ); Mon, 11 May 2015 07:11:06 -0400 Received: by pdea3 with SMTP id a3so145611274pde.3 for ; Mon, 11 May 2015 04:11:05 -0700 (PDT) X-Received: by 10.70.25.37 with SMTP id z5mr18354584pdf.36.1431342665597; Mon, 11 May 2015 04:11:05 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by mx.google.com with ESMTPSA id af1sm12850094pad.34.2015.05.11.04.11.02 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 May 2015 04:11:04 -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 v3 01/22] linux/time64.h:Introduce the 'struct itimerspec64' for 64bit Date: Mon, 11 May 2015 19:10:48 +0800 Message-Id: <1431342648-29404-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.215.51 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) {