From patchwork Thu Apr 30 17:00:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ksenija Stanojevic X-Patchwork-Id: 6305991 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 65E619F1C2 for ; Thu, 30 Apr 2015 17:00:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8AC54201F5 for ; Thu, 30 Apr 2015 17:00:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9A4182015E for ; Thu, 30 Apr 2015 17:00:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751948AbbD3RAm (ORCPT ); Thu, 30 Apr 2015 13:00:42 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:38176 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751140AbbD3RAl (ORCPT ); Thu, 30 Apr 2015 13:00:41 -0400 Received: by wiun10 with SMTP id n10so25263201wiu.1; Thu, 30 Apr 2015 10:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=M4X6Y5NHwlwLD9pStdBmuc5O40lxACTzGUvcfZij4CQ=; b=tJdlbYzI7BDZl4xtAxbhfCS9ep0Ixg6LccyuZRlT0ZYaEu3eWp6X0v+ng++Fg5dv7E +sWcBAKJyXJC15BZxClMS8uFlRQIbvahQrKFKTxul3+LPDWeIv2GzlQMA8dG2HOwM369 RHd59iD837nuoMp6hbFh74EN7Ku1tqdgZLznsdWlpVvDrKG8vrmZzXdt8JH0hQ/ALAZk 7HlQ6XcMHfHwjC2b6hmI81I/VKy5S0Gn1w8Lb/IeWD2w3DvkNlj+bAjBSsD8CA/Paiv5 YtGr7zxIdf5Ij8z5+qLCB7Jg8XFD+P6HBRdPZ6/uQkA/cCDZZTWJx5rsiK0JdyW1B8sw lrfw== X-Received: by 10.180.78.199 with SMTP id d7mr7216337wix.94.1430413239919; Thu, 30 Apr 2015 10:00:39 -0700 (PDT) Received: from localhost.localdomain (77-46-215-254.static.isp.telekom.rs. [77.46.215.254]) by mx.google.com with ESMTPSA id mc20sm3231675wic.15.2015.04.30.10.00.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Apr 2015 10:00:39 -0700 (PDT) From: Ksenija Stanojevic To: gregkh@linuxfoundation.org Cc: micky_ching@realsil.com.cn, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, devel@driverdev.osuosl.org, y2038@lists.linaro.org, Ksenija Stanojevic Subject: [PATCH] Staging: rts5208: Replace timeval with timespec64 Date: Thu, 30 Apr 2015 19:00:23 +0200 Message-Id: <1430413223-8021-1-git-send-email-ksenija.stanojevic@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP struct timeval tv is used to get current time. 32-bit systems using 'struct timeval' will break in the year 2038, so we have to replace that code with more appropriate types. Signed-off-by: Ksenija Stanojevic Reviewed-by: Arnd Bergmann --- drivers/staging/rts5208/rtsx.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rts5208/rtsx.h b/drivers/staging/rts5208/rtsx.h index 9e6ecb7..f768fc0 100644 --- a/drivers/staging/rts5208/rtsx.h +++ b/drivers/staging/rts5208/rtsx.h @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include @@ -151,21 +151,24 @@ static inline struct rtsx_dev *host_to_rtsx(struct Scsi_Host *host) static inline void get_current_time(u8 *timeval_buf, int buf_len) { - struct timeval tv; + struct timespec64 ts64; + u32 tv_usec; if (!timeval_buf || (buf_len < 8)) return; - do_gettimeofday(&tv); + getnstimeofday64(&ts64); - timeval_buf[0] = (u8)(tv.tv_sec >> 24); - timeval_buf[1] = (u8)(tv.tv_sec >> 16); - timeval_buf[2] = (u8)(tv.tv_sec >> 8); - timeval_buf[3] = (u8)(tv.tv_sec); - timeval_buf[4] = (u8)(tv.tv_usec >> 24); - timeval_buf[5] = (u8)(tv.tv_usec >> 16); - timeval_buf[6] = (u8)(tv.tv_usec >> 8); - timeval_buf[7] = (u8)(tv.tv_usec); + tv_usec = ts64.tv_nsec/NSEC_PER_USEC; + + timeval_buf[0] = (u8)(ts64.tv_sec >> 24); + timeval_buf[1] = (u8)(ts64.tv_sec >> 16); + timeval_buf[2] = (u8)(ts64.tv_sec >> 8); + timeval_buf[3] = (u8)(ts64.tv_sec); + timeval_buf[4] = (u8)(tv_usec >> 24); + timeval_buf[5] = (u8)(tv_usec >> 16); + timeval_buf[6] = (u8)(tv_usec >> 8); + timeval_buf[7] = (u8)(tv_usec); } /* The scsi_lock() and scsi_unlock() macros protect the sm_state and the