mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi@lightbitslabs.com>
To: Al Viro <viro@zeniv.linux.org.uk>, Yue Haibing <yuehaibing@huawei.com>
Cc: davem@davemloft.net, willemb@google.com, edumazet@google.com,
	fw@strlen.de, 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 14:13:14 -0700	[thread overview]
Message-ID: <1e24c406-b1cb-cd03-d482-a6f95554f90d@lightbitslabs.com> (raw)
In-Reply-To: <20190403165215.GQ2217@ZenIV.linux.org.uk>


>> 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?

Looks better to me.

  reply	other threads:[~2019-04-03 21:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-03  9:50 Yue Haibing
2019-04-03 16:52 ` Al Viro
2019-04-03 21:13   ` Sagi Grimberg [this message]
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=1e24c406-b1cb-cd03-d482-a6f95554f90d@lightbitslabs.com \
    --to=sagi@lightbitslabs.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=viro@zeniv.linux.org.uk \
    --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

all inboxes | Powered by JetHome®