aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/xor.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/xor.c')
-rw-r--r--crypto/xor.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/crypto/xor.c b/crypto/xor.c
index 8281ac5e68a8..b2e6db075e49 100644
--- a/crypto/xor.c
+++ b/crypto/xor.c
@@ -26,31 +26,30 @@
26static struct xor_block_template *active_template; 26static struct xor_block_template *active_template;
27 27
28void 28void
29xor_blocks(unsigned int count, unsigned int bytes, void **ptr) 29xor_blocks(unsigned int src_count, unsigned int bytes, void *dest, void **srcs)
30{ 30{
31 unsigned long *p0, *p1, *p2, *p3, *p4; 31 unsigned long *p1, *p2, *p3, *p4;
32 32
33 p0 = (unsigned long *) ptr[0]; 33 p1 = (unsigned long *) srcs[0];
34 p1 = (unsigned long *) ptr[1]; 34 if (src_count == 1) {
35 if (count == 2) { 35 active_template->do_2(bytes, dest, p1);
36 active_template->do_2(bytes, p0, p1);
37 return; 36 return;
38 } 37 }
39 38
40 p2 = (unsigned long *) ptr[2]; 39 p2 = (unsigned long *) srcs[1];
41 if (count == 3) { 40 if (src_count == 2) {
42 active_template->do_3(bytes, p0, p1, p2); 41 active_template->do_3(bytes, dest, p1, p2);
43 return; 42 return;
44 } 43 }
45 44
46 p3 = (unsigned long *) ptr[3]; 45 p3 = (unsigned long *) srcs[2];
47 if (count == 4) { 46 if (src_count == 3) {
48 active_template->do_4(bytes, p0, p1, p2, p3); 47 active_template->do_4(bytes, dest, p1, p2, p3);
49 return; 48 return;
50 } 49 }
51 50
52 p4 = (unsigned long *) ptr[4]; 51 p4 = (unsigned long *) srcs[3];
53 active_template->do_5(bytes, p0, p1, p2, p3, p4); 52 active_template->do_5(bytes, dest, p1, p2, p3, p4);
54} 53}
55EXPORT_SYMBOL(xor_blocks); 54EXPORT_SYMBOL(xor_blocks);
56 55
@@ -128,7 +127,7 @@ calibrate_xor_blocks(void)
128 fastest->name); 127 fastest->name);
129 xor_speed(fastest); 128 xor_speed(fastest);
130 } else { 129 } else {
131 printk(KERN_INFO "xor: measuring checksumming speed\n"); 130 printk(KERN_INFO "xor: measuring software checksum speed\n");
132 XOR_TRY_TEMPLATES; 131 XOR_TRY_TEMPLATES;
133 fastest = template_list; 132 fastest = template_list;
134 for (f = fastest; f; f = f->next) 133 for (f = fastest; f; f = f->next)