diff options
-rw-r--r-- | drivers/ieee1394/ohci1394.c | 8 |
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 @@ | |||
82 | * | 82 | * |
83 | */ | 83 | */ |
84 | 84 | ||
85 | #include <linux/bitops.h> | ||
85 | #include <linux/kernel.h> | 86 | #include <linux/kernel.h> |
86 | #include <linux/list.h> | 87 | #include <linux/list.h> |
87 | #include <linux/slab.h> | 88 | #include <linux/slab.h> |
@@ -434,7 +435,6 @@ static void initialize_dma_trm_ctx(struct dma_trm_ctx *d) | |||
434 | /* Count the number of available iso contexts */ | 435 | /* Count the number of available iso contexts */ |
435 | static int get_nb_iso_ctx(struct ti_ohci *ohci, int reg) | 436 | static int get_nb_iso_ctx(struct ti_ohci *ohci, int reg) |
436 | { | 437 | { |
437 | int i,ctx=0; | ||
438 | u32 tmp; | 438 | u32 tmp; |
439 | 439 | ||
440 | reg_write(ohci, reg, 0xffffffff); | 440 | reg_write(ohci, reg, 0xffffffff); |
@@ -443,11 +443,7 @@ static int get_nb_iso_ctx(struct ti_ohci *ohci, int reg) | |||
443 | DBGMSG("Iso contexts reg: %08x implemented: %08x", reg, tmp); | 443 | DBGMSG("Iso contexts reg: %08x implemented: %08x", reg, tmp); |
444 | 444 | ||
445 | /* Count the number of contexts */ | 445 | /* Count the number of contexts */ |
446 | for (i=0; i<32; i++) { | 446 | return hweight32(tmp); |
447 | if (tmp & 1) ctx++; | ||
448 | tmp >>= 1; | ||
449 | } | ||
450 | return ctx; | ||
451 | } | 447 | } |
452 | 448 | ||
453 | /* Global initialization */ | 449 | /* Global initialization */ |