* [PATCH] ALSA: compress_offload: Use runtime pointer in snd_compr_poll()
@ 2024-11-06 7:53 Peter Ujfalusi
2024-11-06 8:19 ` Jaroslav Kysela
2024-11-06 8:46 ` Takashi Iwai
0 siblings, 2 replies; 3+ messages in thread
From: Peter Ujfalusi @ 2024-11-06 7:53 UTC (permalink / raw)
To: vkoul, perex, tiwai
Cc: linux-sound, linux-kernel, broonie, amadeuszx.slawinski
runtime is not used as seen with W=1 :
sound/core/compress_offload.c: In function ‘snd_compr_poll’:
sound/core/compress_offload.c:409:35: error: variable ‘runtime’ set but not used [-Werror=unused-but-set-variable]
409 | struct snd_compr_runtime *runtime;
| ^~~~~~~
Instead of dropping the runtime, use it in the function in place of
stream->runtime
Fixes: 04177158cf98 ("ALSA: compress_offload: introduce accel operation mode")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
---
sound/core/compress_offload.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index 5ecdad80a0d8..86ed2fbee0c8 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -418,7 +418,7 @@ static __poll_t snd_compr_poll(struct file *f, poll_table *wait)
guard(mutex)(&stream->device->lock);
- switch (stream->runtime->state) {
+ switch (runtime->state) {
case SNDRV_PCM_STATE_OPEN:
case SNDRV_PCM_STATE_XRUN:
return snd_compr_get_poll(stream) | EPOLLERR;
@@ -426,7 +426,7 @@ static __poll_t snd_compr_poll(struct file *f, poll_table *wait)
break;
}
- poll_wait(f, &stream->runtime->sleep, wait);
+ poll_wait(f, &runtime->sleep, wait);
#if IS_ENABLED(CONFIG_SND_COMPRESS_ACCEL)
if (stream->direction == SND_COMPRESS_ACCEL) {
@@ -445,18 +445,18 @@ static __poll_t snd_compr_poll(struct file *f, poll_table *wait)
avail = snd_compr_get_avail(stream);
pr_debug("avail is %ld\n", (unsigned long)avail);
/* check if we have at least one fragment to fill */
- switch (stream->runtime->state) {
+ switch (runtime->state) {
case SNDRV_PCM_STATE_DRAINING:
/* stream has been woken up after drain is complete
* draining done so set stream state to stopped
*/
retval = snd_compr_get_poll(stream);
- stream->runtime->state = SNDRV_PCM_STATE_SETUP;
+ runtime->state = SNDRV_PCM_STATE_SETUP;
break;
case SNDRV_PCM_STATE_RUNNING:
case SNDRV_PCM_STATE_PREPARED:
case SNDRV_PCM_STATE_PAUSED:
- if (avail >= stream->runtime->fragment_size)
+ if (avail >= runtime->fragment_size)
retval = snd_compr_get_poll(stream);
break;
default:
--
2.47.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ALSA: compress_offload: Use runtime pointer in snd_compr_poll()
2024-11-06 7:53 [PATCH] ALSA: compress_offload: Use runtime pointer in snd_compr_poll() Peter Ujfalusi
@ 2024-11-06 8:19 ` Jaroslav Kysela
2024-11-06 8:46 ` Takashi Iwai
1 sibling, 0 replies; 3+ messages in thread
From: Jaroslav Kysela @ 2024-11-06 8:19 UTC (permalink / raw)
To: Peter Ujfalusi, vkoul, tiwai
Cc: linux-sound, linux-kernel, broonie, amadeuszx.slawinski
On 06. 11. 24 8:53, Peter Ujfalusi wrote:
> runtime is not used as seen with W=1 :
> sound/core/compress_offload.c: In function ‘snd_compr_poll’:
> sound/core/compress_offload.c:409:35: error: variable ‘runtime’ set but not used [-Werror=unused-but-set-variable]
> 409 | struct snd_compr_runtime *runtime;
> | ^~~~~~~
>
> Instead of dropping the runtime, use it in the function in place of
> stream->runtime
Yes, it was the desired target for this change. Unfortunately unfinished. Thanks.
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
--
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ALSA: compress_offload: Use runtime pointer in snd_compr_poll()
2024-11-06 7:53 [PATCH] ALSA: compress_offload: Use runtime pointer in snd_compr_poll() Peter Ujfalusi
2024-11-06 8:19 ` Jaroslav Kysela
@ 2024-11-06 8:46 ` Takashi Iwai
1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2024-11-06 8:46 UTC (permalink / raw)
To: Peter Ujfalusi
Cc: vkoul, perex, tiwai, linux-sound, linux-kernel, broonie,
amadeuszx.slawinski
On Wed, 06 Nov 2024 08:53:12 +0100,
Peter Ujfalusi wrote:
>
> runtime is not used as seen with W=1 :
> sound/core/compress_offload.c: In function ‘snd_compr_poll’:
> sound/core/compress_offload.c:409:35: error: variable ‘runtime’ set but not used [-Werror=unused-but-set-variable]
> 409 | struct snd_compr_runtime *runtime;
> | ^~~~~~~
>
> Instead of dropping the runtime, use it in the function in place of
> stream->runtime
>
> Fixes: 04177158cf98 ("ALSA: compress_offload: introduce accel operation mode")
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Applied now. Thanks.
Takashi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-06 8:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-06 7:53 [PATCH] ALSA: compress_offload: Use runtime pointer in snd_compr_poll() Peter Ujfalusi
2024-11-06 8:19 ` Jaroslav Kysela
2024-11-06 8:46 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox