Skip to contentSkip to conversation

ALSA: compress_offload: Remove unused runtime pointer from snd_compr_poll()

PATCH In review Peter Ujfalusi 1 participant 2 messages Nov 6, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: compress_offload: Remove unused runtime pointer from snd_compr_poll()

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")
---
 sound/core/compress_offload.c | 3 ---
 1 file changed, 3 deletions(-)
sound/core/compress_offload.c +0 -3
index 5ecdad80a0d8..c08afbd0155b 100644
@@ -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) {
Signature · 1 line
2.47.0
#1 lore raw
Quoted 25 lines · Peter Ujfalusi

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")
---
 sound/core/compress_offload.c | 3 ---
 1 file changed, 3 deletions(-)
sound/core/compress_offload.c +0 -1
index 5ecdad80a0d8..c08afbd0155b 100644
@@ -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;
 

sound/core/compress_offload.c static __poll_t snd_compr_poll(struct file *f, poll_table *wait) · line 418

Quoted 5 lines
sound/core/compress_offload.c +0 -2
@@ -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.

Quoted 3 lines
sound/core/compress_offload.c +0 -0
 	guard(mutex)(&stream->device->lock);
 
 	switch (stream->runtime->state) {
Signature · 1 line
Péter