Commit 2a32ca13 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by David S. Miller

hns3: fix unused function warning

Without CONFIG_PCI_IOV, we get a harmless warning about an
unused function:

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c:2273:13: error: 'hclge_disable_sriov' defined but not used [-Werror=unused-function]

The #ifdefs in this driver are obviously wrong, so this just
removes them and uses an IS_ENABLED() check that does the same
thing correctly in a more readable way.

Fixes: 46a3df9f ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fde6af47
...@@ -2272,7 +2272,6 @@ static void hclge_service_task(struct work_struct *work) ...@@ -2272,7 +2272,6 @@ static void hclge_service_task(struct work_struct *work)
static void hclge_disable_sriov(struct hclge_dev *hdev) static void hclge_disable_sriov(struct hclge_dev *hdev)
{ {
#ifdef CONFIG_PCI_IOV
/* If our VFs are assigned we cannot shut down SR-IOV /* If our VFs are assigned we cannot shut down SR-IOV
* without causing issues, so just leave the hardware * without causing issues, so just leave the hardware
* available but disabled * available but disabled
...@@ -2284,7 +2283,6 @@ static void hclge_disable_sriov(struct hclge_dev *hdev) ...@@ -2284,7 +2283,6 @@ static void hclge_disable_sriov(struct hclge_dev *hdev)
} }
pci_disable_sriov(hdev->pdev); pci_disable_sriov(hdev->pdev);
#endif
} }
struct hclge_vport *hclge_get_vport(struct hnae3_handle *handle) struct hclge_vport *hclge_get_vport(struct hnae3_handle *handle)
...@@ -4182,9 +4180,8 @@ static void hclge_uninit_ae_dev(struct hnae3_ae_dev *ae_dev) ...@@ -4182,9 +4180,8 @@ static void hclge_uninit_ae_dev(struct hnae3_ae_dev *ae_dev)
set_bit(HCLGE_STATE_DOWN, &hdev->state); set_bit(HCLGE_STATE_DOWN, &hdev->state);
#ifdef CONFIG_PCI_IOV if (IS_ENABLED(CONFIG_PCI_IOV))
hclge_disable_sriov(hdev); hclge_disable_sriov(hdev);
#endif
if (hdev->service_timer.data) if (hdev->service_timer.data)
del_timer_sync(&hdev->service_timer); del_timer_sync(&hdev->service_timer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment