diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-04-03 22:31:14 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2019-04-03 22:37:41 -0400 |
commit | 27fad74a5a77fe2e1f876db7bf27efcf2ec304b2 (patch) | |
tree | 6bb49f75fdcc7e92b63379a99edb296c2888e5d6 /lib/iov_iter.c | |
parent | 18bfb9c6a8a5fbfe1a732130bb8f65fcfc4e8aa2 (diff) |
iov_iter: Fix build error without CONFIG_CRYPTO
If CONFIG_CRYPTO is not set or set to m,
gcc building warn this:
lib/iov_iter.o: In function `hash_and_copy_to_iter':
iov_iter.c:(.text+0x9129): undefined reference to `crypto_stats_get'
iov_iter.c:(.text+0x9152): undefined reference to `crypto_stats_ahash_update'
Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: d05f443554b3 ("iov_iter: introduce hash_and_copy_to_iter helper")
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'lib/iov_iter.c')
-rw-r--r-- | lib/iov_iter.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/iov_iter.c b/lib/iov_iter.c index ea36dc355da1..b396d328a764 100644 --- a/lib/iov_iter.c +++ b/lib/iov_iter.c | |||
@@ -1528,6 +1528,7 @@ EXPORT_SYMBOL(csum_and_copy_to_iter); | |||
1528 | size_t hash_and_copy_to_iter(const void *addr, size_t bytes, void *hashp, | 1528 | size_t hash_and_copy_to_iter(const void *addr, size_t bytes, void *hashp, |
1529 | struct iov_iter *i) | 1529 | struct iov_iter *i) |
1530 | { | 1530 | { |
1531 | #ifdef CONFIG_CRYPTO | ||
1531 | struct ahash_request *hash = hashp; | 1532 | struct ahash_request *hash = hashp; |
1532 | struct scatterlist sg; | 1533 | struct scatterlist sg; |
1533 | size_t copied; | 1534 | size_t copied; |
@@ -1537,6 +1538,9 @@ size_t hash_and_copy_to_iter(const void *addr, size_t bytes, void *hashp, | |||
1537 | ahash_request_set_crypt(hash, &sg, NULL, copied); | 1538 | ahash_request_set_crypt(hash, &sg, NULL, copied); |
1538 | crypto_ahash_update(hash); | 1539 | crypto_ahash_update(hash); |
1539 | return copied; | 1540 | return copied; |
1541 | #else | ||
1542 | return 0; | ||
1543 | #endif | ||
1540 | } | 1544 | } |
1541 | EXPORT_SYMBOL(hash_and_copy_to_iter); | 1545 | EXPORT_SYMBOL(hash_and_copy_to_iter); |
1542 | 1546 | ||