ALSA: emu10k1: optimize mask calculation in snd_emu10k1_ptr_read()

Unlike in snd_emu10k1_ptr_write(), we don't need to keep the value's
bits in place, so we can save one shift.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Link: https://lore.kernel.org/r/20230514170323.3408798-4-oswald.buddenhagen@gmx.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Oswald Buddenhagen 2023-05-14 19:03:23 +02:00 committed by Takashi Iwai
parent 2093dcfc04
commit 2e9bd50f11
1 changed files with 2 additions and 2 deletions

View File

@ -50,9 +50,9 @@ unsigned int snd_emu10k1_ptr_read(struct snd_emu10k1 * emu, unsigned int reg, un
size = (reg >> 24) & 0x3f;
offset = (reg >> 16) & 0x1f;
mask = ((1 << size) - 1) << offset;
mask = (1 << size) - 1;
return (val & mask) >> offset;
return (val >> offset) & mask;
} else {
return val;
}