From: Al Viro <viro@zeniv.linux.org.uk>
To: Yue Haibing <yuehaibing@huawei.com>
Cc: davem@davemloft.net, willemb@google.com, edumazet@google.com,
fw@strlen.de, sagi@lightbitslabs.com, hch@lst.de,
pabeni@redhat.com, pctammela@gmail.com,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] iov_iter: Fix build error without CONFIG_CRYPTO
Date: Wed, 3 Apr 2019 17:52:15 +0100 [thread overview]
Message-ID: <20190403165215.GQ2217@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20190403095031.11720-1-yuehaibing@huawei.com>
On Wed, Apr 03, 2019 at 05:50:31PM +0800, Yue Haibing wrote:
> 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>
I'm not sure it's the right fix; might be better to have something like
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;
copied = copy_to_iter(addr, bytes, i);
sg_init_one(&sg, addr, copied);
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);
instead. Objections?
next prev parent reply other threads:[~2019-04-03 16:52 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 [this message]
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
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=20190403165215.GQ2217@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--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=willemb@google.com \
--cc=yuehaibing@huawei.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).