From patchwork Mon Nov 6 14:02:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 118055 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2800302qgn; Mon, 6 Nov 2017 06:03:38 -0800 (PST) X-Google-Smtp-Source: ABhQp+QwqbKvPIXdvjaRQ1QmcNokgBGfgtV4FH64G5yqC+u7XoSTrwPYscX+zUdYOSPyMs6R3lbH X-Received: by 10.99.67.71 with SMTP id q68mr15496995pga.163.1509977018646; Mon, 06 Nov 2017 06:03:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509977018; cv=none; d=google.com; s=arc-20160816; b=ugQRNwus033k24vzPDH6JbBrS2BwRtXW/sJYKdXK2KysjMo2lsNYQ0XL222a0NNYE7 v1z/OLy5rwCUoQPMHxPPg5wSlb83Y1YTDE66slpJzYLn0KNUJIhelhIAo8tVrmmFXgK+ ueUkIIcQNBGdzc1q/kW0yw9/yM+gUCNHPZV5G7ioPzgsVGykhgqDg9Qyj1v1F1TjbFF9 Nej632CCDvI+e75iZuivHMdlZm4GzjEP0u63u2HAYBdZTNafYJPL6MWPjTzlIjpMgEwr jWn3Ne7wM0LbwEWnVWwfdvZJ8BRHFe2wBRsNr9zFFU1SgqdzfoJRLc36Tv0WhqAkckat ho9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=//xSUftwgqfuTC0KQE3EVm8feOgRkuumzmVYgb7f/DE=; b=jk61butLmBAR02FfDhFUFR9jS44X9ewuqUnvPZ1/xvi59knJIqLY9sOOPA4yOUk0JV K3VTCQoSZjV5heyuh8SrTu6+a7dHSH0Hi+RU3vj4VNq3+imbKGdCWYNHlM8l+axqs+fR /bfikrxSTrvV2kyQt3VCaiyrdRwTCDhteflLhhqcmtC91cE4azShXtCZW5in/JrJNdah unShSWFiKZcV+xSB01l2tdT8AXRdQV08l3omYw2Kq7ORyu/k79br43mZtYVcTbXabU8f sIJL2+UaNHo31pjo8qK4OwLFCzqtZktAzmy376QIEQmspsXe8gcAimXOuE0FJNEtd5Di C4Ww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v14si11126951pgc.214.2017.11.06.06.03.38; Mon, 06 Nov 2017 06:03:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753264AbdKFODg (ORCPT + 26 others); Mon, 6 Nov 2017 09:03:36 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:65046 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752761AbdKFODe (ORCPT ); Mon, 6 Nov 2017 09:03:34 -0500 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0M9oN6-1eMfHe3stM-00B1qI; Mon, 06 Nov 2017 15:03:31 +0100 From: Arnd Bergmann To: Stefan Haberland , Jan Hoeppner , Martin Schwidefsky , Heiko Carstens Cc: Arnd Bergmann , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] s390/dasd: avoid calling do_gettimeofday() Date: Mon, 6 Nov 2017 15:02:41 +0100 Message-Id: <20171106140328.1498644-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:LVc2L8SkkTihi4KCyGgekZ6Qq2jl+RYAVYJ5Xd6tUslfEraTogj bEFYRF0PhfTNxvz39c9kHQvy39CfoWFWBiR2/xaROinDoePiWI3vQ4ocBy+IyS7pDDUD5M/ fGSOfg7JWLysvPycECUtnHGwGP/EbELpVlIbsDvW0rWLv8v+VspEb+N03XEO0k5SKvQZKGq FMO1kSWRj2F8OhCtTylhQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:EO2YudRZyXk=:aUSXSuYC84rSS+m9GQgQrq EidAJWmHP70IDohXy1qwLvKarkp6p6L+jEWmTqra89QMqji56Fa80M/gSyH3IV/lOUspHNYHD DQqcnScvY7dlgjgLsB62aaaOIs70KVhyGJsOuZTZHKNrcnPxz4/HP6CWwNW7wBLmTutu6Zj5s 4kYNdALG0p+z8utALNS3/S5okaoQGkaVK4HkB8PnG42xQapYiy8wja/JtJEef2ELlnemErFhA wb28Z7oz2IOTbe575JmHfYiqWx8Mf4sqm4CuDRMijdtcXIF1tW6NpGN+vGek4rbHw3M1X97Ek w0M1IIjXH4wr0uAJ1KGHIsw7/n+E4mSud2TYCthEk7rA1wcIR1y8WF1v0NqG01MoXaefXA+zq K0Bc1wcrr1awz58La4QmhLPkdLLKE/dxFUBUUlBr4FWrj7LKRdHGfvNJurIYtClE8t6ItPxyd 8oWZelpL46kLs8nATCLr4YxAuumNXJOUG2T2D/ewuv3D4UZ/zszEEQ0nvgadaLK2RjaYfhtMf SLQV42+9bAPU04c57OAUfY7OO9PuF9/+7ZgmFda+RGC7Sab135WCxU6Ydk9CIgd49bKlzEU3K 9s6XQarCDarVUXKvTPj5n8ZLHolfMDVwRlKAuvR1aVGilTHf0UNd3D3jVXL8LvANmk6/nPNTz TfNBYAhCw6RDkdby0TxTKq+3spfBovIwchNY/g9Fvgi6edgos9myukJNd6sUo/0l+yYip0oYz +MEAN7kQ+wOHMTC9NxKMHWMh6DilUt00gdIzOA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org do_gettimeofday() is deprecated because it's not y2038-safe on 32-bit architectures. Since it is basically a wrapper around ktime_get_real_ts64(), we can just call that function directly instead. Signed-off-by: Arnd Bergmann --- drivers/s390/block/dasd_eer.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) -- 2.9.0 diff --git a/drivers/s390/block/dasd_eer.c b/drivers/s390/block/dasd_eer.c index 4630782b5456..5169c717c9d6 100644 --- a/drivers/s390/block/dasd_eer.c +++ b/drivers/s390/block/dasd_eer.c @@ -296,7 +296,7 @@ static void dasd_eer_write_standard_trigger(struct dasd_device *device, { struct dasd_ccw_req *temp_cqr; int data_size; - struct timeval tv; + struct timespec64 ts64; struct dasd_eer_header header; unsigned long flags; struct eerbuffer *eerb; @@ -310,9 +310,9 @@ static void dasd_eer_write_standard_trigger(struct dasd_device *device, header.total_size = sizeof(header) + data_size + 4; /* "EOR" */ header.trigger = trigger; - do_gettimeofday(&tv); - header.tv_sec = tv.tv_sec; - header.tv_usec = tv.tv_usec; + ktime_get_real_ts64(&ts); + header.tv_sec = ts.tv_sec; + header.tv_usec = ts.tv_nsec / NSEC_PER_USEC; strncpy(header.busid, dev_name(&device->cdev->dev), DASD_EER_BUSID_SIZE); @@ -340,7 +340,7 @@ static void dasd_eer_write_snss_trigger(struct dasd_device *device, { int data_size; int snss_rc; - struct timeval tv; + struct timespec64 ts; struct dasd_eer_header header; unsigned long flags; struct eerbuffer *eerb; @@ -353,9 +353,9 @@ static void dasd_eer_write_snss_trigger(struct dasd_device *device, header.total_size = sizeof(header) + data_size + 4; /* "EOR" */ header.trigger = DASD_EER_STATECHANGE; - do_gettimeofday(&tv); - header.tv_sec = tv.tv_sec; - header.tv_usec = tv.tv_usec; + ktime_get_real_ts64(&ts); + header.tv_sec = ts.tv_sec; + header.tv_usec = ts.tv_nsec / NSEC_PER_USEC; strncpy(header.busid, dev_name(&device->cdev->dev), DASD_EER_BUSID_SIZE);