linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yue Haibing <yuehaibing@huawei.com>
To: <davem@davemloft.net>, <viro@zeniv.linux.org.uk>,
	<willemb@google.com>, <edumazet@google.com>, <fw@strlen.de>,
	<sagi@lightbitslabs.com>, <hch@lst.de>, <pabeni@redhat.com>,
	<pctammela@gmail.com>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	YueHaibing <yuehaibing@huawei.com>
Subject: [PATCH v2] iov_iter: Fix build error without CONFIG_CRYPTO
Date: Thu, 4 Apr 2019 10:31:14 +0800	[thread overview]
Message-ID: <20190404023114.30304-1-yuehaibing@huawei.com> (raw)
In-Reply-To: <20190403095031.11720-1-yuehaibing@huawei.com>

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")
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
---
 lib/iov_iter.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 50e77ec..f74fa83 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -1531,6 +1531,7 @@ EXPORT_SYMBOL(csum_and_copy_to_iter);
 size_t hash_and_copy_to_iter(const void *addr, size_t bytes, void *hashp,
 		struct iov_iter *i)
 {
+#ifdef CONFIG_CRYPTO
 	struct ahash_request *hash = hashp;
 	struct scatterlist sg;
 	size_t copied;
@@ -1540,6 +1541,9 @@ size_t hash_and_copy_to_iter(const void *addr, size_t bytes, void *hashp,
 	ahash_request_set_crypt(hash, &sg, NULL, copied);
 	crypto_ahash_update(hash);
 	return copied;
+#else
+	return 0;
+#endif
 }
 EXPORT_SYMBOL(hash_and_copy_to_iter);
 
-- 
2.7.4



  parent reply	other threads:[~2019-04-04  2:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Yue Haibing [this message]
2019-04-04  2:38   ` [PATCH v2] " Al Viro
2019-04-04  2:40   ` YueHaibing
2019-04-04  2:39 ` Yue Haibing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190404023114.30304-1-yuehaibing@huawei.com \
    --to=yuehaibing@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pctammela@gmail.com \
    --cc=sagi@lightbitslabs.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).