Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Nathan Chancellor and committed by
David S. Miller
85d2c5cd ddfbee9e

+6 -3
+2 -1
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
··· 694 694 static int xgene_enet_reset(struct xgene_enet_pdata *pdata) 695 695 { 696 696 struct device *dev = &pdata->pdev->dev; 697 - acpi_status status; 698 697 699 698 if (!xgene_ring_mgr_init(pdata)) 700 699 return -ENODEV; ··· 712 713 udelay(5); 713 714 } else { 714 715 #ifdef CONFIG_ACPI 716 + acpi_status status; 717 + 715 718 status = acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev), 716 719 "_RST", NULL, NULL); 717 720 if (ACPI_FAILURE(status)) {
+2 -1
drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c
··· 437 437 static int xgene_enet_reset(struct xgene_enet_pdata *p) 438 438 { 439 439 struct device *dev = &p->pdev->dev; 440 - acpi_status status; 441 440 442 441 if (!xgene_ring_mgr_init(p)) 443 442 return -ENODEV; ··· 460 461 } 461 462 } else { 462 463 #ifdef CONFIG_ACPI 464 + acpi_status status; 465 + 463 466 status = acpi_evaluate_object(ACPI_HANDLE(&p->pdev->dev), 464 467 "_RST", NULL, NULL); 465 468 if (ACPI_FAILURE(status)) {
+2 -1
drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c
··· 380 380 static int xgene_enet_reset(struct xgene_enet_pdata *pdata) 381 381 { 382 382 struct device *dev = &pdata->pdev->dev; 383 - acpi_status status; 384 383 385 384 if (!xgene_ring_mgr_init(pdata)) 386 385 return -ENODEV; ··· 393 394 udelay(5); 394 395 } else { 395 396 #ifdef CONFIG_ACPI 397 + acpi_status status; 398 + 396 399 status = acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev), 397 400 "_RST", NULL, NULL); 398 401 if (ACPI_FAILURE(status)) {