From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751625AbbJWUS7 (ORCPT ); Fri, 23 Oct 2015 16:18:59 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:34520 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750958AbbJWUS6 (ORCPT ); Fri, 23 Oct 2015 16:18:58 -0400 Message-ID: <562A962F.6020701@acm.org> Date: Fri, 23 Oct 2015 15:18:55 -0500 From: Corey Minyard Reply-To: minyard@acm.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Amitoj Kaur Chawla , outreachy-kernel@googlegroups.com CC: y2038@lists.linaro.org, openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] char: ipmi: ipmi_ssif: Replace timeval with timespec64 References: <20151023195104.GA32677@amitoj-Inspiron-3542> In-Reply-To: <20151023195104.GA32677@amitoj-Inspiron-3542> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Queued for 4.4. Thanks. -corey On 10/23/2015 02:51 PM, Amitoj Kaur Chawla wrote: > This patch replaces timeval with timespec64 as 32 bit 'struct timeval' > will not give current time beyond 2038. > > The patch changes the code to use ktime_get_real_ts64() which returns > a 'struct timespec64' instead of do_gettimeofday() which returns a > 'struct timeval' > > This patch also alters the format string in pr_info() for now.tv_sec > to incorporate 'long long' on 32 bit architectures. > > Signed-off-by: Amitoj Kaur Chawla > --- > Changes in v2: > -Removed unnecessary format string change in pr_info() > > drivers/char/ipmi/ipmi_ssif.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c > index 877205d..90e6246 100644 > --- a/drivers/char/ipmi/ipmi_ssif.c > +++ b/drivers/char/ipmi/ipmi_ssif.c > @@ -52,6 +52,7 @@ > #include > #include > #include > +#include > > #define PFX "ipmi_ssif: " > #define DEVICE_NAME "ipmi_ssif" > @@ -1041,12 +1042,12 @@ static void sender(void *send_info, > start_next_msg(ssif_info, flags); > > if (ssif_info->ssif_debug & SSIF_DEBUG_TIMING) { > - struct timeval t; > + struct timespec64 t; > > - do_gettimeofday(&t); > - pr_info("**Enqueue %02x %02x: %ld.%6.6ld\n", > + ktime_get_real_ts64(&t); > + pr_info("**Enqueue %02x %02x: %lld.%6.6ld\n", > msg->data[0], msg->data[1], > - (long) t.tv_sec, (long) t.tv_usec); > + (long long) t.tv_sec, (long) t.tv_nsec / NSEC_PER_USEC); > } > } >