From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754104Ab2KQKgX (ORCPT ); Sat, 17 Nov 2012 05:36:23 -0500 Received: from cantor2.suse.de ([195.135.220.15]:49372 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752404Ab2KQKgW (ORCPT ); Sat, 17 Nov 2012 05:36:22 -0500 Date: Sat, 17 Nov 2012 11:36:19 +0100 Message-ID: From: Takashi Iwai To: Joe Perches Cc: Akinobu Mita , alsa-devel@alsa-project.org, LKML Subject: Re: [PATCH] sound: use bitmap_weight In-Reply-To: <1353137716.12430.3.camel@joe-AO722> References: <1353134389-25583-1-git-send-email-akinobu.mita@gmail.com> <1353137716.12430.3.camel@joe-AO722> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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; > > >