From patchwork Wed Apr 13 07:01:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tina Ruchandani X-Patchwork-Id: 8819841 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 631E59F36E for ; Wed, 13 Apr 2016 09:17:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7B5A6201B9 for ; Wed, 13 Apr 2016 09:17:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 632432013A for ; Wed, 13 Apr 2016 09:17:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934610AbcDMJRt (ORCPT ); Wed, 13 Apr 2016 05:17:49 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:35219 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934151AbcDMJRr (ORCPT ); Wed, 13 Apr 2016 05:17:47 -0400 Received: by mail-pa0-f67.google.com with SMTP id zy2so3446986pac.2; Wed, 13 Apr 2016 02:17:47 -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-disposition :user-agent; bh=3KHbR39+qgG2+DkyYNq4tHgtwdOxy7SAvj28ri9Vjcw=; b=gYl9lw18AxDQP1bkKy1/2ly52QuMgSNBvoocYV2OnQRqBXubElcQz7oo5zhKpYWgh1 cy2+u8W395+dWGPhaaE1JSCgvKM9yipAxRSVJvkqG2GkM6VIhx70zVo7D4eBsxABA4CJ 5TqzpviWpCvWL4pi+EuvqvtbrrpnTYkg4e25WRfBfxTwVibxHG3jGEWHnm+VtGz35sSC c6ctr+zj9Vje4HtU1tBzaCfFWbbot4GZJ7Vnt3OsPxSJGDmEDqEQv/nihKf7RbdOK0ri HPRjYIrX0lbTvOht/8R6GHmpsUmHL4qPSZL0zTUZC1i9ywcYvcbdrHmdng44FT8Q0vWo m+bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=3KHbR39+qgG2+DkyYNq4tHgtwdOxy7SAvj28ri9Vjcw=; b=M0mS7qa3PSEtXHiz/GKrbFVSK85C23nU5ggRDxTBN7swqPPFVpcnr5qkfv0NAu7A0X cLhcIPjlk/nWsCsCX5HxR+QADXmSVulNBdyfMR1C9O0OKESG4hHDzc/fC4C5zMwagyAJ QWtmeJ/zb3zG4cycq8DE9/JEkq0iPm71qR7Ksx6PQejritQuLC8f2cD4FOjnaAOFQbZa nyGG6ontYsladB0Nftbxniz+p5mb4uIb47//DXZze69iN8c3oaY2K7wRLlzH/6MYImof O4whfZnNLzgoCJncGDVWomIP++zETNLsOM83qJOHpXeAmyKuFM5VRAA7Hii6sRZndNrq Gcww== X-Gm-Message-State: AOPr4FV4BVInPdP34MsFvhDmjRly3wACmxzHz399vC5ld37mqiBC166xwF6Ls1JkuB0RGw== X-Received: by 10.66.90.7 with SMTP id bs7mr11506886pab.118.1460539066788; Wed, 13 Apr 2016 02:17:46 -0700 (PDT) Received: from localhost ([219.91.213.77]) by smtp.gmail.com with ESMTPSA id u2sm30543025pan.45.2016.04.13.02.17.44 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 13 Apr 2016 02:17:46 -0700 (PDT) Date: Wed, 13 Apr 2016 00:01:40 -0700 From: Tina Ruchandani To: MPT-FusionLinux.pdl@broadcom.com Cc: Arnd Bergmann , y2038@lists.linaro.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, jejb@linux.vnet.ibm.com Subject: [PATCH] mpt3sas: Remove usage of 'struct timeval' Message-ID: <20160413070140.GA35235@localhost> 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 Reviewed-by: Arnd Bergmann Reviewed-by: Johannes Thumshirn --- drivers/scsi/mpt3sas/mpt3sas_base.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.8.0.rc3.226.g39d4020 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 8c44b9c..326c152 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -57,6 +57,7 @@ #include #include #include +#include #include #include @@ -4387,7 +4388,7 @@ _base_send_ioc_init(struct MPT3SAS_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; @@ -4449,9 +4450,8 @@ _base_send_ioc_init(struct MPT3SAS_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;