Commit 2e9bd50f authored by Oswald Buddenhagen's avatar Oswald Buddenhagen Committed by Takashi Iwai

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: default avatarOswald Buddenhagen <oswald.buddenhagen@gmx.de>
Link: https://lore.kernel.org/r/20230514170323.3408798-4-oswald.buddenhagen@gmx.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 2093dcfc
...@@ -50,9 +50,9 @@ unsigned int snd_emu10k1_ptr_read(struct snd_emu10k1 * emu, unsigned int reg, un ...@@ -50,9 +50,9 @@ unsigned int snd_emu10k1_ptr_read(struct snd_emu10k1 * emu, unsigned int reg, un
size = (reg >> 24) & 0x3f; size = (reg >> 24) & 0x3f;
offset = (reg >> 16) & 0x1f; offset = (reg >> 16) & 0x1f;
mask = ((1 << size) - 1) << offset; mask = (1 << size) - 1;
return (val & mask) >> offset; return (val >> offset) & mask;
} else { } else {
return val; return val;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment