aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-11-17 02:35:16 -0500
committerTakashi Iwai <tiwai@suse.de>2012-11-17 05:35:07 -0500
commit190006f9d6594ee9ef4775ec09edda7df76fc8f1 (patch)
treed65ded1a1737b20ebe54e7f0dca75a155cfe67fc /sound/usb
parent701ef3205eb33bce4ba97b96f6f04a5ae29cd7b8 (diff)
ALSA: usb-audio: use bitmap_weight
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>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/endpoint.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index 34de6f2faf6..51a9aa372cc 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -485,15 +485,10 @@ __exit_unlock:
485static int wait_clear_urbs(struct snd_usb_endpoint *ep) 485static int wait_clear_urbs(struct snd_usb_endpoint *ep)
486{ 486{
487 unsigned long end_time = jiffies + msecs_to_jiffies(1000); 487 unsigned long end_time = jiffies + msecs_to_jiffies(1000);
488 unsigned int i;
489 int alive; 488 int alive;
490 489
491 do { 490 do {
492 alive = 0; 491 alive = bitmap_weight(&ep->active_mask, ep->nurbs);
493 for (i = 0; i < ep->nurbs; i++)
494 if (test_bit(i, &ep->active_mask))
495 alive++;
496
497 if (!alive) 492 if (!alive)
498 break; 493 break;
499 494