Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032427AbdIZVy4 (ORCPT ); Tue, 26 Sep 2017 17:54:56 -0400 Received: from mail-oi0-f49.google.com ([209.85.218.49]:51083 "EHLO mail-oi0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966606AbdIZVyz (ORCPT ); Tue, 26 Sep 2017 17:54:55 -0400 X-Google-Smtp-Source: AOwi7QDiQj6XPKCIJbNtDm32SWDgDTlu0SCmI0N+g1JxGKCkChoi8GNKb5LCf5/a/eIol+OYTl6gR30v6iA7KpuzGPs= MIME-Version: 1.0 In-Reply-To: References: From: Baolin Wang Date: Wed, 27 Sep 2017 05:54:54 +0800 Message-ID: Subject: Re: [RFC PATCH 6/7] uapi: sound: Avoid using timespec for struct snd_ctl_elem_value To: Arnd Bergmann 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 , Fabian Frederick , 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: 1592 Lines: 39 On 21 September 2017 at 20:58, Arnd Bergmann wrote: > 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); OK. -- Baolin.wang Best Regards