Skip to content

Commit

Permalink
ALSA: usb-audio: use bitmap_weight
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joe Perches authored and Takashi Iwai committed Nov 17, 2012
1 parent 701ef32 commit 190006f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions sound/usb/endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,15 +485,10 @@ struct snd_usb_endpoint *snd_usb_add_endpoint(struct snd_usb_audio *chip,
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;

Expand Down

0 comments on commit 190006f

Please sign in to comment.