Commit 480ca440 authored by Jaroslav Kysela's avatar Jaroslav Kysela

[ALSA] simplify snd_usbmidi_count_bits()

USB generic driver
This makes the bit counting code smaller and simpler.
Signed-off-by: default avatarCharles C. Bennett <ccb@acm.org>
Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
parent 8fdee9cf
......@@ -613,12 +613,12 @@ static int snd_usbmidi_in_endpoint_create(snd_usb_midi_t* umidi,
return 0;
}
static int snd_usbmidi_count_bits(uint16_t x)
static unsigned int snd_usbmidi_count_bits(unsigned int x)
{
int i, bits = 0;
unsigned int bits = 0;
for (i = 0; i < 16; ++i)
bits += (x & (1 << i)) != 0;
for (; x; x >>= 1)
bits += x & 1;
return bits;
}
......
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