提交 62f09c3d 编写于 作者: C Clemens Ladisch 提交者: Jaroslav Kysela

[ALSA] usb-audio: optimize snd_usbmidi_count_bits()

Modules: USB generic driver

Reduce the code size of the snd_usbmidi_count_bits() function by using
simpler operations.
Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
上级 62c5549e
......@@ -871,10 +871,10 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi* umidi,
static unsigned int snd_usbmidi_count_bits(unsigned int x)
{
unsigned int bits = 0;
unsigned int bits;
for (; x; x >>= 1)
bits += x & 1;
for (bits = 0; x; ++bits)
x &= x - 1;
return bits;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册