Skip to content

Commit bf6a7a5

Browse files
arndbherbertx
authored andcommitted
crypto: hisilicon - avoid unused function warning
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: 79e09f3 ("crypto: hisilicon - add SRIOV support for ZIP") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 7888783 commit bf6a7a5

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/crypto/hisilicon/zip/zip_main.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,6 @@ static int hisi_zip_clear_vft_config(struct hisi_zip *hisi_zip)
785785

786786
static int hisi_zip_sriov_enable(struct pci_dev *pdev, int max_vfs)
787787
{
788-
#ifdef CONFIG_PCI_IOV
789788
struct hisi_zip *hisi_zip = pci_get_drvdata(pdev);
790789
int pre_existing_vfs, num_vfs, ret;
791790

@@ -815,9 +814,6 @@ static int hisi_zip_sriov_enable(struct pci_dev *pdev, int max_vfs)
815814
}
816815

817816
return num_vfs;
818-
#else
819-
return 0;
820-
#endif
821817
}
822818

823819
static int hisi_zip_sriov_disable(struct pci_dev *pdev)
@@ -948,7 +944,8 @@ static struct pci_driver hisi_zip_pci_driver = {
948944
.id_table = hisi_zip_dev_ids,
949945
.probe = hisi_zip_probe,
950946
.remove = hisi_zip_remove,
951-
.sriov_configure = hisi_zip_sriov_configure,
947+
.sriov_configure = IS_ENABLED(CONFIG_PCI_IOV) ?
948+
hisi_zip_sriov_configure : 0,
952949
.err_handler = &hisi_zip_err_handler,
953950
};
954951

0 commit comments

Comments
 (0)