summaryrefslogtreecommitdiff
path: root/sound/usb/card.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-06-01 19:24:54 +0300
committerTakashi Iwai <tiwai@suse.de>2021-06-02 10:01:30 +0300
commitd303c5d38b37eed066c0f704c5a76353bce27284 (patch)
tree35d8605a4a386798bbf562920d74db789eb8cd18 /sound/usb/card.h
parentcdebd5530360cfd6240b1692a4c60212a2e39c8a (diff)
downloadlinux-d303c5d38b37eed066c0f704c5a76353bce27284.tar.xz
ALSA: usb-audio: Pre-calculate buffer byte size
There are a bunch of lines calculating the buffer size in bytes at each time. Keep the value in subs->buffer_bytes and use it consistently for the code simplicity. Link: https://lore.kernel.org/r/20210601162457.4877-3-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/card.h')
-rw-r--r--sound/usb/card.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/usb/card.h b/sound/usb/card.h
index a741e7da83a2..b346653d4b76 100644
--- a/sound/usb/card.h
+++ b/sound/usb/card.h
@@ -158,6 +158,7 @@ struct snd_usb_substream {
unsigned int running: 1; /* running status */
+ unsigned int buffer_bytes; /* buffer size in bytes */
unsigned int hwptr_done; /* processed byte position in the buffer */
unsigned int transfer_done; /* processed frames since last period update */
unsigned int frame_limit; /* limits number of packets in URB */