summaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-08 08:13:10 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-08 08:13:10 -0800
commitbb592cf474404e51cbf3c419fb72fda83c4b7d72 (patch)
tree05823f536d5f095857a7aff732e205d249e4b7a1 /drivers/ieee1394
parent79c9601c2e0dbbe69895d302de4d19f3a31fbd30 (diff)
parentaf0940dac37545b1e7900b19c464fb6367d3f82f (diff)
downloadlinux-bb592cf474404e51cbf3c419fb72fda83c4b7d72.tar.bz2
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: ieee1394: Use hweight32 firewire: cdev: reduce stack usage by ioctl_dispatch firewire: ohci: 0 may be a valid DMA address firewire: core: WARN on wrong usage of core transaction functions firewire: core: optimize Topology Map creation firewire: core: clarify generate_config_rom usage firewire: optimize config ROM creation firewire: cdev: normalize variable names firewire: normalize style of queue_work wrappers firewire: cdev: fix memory leak in an error path
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r--drivers/ieee1394/ohci1394.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c
index 65c1429e4129..d0dc1db80b29 100644
--- a/drivers/ieee1394/ohci1394.c
+++ b/drivers/ieee1394/ohci1394.c
@@ -82,6 +82,7 @@
*
*/
+#include <linux/bitops.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/slab.h>
@@ -434,7 +435,6 @@ static void initialize_dma_trm_ctx(struct dma_trm_ctx *d)
/* Count the number of available iso contexts */
static int get_nb_iso_ctx(struct ti_ohci *ohci, int reg)
{
- int i,ctx=0;
u32 tmp;
reg_write(ohci, reg, 0xffffffff);
@@ -443,11 +443,7 @@ static int get_nb_iso_ctx(struct ti_ohci *ohci, int reg)
DBGMSG("Iso contexts reg: %08x implemented: %08x", reg, tmp);
/* Count the number of contexts */
- for (i=0; i<32; i++) {
- if (tmp & 1) ctx++;
- tmp >>= 1;
- }
- return ctx;
+ return hweight32(tmp);
}
/* Global initialization */