Skip to content

Commit 9e096b3

Browse files
ujfalusitiwai
authored andcommitted
ALSA: compress_offload: Use runtime pointer in 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; | ^~~~~~~ Instead of dropping the runtime, use it in the function in place of stream->runtime Fixes: 0417715 ("ALSA: compress_offload: introduce accel operation mode") Signed-off-by: Peter Ujfalusi <[email protected]> Reviewed-by: Jaroslav Kysela <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 9a0f609 commit 9e096b3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sound/core/compress_offload.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -418,15 +418,15 @@ static __poll_t snd_compr_poll(struct file *f, poll_table *wait)
418418

419419
guard(mutex)(&stream->device->lock);
420420

421-
switch (stream->runtime->state) {
421+
switch (runtime->state) {
422422
case SNDRV_PCM_STATE_OPEN:
423423
case SNDRV_PCM_STATE_XRUN:
424424
return snd_compr_get_poll(stream) | EPOLLERR;
425425
default:
426426
break;
427427
}
428428

429-
poll_wait(f, &stream->runtime->sleep, wait);
429+
poll_wait(f, &runtime->sleep, wait);
430430

431431
#if IS_ENABLED(CONFIG_SND_COMPRESS_ACCEL)
432432
if (stream->direction == SND_COMPRESS_ACCEL) {
@@ -445,18 +445,18 @@ static __poll_t snd_compr_poll(struct file *f, poll_table *wait)
445445
avail = snd_compr_get_avail(stream);
446446
pr_debug("avail is %ld\n", (unsigned long)avail);
447447
/* check if we have at least one fragment to fill */
448-
switch (stream->runtime->state) {
448+
switch (runtime->state) {
449449
case SNDRV_PCM_STATE_DRAINING:
450450
/* stream has been woken up after drain is complete
451451
* draining done so set stream state to stopped
452452
*/
453453
retval = snd_compr_get_poll(stream);
454-
stream->runtime->state = SNDRV_PCM_STATE_SETUP;
454+
runtime->state = SNDRV_PCM_STATE_SETUP;
455455
break;
456456
case SNDRV_PCM_STATE_RUNNING:
457457
case SNDRV_PCM_STATE_PREPARED:
458458
case SNDRV_PCM_STATE_PAUSED:
459-
if (avail >= stream->runtime->fragment_size)
459+
if (avail >= runtime->fragment_size)
460460
retval = snd_compr_get_poll(stream);
461461
break;
462462
default:

0 commit comments

Comments
 (0)