Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751739AbdIUM6J (ORCPT ); Thu, 21 Sep 2017 08:58:09 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:36522 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751596AbdIUM6H (ORCPT ); Thu, 21 Sep 2017 08:58:07 -0400 X-Google-Smtp-Source: AOwi7QD+Cocwms5hebaDXyxugWnM1uTFfKYmIqkuVGMX8seCERg+j9ZVv3u3GsQjkFVkHKmRjT00cf3SadyjKGLrUnQ= MIME-Version: 1.0 In-Reply-To: References: From: Arnd Bergmann Date: Thu, 21 Sep 2017 14:58:06 +0200 X-Google-Sender-Auth: hiF-jzB4gCYI8gCk9Ko1vffsRmc Message-ID: Subject: Re: [RFC PATCH 6/7] uapi: sound: Avoid using timespec for struct snd_ctl_elem_value To: Baolin Wang Cc: Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Ingo Molnar , Takashi Sakamoto , SF Markus Elfring , Dan Carpenter , jeeja.kp@intel.com, Vinod Koul , dharageswari.r@intel.com, guneshwor.o.singh@intel.com, Bhumika Goyal , gudishax.kranthikumar@intel.com, Naveen M , hardik.t.shah@intel.com, Arvind Yadav , fabf@skynet.be, Mark Brown , Deepa Dinamani , alsa-devel@alsa-project.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1467 Lines: 34 On Thu, Sep 21, 2017 at 8:18 AM, Baolin Wang wrote: > The struct snd_ctl_elem_value will use 'timespec' type variables to record > timestamp, which is not year 2038 safe on 32bits system. > > Since there are no drivers will implemented the tstamp member of the > struct snd_ctl_elem_value, and also the stucture size will not be changed > if we change timespec to s64 for tstamp member of struct snd_ctl_elem_value. > > Thus we can simply change timespec to s64 for tstamp member to avoid > using the type which is not year 2038 safe on 32bits system. > > Signed-off-by: Baolin Wang > --- > include/uapi/sound/asound.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h > index 1949923..71bce52 100644 > --- a/include/uapi/sound/asound.h > +++ b/include/uapi/sound/asound.h > @@ -943,8 +943,8 @@ struct snd_ctl_elem_value { > } bytes; > struct snd_aes_iec958 iec958; > } value; /* RO */ > - struct timespec tstamp; > - unsigned char reserved[128-sizeof(struct timespec)]; > + struct { s64 tv_sec; s64 tv_nsec; } tstamp; > + unsigned char reserved[128-sizeof(struct { s64 tv_sec; s64 tv_nsec; })]; > }; Maybe we should enforce that nobody uses the timespec field, by enclosing it in #ifdef __KERNEL__ (with a matching length below it); Arnd