From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755272AbcAIOhB (ORCPT ); Sat, 9 Jan 2016 09:37:01 -0500 Received: from mail-pa0-f67.google.com ([209.85.220.67]:33815 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752207AbcAIOg7 (ORCPT ); Sat, 9 Jan 2016 09:36:59 -0500 Date: Sat, 9 Jan 2016 20:06:55 +0530 From: Amitoj Kaur Chawla To: anil.gurumurthy@qlogic.com, sudarsana.kalluru@qlogic.com, JBottomley@odin.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, y2038@lists.linaro.org Subject: [PATCH 6/6] scsi: bfa: bfa_cs: Remove struct timeval Message-ID: <20160109143655.GA7594@amitoj-Inspiron-3542> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 32 bit systems using 'struct timeval' will break in the year 2038, so we replace the code appropriately. This patch replaces struct timeval and do_gettimeofday() with monotonic ktime_get_ns(). Since we are interested in microseconds portion of the time, we can use NSEC_PER_USEC macro but this would lead to expensive division for a frequently used function. Alternatively a bit shift has been done which performs a division of 1024 instead of 1000 which slightly alters the value returned by this function. Signed-off-by: Amitoj Kaur Chawla --- drivers/scsi/bfa/bfa_cs.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/scsi/bfa/bfa_cs.h b/drivers/scsi/bfa/bfa_cs.h index 91a8aa3..daee860 100644 --- a/drivers/scsi/bfa/bfa_cs.h +++ b/drivers/scsi/bfa/bfa_cs.h @@ -32,13 +32,7 @@ #define BFA_TRC_MAX (4 * 1024) #endif -#define BFA_TRC_TS(_trcm) \ - ({ \ - struct timeval tv; \ - \ - do_gettimeofday(&tv); \ - (tv.tv_sec*1000000+tv.tv_usec); \ - }) +#define BFA_TRC_TS(_trcm) (ktime_get_ns() >> 10) #ifndef BFA_TRC_TS #define BFA_TRC_TS(_trcm) ((_trcm)->ticks++) -- 1.9.1