* [PATCH] ALSA: pcm: Replace [audio_]tstamp_[n]sec by struct __snd_timespec64 in struct snd_pcm_mmap_status_x32
@ 2025-06-16 5:12 Christophe Leroy
2025-06-16 6:26 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Christophe Leroy @ 2025-06-16 5:12 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai
Cc: Christophe Leroy, linux-kernel, linuxppc-dev, linux-sound,
Stephen Rothwell
To match struct __snd_pcm_mmap_status and enable reuse of
snd_pcm_sync_ptr_get_user() and snd_pcm_sync_ptr_put_user() by
snd_pcm_sync_ptr() replace tstamp_sec and tstamp_nsec fields by
a struct __snd_timespec64 in struct snd_pcm_mmap_status_x32.
Do the same with audio_tstamp_sec and audio_tstamp_nsec.
This is possible because struct snd_pcm_mmap_status_x32 is packed
and __SND_STRUCT_TIME64 is always defined for kernel which means
struct __snd_timespec64 is always defined as struct __kernel_timespec
which is:
struct __kernel_timespec {
long long tv_sec;
long long tv_nsec;
};
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Fixes: a0f3992ee86e ("ALSA: pcm: Replace [audio_]tstamp_[n]sec by struct __snd_timespec in struct snd_pcm_mmap_status32")
Closes: https://lore.kernel.org/all/20250616130126.08729b84@canb.auug.org.au/
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
Might be squashed with a0f3992ee86e if you happen to rebase sound tree.
---
sound/core/pcm_compat.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c
index 17540020ac2f..54eb9bd8eb21 100644
--- a/sound/core/pcm_compat.c
+++ b/sound/core/pcm_compat.c
@@ -377,12 +377,10 @@ struct snd_pcm_mmap_status_x32 {
s32 pad1;
u32 hw_ptr;
u32 pad2; /* alignment */
- s64 tstamp_sec;
- s64 tstamp_nsec;
+ struct __snd_timespec64 tstamp;
snd_pcm_state_t suspended_state;
s32 pad3;
- s64 audio_tstamp_sec;
- s64 audio_tstamp_nsec;
+ struct __snd_timespec64 audio_tstamp;
} __packed;
struct snd_pcm_mmap_control_x32 {
--
2.47.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ALSA: pcm: Replace [audio_]tstamp_[n]sec by struct __snd_timespec64 in struct snd_pcm_mmap_status_x32
2025-06-16 5:12 [PATCH] ALSA: pcm: Replace [audio_]tstamp_[n]sec by struct __snd_timespec64 in struct snd_pcm_mmap_status_x32 Christophe Leroy
@ 2025-06-16 6:26 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2025-06-16 6:26 UTC (permalink / raw)
To: Christophe Leroy
Cc: Jaroslav Kysela, Takashi Iwai, linux-kernel, linuxppc-dev,
linux-sound, Stephen Rothwell
On Mon, 16 Jun 2025 07:12:23 +0200,
Christophe Leroy wrote:
>
> To match struct __snd_pcm_mmap_status and enable reuse of
> snd_pcm_sync_ptr_get_user() and snd_pcm_sync_ptr_put_user() by
> snd_pcm_sync_ptr() replace tstamp_sec and tstamp_nsec fields by
> a struct __snd_timespec64 in struct snd_pcm_mmap_status_x32.
> Do the same with audio_tstamp_sec and audio_tstamp_nsec.
>
> This is possible because struct snd_pcm_mmap_status_x32 is packed
> and __SND_STRUCT_TIME64 is always defined for kernel which means
> struct __snd_timespec64 is always defined as struct __kernel_timespec
> which is:
>
> struct __kernel_timespec {
> long long tv_sec;
> long long tv_nsec;
> };
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Fixes: a0f3992ee86e ("ALSA: pcm: Replace [audio_]tstamp_[n]sec by struct __snd_timespec in struct snd_pcm_mmap_status32")
> Closes: https://lore.kernel.org/all/20250616130126.08729b84@canb.auug.org.au/
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
> Might be squashed with a0f3992ee86e if you happen to rebase sound tree.
Since your patches are the last ones, I rebased now exceptionally.
thanks,
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-16 6:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-16 5:12 [PATCH] ALSA: pcm: Replace [audio_]tstamp_[n]sec by struct __snd_timespec64 in struct snd_pcm_mmap_status_x32 Christophe Leroy
2025-06-16 6:26 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).