From patchwork Wed Jan 7 22:24:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 42858 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 55ADD2055F for ; Wed, 7 Jan 2015 22:24:48 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gq15sf3307870lab.3 for ; Wed, 07 Jan 2015 14:24:47 -0800 (PST) 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:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=xAFy6MX7PccI8lBMreXPphpRgowEXFoYiyr/qzVhDgM=; b=AK9Z4HoTGQ0ycHPW1q2ij0sa6w8ClObLkWxOO7Qs9NaAcRMDu/UJj9zuiz2soMpy/n 5hYIHhw79d3aFmz+srGMWKaC5YTd0UmykX/eolK/QcU8QVCI4liTlCL++K31/GyYPW3S OP9redpXmDQCFbv4IkF3cNltwMoch0dmXiJQQxgHWS6RaoorLpiIWyYWbDMGfQugBbfQ oAB4rTP/W/uVds2V/MwLcYQuSwAr914hpGtdq6QemSPnV0G7YFrqHa4XNuZs4sAY9m9a QFVH5kEKA5RZnSb+IY8LeIyMT6HYN3ANOkOTN3veL7fT0SSYN/aBNAuXhyjNRs8Erlan 9YaA== X-Gm-Message-State: ALoCoQlhyXZfe0XDTqPKsdHZAzbJKPczJPO5rWVz2cBgm4GZ3mBCxkkFxzQsF/QtrSQJki39hGVh X-Received: by 10.152.26.39 with SMTP id i7mr760477lag.1.1420669487132; Wed, 07 Jan 2015 14:24:47 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.203.162 with SMTP id kr2ls218219lac.36.gmail; Wed, 07 Jan 2015 14:24:47 -0800 (PST) X-Received: by 10.152.204.9 with SMTP id ku9mr8801855lac.55.1420669486985; Wed, 07 Jan 2015 14:24:46 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id i8si5276375lbc.106.2015.01.07.14.24.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 Jan 2015 14:24:46 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by mail-la0-f50.google.com with SMTP id pn19so6262625lab.9 for ; Wed, 07 Jan 2015 14:24:46 -0800 (PST) X-Received: by 10.152.7.229 with SMTP id m5mr8921684laa.80.1420669486561; Wed, 07 Jan 2015 14:24:46 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.9.200 with SMTP id c8csp80470lbb; Wed, 7 Jan 2015 14:24:45 -0800 (PST) X-Received: by 10.70.33.228 with SMTP id u4mr9588531pdi.146.1420669484662; Wed, 07 Jan 2015 14:24:44 -0800 (PST) Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com. [209.85.220.41]) by mx.google.com with ESMTPS id fk13si5342755pdb.144.2015.01.07.14.24.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 Jan 2015 14:24:44 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Received: by mail-pa0-f41.google.com with SMTP id rd3so7636881pab.0 for ; Wed, 07 Jan 2015 14:24:43 -0800 (PST) X-Received: by 10.70.118.168 with SMTP id kn8mr9244074pdb.133.1420669483737; Wed, 07 Jan 2015 14:24:43 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id gm8sm2683866pbc.25.2015.01.07.14.24.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Jan 2015 14:24:43 -0800 (PST) From: John Stultz To: lkml Cc: John Stultz , Corey Minyard , openipmi-developer@lists.sourceforge.net, Arnd Bergmann Subject: [PATCH v2 2/2] ipmi: Update timespec usage to timespec64 Date: Wed, 7 Jan 2015 14:24:29 -0800 Message-Id: <1420669469-3218-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1420669469-3218-1-git-send-email-john.stultz@linaro.org> References: <1420663910-6406-1-git-send-email-john.stultz@linaro.org> <1420669469-3218-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@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.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , As part of the internal y2038 cleanup, this patch removes timespec usage in the ipmi driver, replacing it timespec64 Cc: Corey Minyard Cc: openipmi-developer@lists.sourceforge.net Cc: Arnd Bergmann Signed-off-by: John Stultz --- v2: Include build fixes I mistakenly left out of v1 drivers/char/ipmi/ipmi_si_intf.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index e54c02b..9db736a 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -324,10 +324,10 @@ static void cleanup_ipmi_si(void); #ifdef DEBUG_TIMING void debug_timestamp(char *msg) { - struct timeval t; + struct timespec64 t; - do_gettimeofday(&t); - pr_debug("**%s: %d.%9.9d\n", msg, t.tv_sec, t.tv_usec); + getnstimeofday64(&t); + pr_debug("**%s: %lld.%9.9ld\n", msg, (long long) t.tv_sec, t.tv_nsec); } #else #define debug_timestamp(x) @@ -985,18 +985,18 @@ static void set_run_to_completion(void *send_info, bool i_run_to_completion) * we are spinning in kipmid looking for something and not delaying * between checks */ -static inline void ipmi_si_set_not_busy(struct timespec *ts) +static inline void ipmi_si_set_not_busy(struct timespec64 *ts) { ts->tv_nsec = -1; } -static inline int ipmi_si_is_busy(struct timespec *ts) +static inline int ipmi_si_is_busy(struct timespec64 *ts) { return ts->tv_nsec != -1; } static inline int ipmi_thread_busy_wait(enum si_sm_result smi_result, const struct smi_info *smi_info, - struct timespec *busy_until) + struct timespec64 *busy_until) { unsigned int max_busy_us = 0; @@ -1005,12 +1005,13 @@ static inline int ipmi_thread_busy_wait(enum si_sm_result smi_result, if (max_busy_us == 0 || smi_result != SI_SM_CALL_WITH_DELAY) ipmi_si_set_not_busy(busy_until); else if (!ipmi_si_is_busy(busy_until)) { - getnstimeofday(busy_until); - timespec_add_ns(busy_until, max_busy_us*NSEC_PER_USEC); + getnstimeofday64(busy_until); + timespec64_add_ns(busy_until, max_busy_us*NSEC_PER_USEC); } else { - struct timespec now; - getnstimeofday(&now); - if (unlikely(timespec_compare(&now, busy_until) > 0)) { + struct timespec64 now; + + getnstimeofday64(&now); + if (unlikely(timespec64_compare(&now, busy_until) > 0)) { ipmi_si_set_not_busy(busy_until); return 0; } @@ -1033,7 +1034,7 @@ static int ipmi_thread(void *data) struct smi_info *smi_info = data; unsigned long flags; enum si_sm_result smi_result; - struct timespec busy_until; + struct timespec64 busy_until; ipmi_si_set_not_busy(&busy_until); set_user_nice(current, MAX_NICE);