crypto: ansi_cprng - Fix module initialization
[safe/jmp/linux-2.6] / crypto / xor.c
index 8281ac5..fc5b836 100644 (file)
 
 #define BH_TRACE 0
 #include <linux/module.h>
-#include <linux/raid/md.h>
 #include <linux/raid/xor.h>
+#include <linux/jiffies.h>
 #include <asm/xor.h>
 
 /* The xor routines to use.  */
 static struct xor_block_template *active_template;
 
 void
-xor_blocks(unsigned int count, unsigned int bytes, void **ptr)
+xor_blocks(unsigned int src_count, unsigned int bytes, void *dest, void **srcs)
 {
-       unsigned long *p0, *p1, *p2, *p3, *p4;
+       unsigned long *p1, *p2, *p3, *p4;
 
-       p0 = (unsigned long *) ptr[0];
-       p1 = (unsigned long *) ptr[1];
-       if (count == 2) {
-               active_template->do_2(bytes, p0, p1);
+       p1 = (unsigned long *) srcs[0];
+       if (src_count == 1) {
+               active_template->do_2(bytes, dest, p1);
                return;
        }
 
-       p2 = (unsigned long *) ptr[2];
-       if (count == 3) {
-               active_template->do_3(bytes, p0, p1, p2);
+       p2 = (unsigned long *) srcs[1];
+       if (src_count == 2) {
+               active_template->do_3(bytes, dest, p1, p2);
                return;
        }
 
-       p3 = (unsigned long *) ptr[3];
-       if (count == 4) {
-               active_template->do_4(bytes, p0, p1, p2, p3);
+       p3 = (unsigned long *) srcs[2];
+       if (src_count == 3) {
+               active_template->do_4(bytes, dest, p1, p2, p3);
                return;
        }
 
-       p4 = (unsigned long *) ptr[4];
-       active_template->do_5(bytes, p0, p1, p2, p3, p4);
+       p4 = (unsigned long *) srcs[3];
+       active_template->do_5(bytes, dest, p1, p2, p3, p4);
 }
 EXPORT_SYMBOL(xor_blocks);
 
@@ -102,7 +101,12 @@ calibrate_xor_blocks(void)
        void *b1, *b2;
        struct xor_block_template *f, *fastest;
 
-       b1 = (void *) __get_free_pages(GFP_KERNEL, 2);
+       /*
+        * Note: Since the memory is not actually used for _anything_ but to
+        * test the XOR speed, we don't really want kmemcheck to warn about
+        * reading uninitialized bytes here.
+        */
+       b1 = (void *) __get_free_pages(GFP_KERNEL | __GFP_NOTRACK, 2);
        if (!b1) {
                printk(KERN_WARNING "xor: Yikes!  No memory available.\n");
                return -ENOMEM;
@@ -128,7 +132,7 @@ calibrate_xor_blocks(void)
                        fastest->name);
                xor_speed(fastest);
        } else {
-               printk(KERN_INFO "xor: measuring checksumming speed\n");
+               printk(KERN_INFO "xor: measuring software checksum speed\n");
                XOR_TRY_TEMPLATES;
                fastest = template_list;
                for (f = fastest; f; f = f->next)