From patchwork Thu Apr 4 02:31:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yue Haibing X-Patchwork-Id: 1076680 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44ZRt32Q90z9sSr for ; Thu, 4 Apr 2019 13:36:59 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726544AbfDDCgw (ORCPT ); Wed, 3 Apr 2019 22:36:52 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5661 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726218AbfDDCgw (ORCPT ); Wed, 3 Apr 2019 22:36:52 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [10.3.19.207]) by Forcepoint Email with ESMTP id 3F807CB4D015F2E2C497; Thu, 4 Apr 2019 10:36:50 +0800 (CST) Received: from localhost (10.177.31.96) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.408.0; Thu, 4 Apr 2019 10:36:43 +0800 From: Yue Haibing To: , , , , , , , , CC: , , YueHaibing Subject: [PATCH v2] iov_iter: Fix build error without CONFIG_CRYPTO Date: Thu, 4 Apr 2019 10:31:14 +0800 Message-ID: <20190404023114.30304-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 In-Reply-To: <20190403095031.11720-1-yuehaibing@huawei.com> References: <20190403095031.11720-1-yuehaibing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.31.96] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: YueHaibing 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 Fixes: d05f443554b3 ("iov_iter: introduce hash_and_copy_to_iter helper") Suggested-by: Al Viro Signed-off-by: YueHaibing --- --- 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);