From patchwork Thu Mar 12 17:23:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 45738 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2096D214BF for ; Thu, 12 Mar 2015 17:24:03 +0000 (UTC) Received: by lams18 with SMTP id s18sf12902563lam.2 for ; Thu, 12 Mar 2015 10:24:02 -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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=5xrVGXqYBg9HWQuHEUE7pkPywXfDexn/FuqnVXEj018=; b=l60v0ORG/sujA9aODnHytz1qLVfYSNNslYy1kCJq2zbAbySrdPrIIxnIU0390iQWjs uu5xOiPorXSocUaFRKhWDKWa0SnoVsA9zjmC0bDK1GxOjZe0egHB2cr/k34la3n7kJgy lXK+N7UOFxCOQXaVY6wojgRqWrbyEXE7NvG1gcVm8hS6WQ1Q/f0titgKkxm+BAqHDr7f k7VsyPVB+IDoQhlS7K3ARTmm1qwiPYypa53rMS5Zrxz2I+E68OERLO9FcFHTbs8QQ8NK o+zu9c5G4bJMiYAvij3gT3pAcZRdV4MXHxlRO1myPrfkgvGNVrFjV8+XXzITVrqClinv BYkg== X-Gm-Message-State: ALoCoQnMlv3WNSmLRPDa2l6oDH+XVWNYZWI+7XxDOrplnF8nzINTA6OyWYPTbHar0atyOsHyx/lB X-Received: by 10.181.29.66 with SMTP id ju2mr9734486wid.1.1426181042115; Thu, 12 Mar 2015 10:24:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.207.101 with SMTP id lv5ls316807lac.22.gmail; Thu, 12 Mar 2015 10:24:01 -0700 (PDT) X-Received: by 10.152.10.98 with SMTP id h2mr39643897lab.18.1426181041827; Thu, 12 Mar 2015 10:24:01 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id dx6si4855329lbd.101.2015.03.12.10.24.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Mar 2015 10:24:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbvn10 with SMTP id n10so17603044lbv.1 for ; Thu, 12 Mar 2015 10:24:01 -0700 (PDT) X-Received: by 10.152.206.70 with SMTP id lm6mr40672285lac.35.1426181041146; Thu, 12 Mar 2015 10:24:01 -0700 (PDT) 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.35.133 with SMTP id h5csp372682lbj; Thu, 12 Mar 2015 10:23:59 -0700 (PDT) X-Received: by 10.66.237.35 with SMTP id uz3mr93287529pac.46.1426181038451; Thu, 12 Mar 2015 10:23:58 -0700 (PDT) Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com. [209.85.192.178]) by mx.google.com with ESMTPS id n8si4887798pdj.141.2015.03.12.10.23.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Mar 2015 10:23:57 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.192.178 as permitted sender) client-ip=209.85.192.178; Received: by pdjz10 with SMTP id z10so21605694pdj.11 for ; Thu, 12 Mar 2015 10:23:56 -0700 (PDT) X-Received: by 10.66.144.201 with SMTP id so9mr92791103pab.78.1426181035880; Thu, 12 Mar 2015 10:23:55 -0700 (PDT) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id bt2sm11994619pad.12.2015.03.12.10.23.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Mar 2015 10:23:55 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , "David S. Miller" , Arnd Bergmann , linux-ide@vger.kernel.org Subject: [PATCH] ide: pdc202xxx_new: Remove do_gettimeofday() usage for ktime_get Date: Thu, 12 Mar 2015 10:23:52 -0700 Message-Id: <1426181032-2397-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 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.217.176 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 y2038 cleanups, this patch removes the do_gettimeofday usage replacing it with ktime_get. Cc: "David S. Miller" Cc: Arnd Bergmann Cc: linux-ide@vger.kernel.org Signed-off-by: John Stultz --- drivers/ide/pdc202xx_new.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/ide/pdc202xx_new.c b/drivers/ide/pdc202xx_new.c index df73cbd..94bd05f 100644 --- a/drivers/ide/pdc202xx_new.c +++ b/drivers/ide/pdc202xx_new.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -243,13 +244,13 @@ static long read_counter(u32 dma_base) */ static long detect_pll_input_clock(unsigned long dma_base) { - struct timeval start_time, end_time; + ktime_t start_time, end_time; long start_count, end_count; long pll_input, usec_elapsed; u8 scr1; start_count = read_counter(dma_base); - do_gettimeofday(&start_time); + start_time = ktime_get(); /* Start the test mode */ outb(0x01, dma_base + 0x01); @@ -261,7 +262,7 @@ static long detect_pll_input_clock(unsigned long dma_base) mdelay(10); end_count = read_counter(dma_base); - do_gettimeofday(&end_time); + end_time = ktime_get(); /* Stop the test mode */ outb(0x01, dma_base + 0x01); @@ -273,8 +274,7 @@ static long detect_pll_input_clock(unsigned long dma_base) * Calculate the input clock in Hz * (the clock counter is 30 bit wide and counts down) */ - usec_elapsed = (end_time.tv_sec - start_time.tv_sec) * 1000000 + - (end_time.tv_usec - start_time.tv_usec); + usec_elapsed = (long)ktime_to_ns(ktime_sub(end_time, start_time))/1000; pll_input = ((start_count - end_count) & 0x3fffffff) / 10 * (10000000 / usec_elapsed);