ALSA: usb-audio: use bitmap_weight
authorJoe Perches <joe@perches.com>
Sat, 17 Nov 2012 07:35:16 +0000 (23:35 -0800)
committerTakashi Iwai <tiwai@suse.de>
Sat, 17 Nov 2012 10:35:07 +0000 (11:35 +0100)
Use bitmap_weight to count the total number of bits set in bitmap.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/endpoint.c

index 34de6f2faf6120b492eb65208b9c9805aafe44e3..51a9aa372cc778795d8f9aa83a79623b4ed2ee6d 100644 (file)
@@ -485,15 +485,10 @@ __exit_unlock:
 static int wait_clear_urbs(struct snd_usb_endpoint *ep)
 {
        unsigned long end_time = jiffies + msecs_to_jiffies(1000);
-       unsigned int i;
        int alive;
 
        do {
-               alive = 0;
-               for (i = 0; i < ep->nurbs; i++)
-                       if (test_bit(i, &ep->active_mask))
-                               alive++;
-
+               alive = bitmap_weight(&ep->active_mask, ep->nurbs);
                if (!alive)
                        break;