From patchwork Wed Jul 16 21:03:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 33764 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6135E20792 for ; Wed, 16 Jul 2014 21:22:19 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id fp1sf9670000pdb.9 for ; Wed, 16 Jul 2014 14:22:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:user-agent:date:from:to :cc:subject:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type :content-disposition; bh=DSnYBeeCchXGlp+wERbZozA0JtcMof2Olva18s9Hdvg=; b=BFBWmdKOywqhf3i/aqASYD2+zZj50jNamKWAeV2hF1eaQPR6p07/eE7k3BIuQRh6+B WgCA3+SFOdIN1vtp/LiPW8lhk+1clvPLux+0Uehw5/DTBs9v7VGgfBXCEfiu7eKRxy/r 1CsSeaMUW3WLuHsVMApZldDx1GXiBxmYHh07BNgn5F+vI/7SrDo7z2LosTVjiy/92QU9 F0E0uOp+7vXpyKEPfVMOebTPl4PEW4lsbnrhEcLAuzpZAF7GEJAvf/PWhOojQ1RUI+F5 lhehIR6upZxiYBFrzGaUUkgwujXujdoaD6W8BkIG3nqcVmaT2omm2xq4j8kxSYeb2bdP GXtA== X-Gm-Message-State: ALoCoQmzPTSsLkDieo7jBN64zj/dwLiH2X08spnI6TI12UoZl7SrIvHEeuh/p/xPAZikRt6dFaV4 X-Received: by 10.66.144.228 with SMTP id sp4mr16045758pab.5.1405545738343; Wed, 16 Jul 2014 14:22:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.23.210 with SMTP id 76ls514253qgp.33.gmail; Wed, 16 Jul 2014 14:22:18 -0700 (PDT) X-Received: by 10.52.171.18 with SMTP id aq18mr10072795vdc.45.1405545738194; Wed, 16 Jul 2014 14:22:18 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id tb9si804079vcb.32.2014.07.16.14.22.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Jul 2014 14:22:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id im17so2932243vcb.17 for ; Wed, 16 Jul 2014 14:22:18 -0700 (PDT) X-Received: by 10.220.118.136 with SMTP id v8mr7989916vcq.50.1405545738123; Wed, 16 Jul 2014 14:22:18 -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.221.37.5 with SMTP id tc5csp330162vcb; Wed, 16 Jul 2014 14:22:17 -0700 (PDT) X-Received: by 10.70.103.45 with SMTP id ft13mr5350663pdb.152.1405545737200; Wed, 16 Jul 2014 14:22:17 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id al7si411107pbd.120.2014.07.16.14.22.16; Wed, 16 Jul 2014 14:22:16 -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 S1754402AbaGPVWL (ORCPT + 26 others); Wed, 16 Jul 2014 17:22:11 -0400 Received: from www.linutronix.de ([62.245.132.108]:59605 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752208AbaGPVD6 (ORCPT ); Wed, 16 Jul 2014 17:03:58 -0400 Received: from localhost ([127.0.0.1] helo=[127.0.1.1]) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1X7WMn-0003zv-47; Wed, 16 Jul 2014 23:03:57 +0200 Message-Id: <20140716205052.671291116@linutronix.de> User-Agent: quilt/0.63-1 Date: Wed, 16 Jul 2014 21:03:56 -0000 From: Thomas Gleixner To: LKML Cc: John Stultz , Peter Zijlstra Subject: [patch V2 06/64] ktime: Change ktime_set() to take 64bit seconds value References: <20140716205018.175419210@linutronix.de> MIME-Version: 1.0 X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1, SHORTCIRCUIT=-0.0001 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: tglx@linutronix.de X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 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: , Content-Disposition: inline; filename=jstultz-tk-696511b.patch From: John Stultz In order to support dates past 2038 on 32bit systems, ktime_set() needs to handle 64bit second values. [ tglx: Removed the BITS_PER_LONG check ] Signed-off-by: John Stultz Signed-off-by: Thomas Gleixner --- include/linux/ktime.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ Index: tip/include/linux/ktime.h =================================================================== --- tip.orig/include/linux/ktime.h +++ tip/include/linux/ktime.h @@ -47,13 +47,12 @@ typedef union ktime ktime_t; /* Kill th * * Return: The ktime_t representation of the value. */ -static inline ktime_t ktime_set(const long secs, const unsigned long nsecs) +static inline ktime_t ktime_set(const s64 secs, const unsigned long nsecs) { -#if (BITS_PER_LONG == 64) if (unlikely(secs >= KTIME_SEC_MAX)) return (ktime_t){ .tv64 = KTIME_MAX }; -#endif - return (ktime_t) { .tv64 = (s64)secs * NSEC_PER_SEC + (s64)nsecs }; + + return (ktime_t) { .tv64 = secs * NSEC_PER_SEC + (s64)nsecs }; } /* Subtract two ktime_t variables. rem = lhs -rhs: */