mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
701ef3205e
commit
190006f9d6
|
@ -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)
|
static int wait_clear_urbs(struct snd_usb_endpoint *ep)
|
||||||
{
|
{
|
||||||
unsigned long end_time = jiffies + msecs_to_jiffies(1000);
|
unsigned long end_time = jiffies + msecs_to_jiffies(1000);
|
||||||
unsigned int i;
|
|
||||||
int alive;
|
int alive;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
alive = 0;
|
alive = bitmap_weight(&ep->active_mask, ep->nurbs);
|
||||||
for (i = 0; i < ep->nurbs; i++)
|
|
||||||
if (test_bit(i, &ep->active_mask))
|
|
||||||
alive++;
|
|
||||||
|
|
||||||
if (!alive)
|
if (!alive)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue