Skip to contentSkip to conversation

drivers: net: xgene: Move status variable declaration into CONFIG_ACPI block

PATCH Applied Nathan Chancellor 2 participants 2 messages Jul 26, 2019 – Jul 27, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: net: xgene: Move status variable declaration into CONFIG_ACPI block

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")
---
 drivers/net/ethernet/apm/xgene/xgene_enet_hw.c    | 3 ++-
 drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c | 3 ++-
 drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c +2 -1
index 79924efd4ab7..5f657879134e 100644
@@ -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)) {
drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c +2 -1
index 3b3dc5b25b29..f482ced2cadd 100644
@@ -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)) {
drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c +2 -1
index 78584089d76d..304b5d43f236 100644
@@ -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)) {
Signature · 1 line
2.22.0
maintainer Applied
#1 lore raw

From: Nathan Chancellor <[email protected]>
Date: Fri, 26 Jul 2019 09:20:37 -0700

Quoted 15 lines

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;
                    ^
Quoted 5 lines

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")

Applied.