mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ALSA: compress_offload: Remove unused runtime pointer from snd_compr_poll()
@ 2024-11-06  7:06 Peter Ujfalusi
  2024-11-06  7:49 ` Péter Ujfalusi
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Ujfalusi @ 2024-11-06  7:06 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;
      |                                   ^~~~~~~

Fixes: 04177158cf98 ("ALSA: compress_offload: introduce accel operation mode")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
---
 sound/core/compress_offload.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index 5ecdad80a0d8..c08afbd0155b 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -406,7 +406,6 @@ static __poll_t snd_compr_poll(struct file *f, poll_table *wait)
 {
 	struct snd_compr_file *data = f->private_data;
 	struct snd_compr_stream *stream;
-	struct snd_compr_runtime *runtime;
 	size_t avail;
 	__poll_t retval = 0;
 
@@ -414,8 +413,6 @@ static __poll_t snd_compr_poll(struct file *f, poll_table *wait)
 		return EPOLLERR;
 
 	stream = &data->stream;
-	runtime = stream->runtime;
-
 	guard(mutex)(&stream->device->lock);
 
 	switch (stream->runtime->state) {
-- 
2.47.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: compress_offload: Remove unused runtime pointer from snd_compr_poll()
  2024-11-06  7:06 [PATCH] ALSA: compress_offload: Remove unused runtime pointer from snd_compr_poll() Peter Ujfalusi
@ 2024-11-06  7:49 ` Péter Ujfalusi
  0 siblings, 0 replies; 2+ messages in thread
From: Péter Ujfalusi @ 2024-11-06  7:49 UTC (permalink / raw)
  To: vkoul, perex, tiwai
  Cc: linux-sound, linux-kernel, broonie, amadeuszx.slawinski



On 06/11/2024 09:06, 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;
>       |                                   ^~~~~~~
> 
> Fixes: 04177158cf98 ("ALSA: compress_offload: introduce accel operation mode")
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
> ---
>  sound/core/compress_offload.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
> index 5ecdad80a0d8..c08afbd0155b 100644
> --- a/sound/core/compress_offload.c
> +++ b/sound/core/compress_offload.c
> @@ -406,7 +406,6 @@ static __poll_t snd_compr_poll(struct file *f, poll_table *wait)
>  {
>  	struct snd_compr_file *data = f->private_data;
>  	struct snd_compr_stream *stream;
> -	struct snd_compr_runtime *runtime;
>  	size_t avail;
>  	__poll_t retval = 0;
>  
> @@ -414,8 +413,6 @@ static __poll_t snd_compr_poll(struct file *f, poll_table *wait)
>  		return EPOLLERR;
>  
>  	stream = &data->stream;
> -	runtime = stream->runtime;
> -

Probably it would be better to _use_ the runtime in the rest of the
function. Please ignore this patch, I will send a new one.

>  	guard(mutex)(&stream->device->lock);
>  
>  	switch (stream->runtime->state) {

-- 
Péter


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-06  7:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-06  7:06 [PATCH] ALSA: compress_offload: Remove unused runtime pointer from snd_compr_poll() Peter Ujfalusi
2024-11-06  7:49 ` Péter Ujfalusi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®