]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-arm/arch-iop13xx/adma.h
Merge mainline v2.6.27-rc2 tree into linux-omap tree
[linux-2.6-omap-h63xx.git] / include / asm-arm / arch-iop13xx / adma.h
index 90d14ee564f567c2515dbced773eebda2d494063..ef4f5da2029f30af6e493e4ff9082d34abd0c40c 100644 (file)
@@ -198,17 +198,13 @@ iop_chan_memset_slot_count(size_t len, int *slots_per_op)
 static inline int
 iop_chan_xor_slot_count(size_t len, int src_cnt, int *slots_per_op)
 {
-       int num_slots;
-       /* slots_to_find = 1 for basic descriptor + 1 per 4 sources above 1
-        * (1 source => 8 bytes) (1 slot => 32 bytes)
-        */
-       num_slots = 1 + (((src_cnt - 1) << 3) >> 5);
-       if (((src_cnt - 1) << 3) & 0x1f)
-               num_slots++;
-
-       *slots_per_op = num_slots;
-
-       return num_slots;
+       static const char slot_count_table[] = { 1, 2, 2, 2,
+                                                2, 3, 3, 3,
+                                                3, 4, 4, 4,
+                                                4, 5, 5, 5,
+                                               };
+       *slots_per_op = slot_count_table[src_cnt - 1];
+       return *slots_per_op;
 }
 
 #define ADMA_MAX_BYTE_COUNT    (16 * 1024 * 1024)