diff options
Diffstat (limited to 'crypto/xor.c')
-rw-r--r-- | crypto/xor.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/xor.c b/crypto/xor.c index b75182d8ab14..87884435bddb 100644 --- a/crypto/xor.c +++ b/crypto/xor.c | |||
@@ -63,7 +63,7 @@ static void | |||
63 | do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2) | 63 | do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2) |
64 | { | 64 | { |
65 | int speed; | 65 | int speed; |
66 | unsigned long now; | 66 | unsigned long now, j; |
67 | int i, count, max; | 67 | int i, count, max; |
68 | 68 | ||
69 | tmpl->next = template_list; | 69 | tmpl->next = template_list; |
@@ -76,9 +76,11 @@ do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2) | |||
76 | */ | 76 | */ |
77 | max = 0; | 77 | max = 0; |
78 | for (i = 0; i < 5; i++) { | 78 | for (i = 0; i < 5; i++) { |
79 | now = jiffies; | 79 | j = jiffies; |
80 | count = 0; | 80 | count = 0; |
81 | while (jiffies == now) { | 81 | while ((now = jiffies) == j) |
82 | cpu_relax(); | ||
83 | while (time_before(jiffies, now + 1)) { | ||
82 | mb(); /* prevent loop optimzation */ | 84 | mb(); /* prevent loop optimzation */ |
83 | tmpl->do_2(BENCH_SIZE, b1, b2); | 85 | tmpl->do_2(BENCH_SIZE, b1, b2); |
84 | mb(); | 86 | mb(); |