mbox series

[000/113] ALSA: add snd_pcm_is_playback/capture() macro

Message ID 874j7z3j1a.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
Headers show
Series ALSA: add snd_pcm_is_playback/capture() macro | expand

Message

Kuninori Morimoto Aug. 5, 2024, 12:33 a.m. UTC
Hi ALSA-ML
Cc Staging-ML, USB-ML

Many drivers are using below code to know the Sound direction.

	if (direction == SNDRV_PCM_STREAM_PLAYBACK)

This patch-set add snd_pcm_is_playback/capture() macro to handle it.

Thank you for your help !!

Best regards
---
Kuninori Morimoto

Comments

Mark Brown Aug. 5, 2024, 10:43 a.m. UTC | #1
On Mon, Aug 05, 2024 at 12:33:38AM +0000, Kuninori Morimoto wrote:

> Many drivers are using below code to know the Sound direction.
> 
> 	if (direction == SNDRV_PCM_STREAM_PLAYBACK)
> 
> This patch-set add snd_pcm_is_playback/capture() macro to handle it.

Acked-by: Mark Brown <broonie@kernel.org>
Jaroslav Kysela Aug. 5, 2024, 2:04 p.m. UTC | #2
On 05. 08. 24 2:33, Kuninori Morimoto wrote:
> 
> Hi ALSA-ML
> Cc Staging-ML, USB-ML
> 
> Many drivers are using below code to know the Sound direction.
> 
> 	if (direction == SNDRV_PCM_STREAM_PLAYBACK)
> 
> This patch-set add snd_pcm_is_playback/capture() macro to handle it.
> 
> Thank you for your help !!

NAK from my side (overdesign, no improved readability). The defines 
(SNDRV_PCM_STREAM_*) are enough to check the stream type value correctly.

					Jaroslav
Mark Brown Aug. 5, 2024, 7:37 p.m. UTC | #3
On Mon, Aug 05, 2024 at 04:04:39PM +0200, Jaroslav Kysela wrote:
> On 05. 08. 24 2:33, Kuninori Morimoto wrote:

> > Many drivers are using below code to know the Sound direction.

> > 	if (direction == SNDRV_PCM_STREAM_PLAYBACK)

> > This patch-set add snd_pcm_is_playback/capture() macro to handle it.

> NAK from my side (overdesign, no improved readability). The defines
> (SNDRV_PCM_STREAM_*) are enough to check the stream type value correctly.

I have to say I do remember this being a little bit of a confusing idiom
when I first stated looking at ALSA stuff, especially for capture only
cases.
Kuninori Morimoto Sept. 13, 2024, 1:35 a.m. UTC | #4
Hi Takashi, Mark, Jaroslav

This is the reply for very old patch (almost 2 month ago).

> > > Many drivers are using below code to know the Sound direction.
> 
> > > 	if (direction == SNDRV_PCM_STREAM_PLAYBACK)
> 
> > > This patch-set add snd_pcm_is_playback/capture() macro to handle it.
> 
> > NAK from my side (overdesign, no improved readability). The defines
> > (SNDRV_PCM_STREAM_*) are enough to check the stream type value correctly.
> 
> I have to say I do remember this being a little bit of a confusing idiom
> when I first stated looking at ALSA stuff, especially for capture only
> cases.

This patch-set got both Ack and Nack.
I wonder can I re-post this after merge-window again ?
I'm asking because this is very huge patch-set.

Thank you for your help !!

Best regards
---
Kuninori Morimoto
Takashi Iwai Sept. 13, 2024, 7:14 a.m. UTC | #5
On Fri, 13 Sep 2024 03:35:28 +0200,
Kuninori Morimoto wrote:
> 
> 
> Hi Takashi, Mark, Jaroslav
> 
> This is the reply for very old patch (almost 2 month ago).
> 
> > > > Many drivers are using below code to know the Sound direction.
> > 
> > > > 	if (direction == SNDRV_PCM_STREAM_PLAYBACK)
> > 
> > > > This patch-set add snd_pcm_is_playback/capture() macro to handle it.
> > 
> > > NAK from my side (overdesign, no improved readability). The defines
> > > (SNDRV_PCM_STREAM_*) are enough to check the stream type value correctly.
> > 
> > I have to say I do remember this being a little bit of a confusing idiom
> > when I first stated looking at ALSA stuff, especially for capture only
> > cases.
> 
> This patch-set got both Ack and Nack.
> I wonder can I re-post this after merge-window again ?
> I'm asking because this is very huge patch-set.

If we get a NACK for this kind of cleanups, it's rather negative.
Unless its' a mandatory preliminary change for other upcoming stuff,
I don't think it's worth to work on this further. 


thanks,

Takashi
Kuninori Morimoto Sept. 16, 2024, 11:41 p.m. UTC | #6
Hi Takashi

> > This patch-set got both Ack and Nack.
> > I wonder can I re-post this after merge-window again ?
> > I'm asking because this is very huge patch-set.
> 
> If we get a NACK for this kind of cleanups, it's rather negative.
> Unless its' a mandatory preliminary change for other upcoming stuff,
> I don't think it's worth to work on this further. 

Hmm...

Thank you for your help !!

Best regards
---
Kuninori Morimoto