From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACB28C43331 for ; Tue, 12 Nov 2019 15:42:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 815F621A49 for ; Tue, 12 Nov 2019 15:42:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727363AbfKLPmU (ORCPT ); Tue, 12 Nov 2019 10:42:20 -0500 Received: from mx2.suse.de ([195.135.220.15]:50452 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727109AbfKLPmU (ORCPT ); Tue, 12 Nov 2019 10:42:20 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 36CB8B39E; Tue, 12 Nov 2019 15:42:18 +0000 (UTC) Date: Tue, 12 Nov 2019 16:42:17 +0100 Message-ID: From: Takashi Iwai To: Arnd Bergmann Cc: , Takashi Iwai , Baolin Wang , , , Jaroslav Kysela , Mark Brown , Baolin Wang Subject: Re: [PATCH v6 2/8] ALSA: Avoid using timespec for struct snd_timer_status In-Reply-To: <20191112151642.680072-3-arnd@arndb.de> References: <20191112151642.680072-1-arnd@arndb.de> <20191112151642.680072-3-arnd@arndb.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 12 Nov 2019 16:16:36 +0100, Arnd Bergmann wrote: > > From: Baolin Wang > > 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 > Signed-off-by: Arnd Bergmann > --- > 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