* [PATCH] sound: use bitmap_weight [not found] <1353134389-25583-1-git-send-email-akinobu.mita@gmail.com> @ 2012-11-17 7:35 ` Joe Perches 2012-11-17 10:36 ` Takashi Iwai 0 siblings, 1 reply; 2+ messages in thread From: Joe Perches @ 2012-11-17 7:35 UTC (permalink / raw) To: Takashi Iwai; +Cc: Akinobu Mita, alsa-devel, LKML Use bitmap_weight to count the total number of bits set in bitmap. Signed-off-by: Joe Perches <joe@perches.com> --- 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 34de6f2..51a9aa3 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; ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] sound: use bitmap_weight 2012-11-17 7:35 ` [PATCH] sound: use bitmap_weight Joe Perches @ 2012-11-17 10:36 ` Takashi Iwai 0 siblings, 0 replies; 2+ messages in thread From: Takashi Iwai @ 2012-11-17 10:36 UTC (permalink / raw) To: Joe Perches; +Cc: Akinobu Mita, alsa-devel, LKML At Fri, 16 Nov 2012 23:35:16 -0800, Joe Perches wrote: > > Use bitmap_weight to count the total number of bits set in bitmap. > > Signed-off-by: Joe Perches <joe@perches.com> Thanks, applied. Takashi > --- > 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 34de6f2..51a9aa3 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; > > > ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-17 10:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1353134389-25583-1-git-send-email-akinobu.mita@gmail.com>
2012-11-17 7:35 ` [PATCH] sound: use bitmap_weight Joe Perches
2012-11-17 10:36 ` Takashi Iwai
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®