drivers: net: xgene: Move status variable declaration into CONFIG_ACPI block
authorNathan Chancellor <natechancellor@gmail.com>
Fri, 26 Jul 2019 16:20:37 +0000 (09:20 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 27 Jul 2019 21:17:55 +0000 (14:17 -0700)
When CONFIG_ACPI is unset (arm allyesconfig), status is unused.

drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c:383:14: warning:
unused variable 'status' [-Wunused-variable]
        acpi_status status;
                    ^
drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c:440:14: warning:
unused variable 'status' [-Wunused-variable]
        acpi_status status;
                    ^
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c:697:14: warning: unused
variable 'status' [-Wunused-variable]
        acpi_status status;
                    ^

Move the declaration into the CONFIG_ACPI block so that there are no
compiler warnings.

Fixes: 570d785ba46b ("drivers: net: xgene: Remove acpi_has_method() calls")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c
drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c

index 79924efd4ab7a66c1a2763a1080ba1ee591aaa52..5f657879134ed2b1a5ca94c32025ef8436468b74 100644 (file)
@@ -694,7 +694,6 @@ bool xgene_ring_mgr_init(struct xgene_enet_pdata *p)
 static int xgene_enet_reset(struct xgene_enet_pdata *pdata)
 {
        struct device *dev = &pdata->pdev->dev;
-       acpi_status status;
 
        if (!xgene_ring_mgr_init(pdata))
                return -ENODEV;
@@ -713,6 +712,8 @@ static int xgene_enet_reset(struct xgene_enet_pdata *pdata)
                udelay(5);
        } else {
 #ifdef CONFIG_ACPI
+               acpi_status status;
+
                status = acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
                                              "_RST", NULL, NULL);
                if (ACPI_FAILURE(status)) {
index 3b3dc5b25b29c21db22e64d3251e59aba0c1791e..f482ced2cadd9c36c681af7312abdf2bdfeda662 100644 (file)
@@ -437,7 +437,6 @@ static void xgene_sgmac_tx_disable(struct xgene_enet_pdata *p)
 static int xgene_enet_reset(struct xgene_enet_pdata *p)
 {
        struct device *dev = &p->pdev->dev;
-       acpi_status status;
 
        if (!xgene_ring_mgr_init(p))
                return -ENODEV;
@@ -461,6 +460,8 @@ static int xgene_enet_reset(struct xgene_enet_pdata *p)
                }
        } else {
 #ifdef CONFIG_ACPI
+               acpi_status status;
+
                status = acpi_evaluate_object(ACPI_HANDLE(&p->pdev->dev),
                                              "_RST", NULL, NULL);
                if (ACPI_FAILURE(status)) {
index 78584089d76d2dcf6d87952a7806e7245ac7df95..304b5d43f2369d0a93f7c0b8f7ef2f0656e291b1 100644 (file)
@@ -380,7 +380,6 @@ static void xgene_xgmac_tx_disable(struct xgene_enet_pdata *pdata)
 static int xgene_enet_reset(struct xgene_enet_pdata *pdata)
 {
        struct device *dev = &pdata->pdev->dev;
-       acpi_status status;
 
        if (!xgene_ring_mgr_init(pdata))
                return -ENODEV;
@@ -394,6 +393,8 @@ static int xgene_enet_reset(struct xgene_enet_pdata *pdata)
                udelay(5);
        } else {
 #ifdef CONFIG_ACPI
+               acpi_status status;
+
                status = acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
                                              "_RST", NULL, NULL);
                if (ACPI_FAILURE(status)) {