From patchwork Thu Sep 19 14:05:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11152545 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B3FF476 for ; Thu, 19 Sep 2019 14:07:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C21A2067B for ; Thu, 19 Sep 2019 14:07:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388656AbfISOHR (ORCPT ); Thu, 19 Sep 2019 10:07:17 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:42117 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387729AbfISOHQ (ORCPT ); Thu, 19 Sep 2019 10:07:16 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1MORIm-1iZmOB2Z3e-00PuQo; Thu, 19 Sep 2019 16:06:53 +0200 From: Arnd Bergmann To: Zhou Wang , Herbert Xu , "David S. Miller" Cc: Arnd Bergmann , Kenneth Lee , Shiju Jose , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] [v2] crypto: hisilicon - avoid unused function warning Date: Thu, 19 Sep 2019 16:05:52 +0200 Message-Id: <20190919140650.1289963-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:ZwJdmyrwyvAI76lZVS7F1Q8hQNWt/yXcQvcpDiKbJDFJbDM1PnS SCGltrDG4/QulNus1EXaz8kBZEpEXCtB/frd0rciuFNCTO+cYNMAVjrPCi28ANd2PY7Fe1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-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The only caller of hisi_zip_vf_q_assign() is hidden in an #ifdef, so the function causes a warning when CONFIG_PCI_IOV is disabled: drivers/crypto/hisilicon/zip/zip_main.c:740:12: error: unused function 'hisi_zip_vf_q_assign' [-Werror,-Wunused-function] Replace the #ifdef with an IS_ENABLED() check that leads to the function being dropped based on the configuration. Fixes: 79e09f30eeba ("crypto: hisilicon - add SRIOV support for ZIP") Signed-off-by: Arnd Bergmann --- drivers/crypto/hisilicon/zip/zip_main.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/hisilicon/zip/zip_main.c b/drivers/crypto/hisilicon/zip/zip_main.c index 6e0ca75585d4..1b2ee96c888d 100644 --- a/drivers/crypto/hisilicon/zip/zip_main.c +++ b/drivers/crypto/hisilicon/zip/zip_main.c @@ -785,7 +785,6 @@ static int hisi_zip_clear_vft_config(struct hisi_zip *hisi_zip) static int hisi_zip_sriov_enable(struct pci_dev *pdev, int max_vfs) { -#ifdef CONFIG_PCI_IOV struct hisi_zip *hisi_zip = pci_get_drvdata(pdev); int pre_existing_vfs, num_vfs, ret; @@ -815,9 +814,6 @@ static int hisi_zip_sriov_enable(struct pci_dev *pdev, int max_vfs) } return num_vfs; -#else - return 0; -#endif } static int hisi_zip_sriov_disable(struct pci_dev *pdev) @@ -948,7 +944,8 @@ static struct pci_driver hisi_zip_pci_driver = { .id_table = hisi_zip_dev_ids, .probe = hisi_zip_probe, .remove = hisi_zip_remove, - .sriov_configure = hisi_zip_sriov_configure, + .sriov_configure = IS_ENABLED(CONFIG_PCI_IOV) ? + hisi_zip_sriov_configure : 0, .err_handler = &hisi_zip_err_handler, };