[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <s5hblthp0di.wl-tiwai@suse.de>
Date: Tue, 12 Nov 2019 16:42:17 +0100
From: Takashi Iwai <tiwai@...e.de>
To: Arnd Bergmann <arnd@...db.de>
Cc: <alsa-devel@...a-project.org>, Takashi Iwai <tiwai@...e.com>,
Baolin Wang <baolin.wang7@...il.com>, <y2038@...ts.linaro.org>,
<linux-kernel@...r.kernel.org>, Jaroslav Kysela <perex@...ex.cz>,
Mark Brown <broonie@...nel.org>,
Baolin Wang <baolin.wang@...aro.org>
Subject: Re: [PATCH v6 2/8] ALSA: Avoid using timespec for struct snd_timer_status
On Tue, 12 Nov 2019 16:16:36 +0100,
Arnd Bergmann wrote:
>
> From: Baolin Wang <baolin.wang@...aro.org>
>
> struct snd_timer_status uses 'timespec' type variables to record
> timestamp, which will be changed to an incompatible layout with
> updated user space using 64-bit time_t.
>
> To handle both the old and the new layout on 32-bit architectures,
> this patch introduces 'struct snd_timer_status32' and 'struct snd_timer_status64'
> to handle 32bit time_t and 64bit time_t in native mode and compat mode,
> which replaces timespec with s64 type.
>
> When glibc changes time_t to 64-bit, any recompiled program will issue
> ioctl commands that the kernel does not understand without this patch.
>
> Signed-off-by: Baolin Wang <baolin.wang@...aro.org>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
> include/uapi/sound/asound.h | 2 ++
> sound/core/timer.c | 62 +++++++++++++++++++++++++++++++++----
> sound/core/timer_compat.c | 57 ++++------------------------------
> 3 files changed, 64 insertions(+), 57 deletions(-)
>
> diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h
> index df1153cea0b7..930854f67fd3 100644
> --- a/include/uapi/sound/asound.h
> +++ b/include/uapi/sound/asound.h
> @@ -761,6 +761,7 @@ struct snd_timer_params {
> unsigned char reserved[60]; /* reserved */
> };
>
> +#ifndef __KERNEL__
> struct snd_timer_status {
> struct timespec tstamp; /* Timestamp - last update */
> unsigned int resolution; /* current period resolution in ns */
Do we need this ifndef? Is it for stopping the reference of struct
snd_timer_status from the kernel code but only 32 and 64 variants?
thanks,
Takashi
Powered by blists - more mailing lists