netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iov_iter: Fix build error without CONFIG_CRYPTO
@ 2019-04-03  9:50 Yue Haibing
  2019-04-03 16:52 ` Al Viro
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Yue Haibing @ 2019-04-03  9:50 UTC (permalink / raw)
  To: davem, viro, willemb, edumazet, fw, sagi, hch, pabeni, pctammela
  Cc: linux-kernel, netdev, YueHaibing

From: YueHaibing <yuehaibing@huawei.com>

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")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 include/linux/skbuff.h | 2 ++
 lib/iov_iter.c         | 2 ++
 net/core/datagram.c    | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 9027a8c..3999112 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3396,9 +3396,11 @@ static inline int skb_copy_datagram_msg(const struct sk_buff *from, int offset,
 }
 int skb_copy_and_csum_datagram_msg(struct sk_buff *skb, int hlen,
 				   struct msghdr *msg);
+#ifdef CONFIG_CRYPTO
 int skb_copy_and_hash_datagram_iter(const struct sk_buff *skb, int offset,
 			   struct iov_iter *to, int len,
 			   struct ahash_request *hash);
+#endif
 int skb_copy_datagram_from_iter(struct sk_buff *skb, int offset,
 				 struct iov_iter *from, int len);
 int zerocopy_sg_from_iter(struct sk_buff *skb, struct iov_iter *frm);
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 50e77ec..ed02f74 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -1528,6 +1528,7 @@ size_t csum_and_copy_to_iter(const void *addr, size_t bytes, void *csump,
 }
 EXPORT_SYMBOL(csum_and_copy_to_iter);
 
+#ifdef CONFIG_CRYPTO
 size_t hash_and_copy_to_iter(const void *addr, size_t bytes, void *hashp,
 		struct iov_iter *i)
 {
@@ -1542,6 +1543,7 @@ size_t hash_and_copy_to_iter(const void *addr, size_t bytes, void *hashp,
 	return copied;
 }
 EXPORT_SYMBOL(hash_and_copy_to_iter);
+#endif
 
 int iov_iter_npages(const struct iov_iter *i, int maxpages)
 {
diff --git a/net/core/datagram.c b/net/core/datagram.c
index 91bb5a0..8815ec2 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -494,6 +494,7 @@ static int __skb_datagram_iter(const struct sk_buff *skb, int offset,
 	return 0;
 }
 
+#ifdef CONFIG_CRYPTO
 /**
  *	skb_copy_and_hash_datagram_iter - Copy datagram to an iovec iterator
  *          and update a hash.
@@ -511,6 +512,7 @@ int skb_copy_and_hash_datagram_iter(const struct sk_buff *skb, int offset,
 			hash_and_copy_to_iter, hash);
 }
 EXPORT_SYMBOL(skb_copy_and_hash_datagram_iter);
+#endif
 
 static size_t simple_copy_to_iter(const void *addr, size_t bytes,
 		void *data __always_unused, struct iov_iter *i)
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-04-04  2:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-03  9:50 [PATCH] iov_iter: Fix build error without CONFIG_CRYPTO Yue Haibing
2019-04-03 16:52 ` Al Viro
2019-04-03 21:13   ` Sagi Grimberg
2019-04-04  2:18   ` YueHaibing
2019-04-04  2:31 ` [PATCH v2] " Yue Haibing
2019-04-04  2:38   ` Al Viro
2019-04-04  2:40   ` YueHaibing
2019-04-04  2:39 ` Yue Haibing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).