summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2016-06-29 15:23:08 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-07-27 08:42:22 -0700
commit7d4e6bea615ad52878775104f1103d7c63697c2d (patch)
treefaddbc7160bb1fd888fd37f37e3bf2b15894a1a8
parent15cda2ef2aae50f1b00822dbc8f110e46b87e668 (diff)
downloadlwn-7d4e6bea615ad52878775104f1103d7c63697c2d.tar.gz
lwn-7d4e6bea615ad52878775104f1103d7c63697c2d.zip
ALSA: au88x0: Fix calculation in vortex_wtdma_bufshift()
commit 62db7152c924e4c060e42b34a69cd39658e8a0dc upstream. vortex_wtdma_bufshift() function does calculate the page index wrongly, first masking then shift, which always results in zero. The proper computation is to first shift, then mask. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--sound/pci/au88x0/au88x0_core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c
index 4667c3232b7f..74177189063c 100644
--- a/sound/pci/au88x0/au88x0_core.c
+++ b/sound/pci/au88x0/au88x0_core.c
@@ -1444,9 +1444,8 @@ static int vortex_wtdma_bufshift(vortex_t * vortex, int wtdma)
int page, p, pp, delta, i;
page =
- (hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2)) &
- WT_SUBBUF_MASK)
- >> WT_SUBBUF_SHIFT;
+ (hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2))
+ >> WT_SUBBUF_SHIFT) & WT_SUBBUF_MASK;
if (dma->nr_periods >= 4)
delta = (page - dma->period_real) & 3;
else {