[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190403165215.GQ2217@ZenIV.linux.org.uk>
Date: Wed, 3 Apr 2019 17:52:15 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: Yue Haibing <yuehaibing@...wei.com>
Cc: davem@...emloft.net, willemb@...gle.com, edumazet@...gle.com,
fw@...len.de, sagi@...htbitslabs.com, hch@....de,
pabeni@...hat.com, pctammela@...il.com,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH] iov_iter: Fix build error without CONFIG_CRYPTO
On Wed, Apr 03, 2019 at 05:50:31PM +0800, Yue Haibing wrote:
> From: YueHaibing <yuehaibing@...wei.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@...wei.com>
> Fixes: d05f443554b3 ("iov_iter: introduce hash_and_copy_to_iter helper")
> Signed-off-by: YueHaibing <yuehaibing@...wei.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?
Powered by blists - more mailing lists