From patchwork Wed Jan 7 21:01:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 42856 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 261DA2055F for ; Wed, 7 Jan 2015 21:01:48 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id e53sf3496330eek.3 for ; Wed, 07 Jan 2015 13:01: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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=5xrVGXqYBg9HWQuHEUE7pkPywXfDexn/FuqnVXEj018=; b=VVHmT8crWba/OjD0iHtc/ZvfKQLmtVtOmsHuhfW4pZAdBeOMg0FRwPFOe+tpoxBy8B 4k7G32YHg8E98HS9j5iI2mxyEb0KAGgK8CpczlA+BCiQURZPijJPk6LN2EKvSI/YpL8H hQlnmQhX/Kdd53RGy5uVNaqtBkfl51l4/W+pY6GNyZ4LaoSoLM2ACUdQeCetK7Djmh+w SSbuvmnSmgCORbHCmedMNWpJIEvdCB/baOnwfxI44RjtrQKadzFQlfGlTYJKUGU8g201 oghjEWVgNbpqbKKrqa8M3hGdYgOphW8+MqyZGzP+bbLpYE9lHLctyNMo/XkyC5u5NBO7 MEZw== X-Gm-Message-State: ALoCoQnlzJDzG3XFa4mFFbRFrr8MeD8hVEZPOdi0MD1acTk4eIOTmJBRb07WIj0tmlXL+ebWrAIn X-Received: by 10.152.170.201 with SMTP id ao9mr580605lac.5.1420664507368; Wed, 07 Jan 2015 13:01:47 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.232 with SMTP id m8ls219552laa.45.gmail; Wed, 07 Jan 2015 13:01:47 -0800 (PST) X-Received: by 10.152.206.108 with SMTP id ln12mr8245754lac.3.1420664507227; Wed, 07 Jan 2015 13:01:47 -0800 (PST) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id ua8si5049607lac.7.2015.01.07.13.01.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 Jan 2015 13:01:46 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by mail-la0-f52.google.com with SMTP id hs14so5769301lab.11 for ; Wed, 07 Jan 2015 13:01:46 -0800 (PST) X-Received: by 10.112.131.1 with SMTP id oi1mr8209154lbb.2.1420664506590; Wed, 07 Jan 2015 13:01: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 c8csp61604lbb; Wed, 7 Jan 2015 13:01:45 -0800 (PST) X-Received: by 10.70.133.98 with SMTP id pb2mr8556675pdb.137.1420664504188; Wed, 07 Jan 2015 13:01:44 -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 u12si5141679pdj.73.2015.01.07.13.01.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 Jan 2015 13:01:43 -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 fl12so6851396pdb.11 for ; Wed, 07 Jan 2015 13:01:42 -0800 (PST) X-Received: by 10.66.251.167 with SMTP id zl7mr9067748pac.140.1420664501752; Wed, 07 Jan 2015 13:01:41 -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 i9sm2638523pdj.27.2015.01.07.13.01.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Jan 2015 13:01:41 -0800 (PST) From: John Stultz To: lkml Cc: John Stultz , "David S. Miller" , Arnd Bergmann , linux-ide@vger.kernel.org Subject: [PATCH][RFC] ide: pdc202xxx_new: Remove do_gettimeofday() usage for ktime_get Date: Wed, 7 Jan 2015 13:01:33 -0800 Message-Id: <1420664493-7041-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.215.52 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);