From patchwork Wed Jan 7 20:51:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 42854 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 51AFF20558 for ; Wed, 7 Jan 2015 20:52:13 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id b13sf1052414wgh.5 for ; Wed, 07 Jan 2015 12:52:12 -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=a/Ln28F9MO2SDmeAROF+YNUbmDwSaNf6QA797Hi7aVA=; b=RnFpA7VP84OiqGxdDyQXNAv7/VBlT05xmlKSkwum0bW4LYe1WBXGgafYvBJdDoTln0 jxE4IA5ozRlBW/AZ7uYH4DsrjqGjlo1jnXVF3HXT8d9B9X/VZWRTn8emG9wEmkC1JFPC HLS9QYZYLFwHGEn8w0keRnvGS795V4WJd1Uhry+yC0pWFvm9iSx5YkY946bRWTg23epY Z2O6z+/jXABveeOqvlwDuC6SAXA8bb5Ikt+ohNEEjml6cCLFDJ31BFXW8eTgN1kxTXvp MffvmZLYhh0JBujZA330+sDqN3Ndf99VIVT+5hvwl3fZ7/BXV6sEY2S1nKV7GjwoIF1d QDIA== X-Gm-Message-State: ALoCoQlx/cN8N+UmXa8O1Gb7bgjdijS3p4DvOUPDg51kzol94lSthRRsNBxe09f+M9jAWZaJrPNJ X-Received: by 10.180.189.116 with SMTP id gh20mr777219wic.2.1420663932546; Wed, 07 Jan 2015 12:52:12 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.130 with SMTP id b2ls194927laa.27.gmail; Wed, 07 Jan 2015 12:52:12 -0800 (PST) X-Received: by 10.152.23.38 with SMTP id j6mr8182578laf.81.1420663932028; Wed, 07 Jan 2015 12:52:12 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id z6si4998456laj.17.2015.01.07.12.52.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 Jan 2015 12:52:10 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id gq15so5831330lab.4 for ; Wed, 07 Jan 2015 12:52:10 -0800 (PST) X-Received: by 10.152.8.11 with SMTP id n11mr7062005laa.38.1420663930508; Wed, 07 Jan 2015 12:52:10 -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 c8csp59463lbb; Wed, 7 Jan 2015 12:52:09 -0800 (PST) X-Received: by 10.66.178.198 with SMTP id da6mr8862086pac.126.1420663927899; Wed, 07 Jan 2015 12:52:07 -0800 (PST) Received: from mail-pd0-f180.google.com (mail-pd0-f180.google.com. [209.85.192.180]) by mx.google.com with ESMTPS id bh17si5054589pdb.105.2015.01.07.12.52.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 Jan 2015 12:52:07 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.192.180 as permitted sender) client-ip=209.85.192.180; Received: by mail-pd0-f180.google.com with SMTP id fl12so6808728pdb.11 for ; Wed, 07 Jan 2015 12:52:07 -0800 (PST) X-Received: by 10.70.43.37 with SMTP id t5mr8621186pdl.139.1420663926889; Wed, 07 Jan 2015 12:52:06 -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 ts5sm2560319pbc.88.2015.01.07.12.52.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Jan 2015 12:52:05 -0800 (PST) From: John Stultz To: lkml Cc: John Stultz , Corey Minyard , openipmi-developer@lists.sourceforge.net, Arnd Bergmann Subject: [PATCH 2/2][RFC] ipmi: Update timespec usage to timespec64 Date: Wed, 7 Jan 2015 12:51:50 -0800 Message-Id: <1420663910-6406-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1420663910-6406-1-git-send-email-john.stultz@linaro.org> References: <1420663910-6406-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.45 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 --- 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 cc3a07d..814ba98 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); + do_getnstimeofday64(&t); + pr_debug("**%s: %lld.%9.9d\n", msg, (long long) t.tv_sec, t.tv_usec); } #else #define debug_timestamp(x) @@ -988,18 +988,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; @@ -1008,12 +1008,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; } @@ -1036,7 +1037,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);