summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-01-18 11:07:18 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2021-01-18 11:07:18 -0800
commitfd3958eac387593d02e4d4287658ba04bcdb235a (patch)
treeed25f9c826f2c1841babf923f8431017aa073126 /crypto
parent19c329f6808995b142b3966301f217c831e7cf31 (diff)
parent382811940303f7cd01d0f3dcdf432dfd89c5a98e (diff)
downloadlinux-fd3958eac387593d02e4d4287658ba04bcdb235a.tar.bz2
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu: "A Kconfig dependency issue with omap-sham and a divide by zero in xor on some platforms" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: omap-sham - Fix link error without crypto-engine crypto: xor - Fix divide error in do_xor_speed()
Diffstat (limited to 'crypto')
-rw-r--r--crypto/xor.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/xor.c b/crypto/xor.c
index eacbf4f93990..8f899f898ec9 100644
--- a/crypto/xor.c
+++ b/crypto/xor.c
@@ -107,6 +107,8 @@ do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2)
preempt_enable();
// bytes/ns == GB/s, multiply by 1000 to get MB/s [not MiB/s]
+ if (!min)
+ min = 1;
speed = (1000 * REPS * BENCH_SIZE) / (unsigned int)ktime_to_ns(min);
tmpl->speed = speed;