Re: [PATCH v6 2/8] ALSA: Avoid using timespec for struct snd_timer_status

From: Arnd Bergmann
Date: Tue Nov 12 2019 - 15:08:37 EST


On Tue, Nov 12, 2019 at 4:42 PM Takashi Iwai <tiwai@xxxxxxx> wrote:

> > @@ -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?

Well spotted, this is indeed a very recent change I did to the patch.
The idea here is to hide any use of 'time_t', 'timespec' and 'timeval'
from kernel compilation. These types are now defined in an incompatible
way by libc, so we have to remove them from the kernel's uapi headers.
I would prefer to remove them completely from the kernel (rather than
moving them from uapi to internal headers) to make it harder to write
y2038-incompatible code, and with the 90 patches I sent this week,
all users are gone from the kernel (this series was the last part).

Interestingly, hiding snd_timer_status from the drivers /also/ caught
a but in a file when I had missed a reference that needed to be converted
to snd_timer_status64.

Arnd