diff options
author | Joe Perches <joe@perches.com> | 2012-11-17 08:35:16 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-11-17 11:35:07 +0100 |
commit | 190006f9d6594ee9ef4775ec09edda7df76fc8f1 (patch) | |
tree | d65ded1a1737b20ebe54e7f0dca75a155cfe67fc /sound/usb/endpoint.c | |
parent | ALSA: core: fix NULL checking in snd_pcm_plug_slave_size() (diff) | |
download | linux-190006f9d6594ee9ef4775ec09edda7df76fc8f1.tar.xz linux-190006f9d6594ee9ef4775ec09edda7df76fc8f1.zip |
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/endpoint.c')
-rw-r--r-- | sound/usb/endpoint.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 34de6f2faf61..51a9aa372cc7 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -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; |