From patchwork Fri Oct 30 09:05:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tina Ruchandani X-Patchwork-Id: 7525601 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5BEFABEEA4 for ; Fri, 30 Oct 2015 09:05:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4E9CF2084B for ; Fri, 30 Oct 2015 09:05:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 45B4F2082A for ; Fri, 30 Oct 2015 09:05:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030502AbbJ3JF3 (ORCPT ); Fri, 30 Oct 2015 05:05:29 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:35237 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758776AbbJ3JF1 (ORCPT ); Fri, 30 Oct 2015 05:05:27 -0400 Received: by pasz6 with SMTP id z6so68812410pas.2 for ; Fri, 30 Oct 2015 02:05:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=cFtDuOc1v3CGeBcQk2nCdRSVZcEhFwRONtfRsQYMoMc=; b=hTHWedNiG6NfoK6VLpECgcBsVaPmQ4KB0TdeJMfk/IUEdIqGIiNnyiSxBv8En7jW04 fVdynHD6LC5AEfXMOkvUHcuJ079tjj6TYPCHZg5Xg/IVrYylchH+DxBOYx0U7HjQtKMy Bk+uSPpxgKSSWOEVXkz51II0kbpELoAQIEmVqj70efPtMx4uNdUI4c1Ies3M1auu3Eru SIX5056mTZnJGxg6i8R8dEDAm779QdeU9w977IBN5IVT9Z+rC9xaKJoO3Gh2scrvW56V dYYJYs/NgztJQvkfv/Fi7MvNpryUxBHJZCgLRWwFgHZI3/hmYzBLAoKjUb670UeYTYka SqzA== X-Received: by 10.68.68.132 with SMTP id w4mr4557030pbt.137.1446195926950; Fri, 30 Oct 2015 02:05:26 -0700 (PDT) Received: from tina-laptop ([2602:301:779f:31e0:dcc6:66f6:ae0d:2aff]) by smtp.gmail.com with ESMTPSA id v13sm6865018pbs.51.2015.10.30.02.05.26 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 30 Oct 2015 02:05:26 -0700 (PDT) Date: Fri, 30 Oct 2015 02:05:15 -0700 From: Tina Ruchandani To: linux-scsi@vger.kernel.org Cc: Arnd Bergmann , "James E.J. Bottomley" , Abhijit Mahajan , Praveen Krishnamoorthy , Nagalakshmi Nandigama , y2038@lists.linaro.org Subject: [RESEND PATCH] mpt2sas: Remove usage of 'struct timeval' Message-ID: <20151030090515.GA3542@tina-laptop> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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' will have its tv_sec value overflow on 32-bit systems in year 2038 and beyond. This patch replaces the use of struct timeval for computing mpi_request.TimeStamp, and instead uses ktime_t which provides 64-bit seconds value. The timestamp computed remains unaffected (milliseconds since Unix epoch). Signed-off-by: Tina Ruchandani --- drivers/scsi/mpt2sas/mpt2sas_base.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index 58e4521..6d80477 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c @@ -57,6 +57,7 @@ #include #include #include +#include #include #include @@ -3616,7 +3617,7 @@ _base_send_ioc_init(struct MPT2SAS_ADAPTER *ioc, int sleep_flag) Mpi2IOCInitRequest_t mpi_request; Mpi2IOCInitReply_t mpi_reply; int i, r = 0; - struct timeval current_time; + ktime_t current_time; u16 ioc_status; u32 reply_post_free_array_sz = 0; Mpi2IOCInitRDPQArrayEntry *reply_post_free_array = NULL; @@ -3678,9 +3679,8 @@ _base_send_ioc_init(struct MPT2SAS_ADAPTER *ioc, int sleep_flag) /* This time stamp specifies number of milliseconds * since epoch ~ midnight January 1, 1970. */ - do_gettimeofday(¤t_time); - mpi_request.TimeStamp = cpu_to_le64((u64)current_time.tv_sec * 1000 + - (current_time.tv_usec / 1000)); + current_time = ktime_get_real(); + mpi_request.TimeStamp = cpu_to_le64(ktime_to_ms(current_time)); if (ioc->logging_level & MPT_DEBUG_INIT) { __le32 *mfp;