aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/usbmidi.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2006-02-27 03:53:03 -0500
committerJaroslav Kysela <perex@suse.cz>2006-03-22 04:31:19 -0500
commit62f09c3d321c82981ae3f2dd7e32bc4c73379a7e (patch)
tree0faf32e373caaf63f53cc2ae9f03b80379620753 /sound/usb/usbmidi.c
parent62c5549ee246fa30606f918f97c6b3cde2831292 (diff)
[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: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'sound/usb/usbmidi.c')
-rw-r--r--sound/usb/usbmidi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c
index 7580339dba22..2b9d940c8064 100644
--- a/sound/usb/usbmidi.c
+++ b/sound/usb/usbmidi.c
@@ -871,10 +871,10 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi* umidi,
871 871
872static unsigned int snd_usbmidi_count_bits(unsigned int x) 872static unsigned int snd_usbmidi_count_bits(unsigned int x)
873{ 873{
874 unsigned int bits = 0; 874 unsigned int bits;
875 875
876 for (; x; x >>= 1) 876 for (bits = 0; x; ++bits)
877 bits += x & 1; 877 x &= x - 1;
878 return bits; 878 return bits;
879} 879}
880 880