Noticed by Neil Horman: we are doing unnecessary kmap/kunmap calls
on kmalloced memory. This patch removes them. For the purposes of
testing SG construction, the underlying crypto code already does plenty
of kmap/kunmap calls anyway.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#include <linux/scatterlist.h>
#include <linux/string.h>
#include <linux/crypto.h>
#include <linux/scatterlist.h>
#include <linux/string.h>
#include <linux/crypto.h>
-#include <linux/highmem.h>
#include <linux/moduleparam.h>
#include <linux/jiffies.h>
#include <linux/timex.h>
#include <linux/moduleparam.h>
#include <linux/jiffies.h>
#include <linux/timex.h>
- * Need to kmalloc() memory for testing kmap().
+ * Need to kmalloc() memory for testing.
*/
#define TVMEMSIZE 16384
#define XBUFSIZE 32768
*/
#define TVMEMSIZE 16384
#define XBUFSIZE 32768
- q = kmap(sg_page(&sg[0])) + sg[0].offset;
hexdump(q, template[i].rlen);
printk(KERN_INFO "enc/dec: %s\n",
memcmp(q, template[i].result,
template[i].rlen) ? "fail" : "pass");
hexdump(q, template[i].rlen);
printk(KERN_INFO "enc/dec: %s\n",
memcmp(q, template[i].result,
template[i].rlen) ? "fail" : "pass");
- kunmap(sg_page(&sg[0]));
next_one:
if (!template[i].key)
kfree(key);
next_one:
if (!template[i].key)
kfree(key);
for (k = 0, temp = 0; k < template[i].np; k++) {
printk(KERN_INFO "page %u\n", k);
for (k = 0, temp = 0; k < template[i].np; k++) {
printk(KERN_INFO "page %u\n", k);
- q = kmap(sg_page(&sg[k])) + sg[k].offset;
hexdump(q, template[i].tap[k]);
printk(KERN_INFO "%s\n",
memcmp(q, template[i].result + temp,
hexdump(q, template[i].tap[k]);
printk(KERN_INFO "%s\n",
memcmp(q, template[i].result + temp,
}
temp += template[i].tap[k];
}
temp += template[i].tap[k];
- kunmap(sg_page(&sg[k]));
- q = kmap(sg_page(&sg[0])) + sg[0].offset;
hexdump(q, template[i].rlen);
printk("%s\n",
memcmp(q, template[i].result,
template[i].rlen) ? "fail" : "pass");
hexdump(q, template[i].rlen);
printk("%s\n",
memcmp(q, template[i].result,
template[i].rlen) ? "fail" : "pass");
- kunmap(sg_page(&sg[0]));
temp = 0;
for (k = 0; k < template[i].np; k++) {
printk("page %u\n", k);
temp = 0;
for (k = 0; k < template[i].np; k++) {
printk("page %u\n", k);
- q = kmap(sg_page(&sg[k])) + sg[k].offset;
hexdump(q, template[i].tap[k]);
printk("%s\n",
memcmp(q, template[i].result + temp,
hexdump(q, template[i].tap[k]);
printk("%s\n",
memcmp(q, template[i].result + temp,
hexdump(&q[template[i].tap[k]], n);
}
temp += template[i].tap[k];
hexdump(&q[template[i].tap[k]], n);
}
temp += template[i].tap[k];
- kunmap(sg_page(&sg[k]));