Skip to contentSkip to conversation

drm: radeon: ni_dpm: Fix unused variable warning when CONFIG_ACPI=n

PATCH In review Fabio Estevam 2 participants 3 messages Nov 9, 2013 – Nov 14, 2013

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

PATCH 1/2 drm: radeon: ni_dpm: Fix unused variable warning when CONFIG_ACPI=n

From: Fabio Estevam <[email protected]>

With CONFIG_ACPI=n the following build warning is seen:

drivers/gpu/drm/radeon/ni_dpm.c:3448:31: warning: unused variable 'eg_pi' [-Wunused-variable]

Move the definition of eg_pi inside the CONFIG_ACPI 'if' block.

---
 drivers/gpu/drm/radeon/ni_dpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/ni_dpm.c +1 -1
index f263390..cdc0030 100644
@@ -3445,9 +3445,9 @@ static int ni_enable_smc_cac(struct radeon_device *rdev,
 static int ni_pcie_performance_request(struct radeon_device *rdev,
 				       u8 perf_req, bool advertise)
 {
+#if defined(CONFIG_ACPI)
 	struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
 
-#if defined(CONFIG_ACPI)
 	if ((perf_req == PCIE_PERF_REQ_PECI_GEN1) ||
             (perf_req == PCIE_PERF_REQ_PECI_GEN2)) {
 		if (eg_pi->pcie_performance_request_registered == false)
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 2/2 drm: radeon: cypress_dpm: Fix unused variable warning when CONFIG_ACPI=n

From: Fabio Estevam <[email protected]>

With CONFIG_ACPI=n the following build warning is seen:

drivers/gpu/drm/radeon/cypress_dpm.c:302:31: warning: unused variable 'eg_pi' [-Wunused-variable]

Move the definition of eg_pi inside the CONFIG_ACPI 'if' block.

---
 drivers/gpu/drm/radeon/cypress_dpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/cypress_dpm.c +1 -1
index 91bb470..a231c59 100644
@@ -299,7 +299,6 @@ void cypress_program_response_times(struct radeon_device *rdev)
 static int cypress_pcie_performance_request(struct radeon_device *rdev,
 					    u8 perf_req, bool advertise)
 {
-	struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
 	u32 tmp;
 
 	udelay(10);
@@ -308,6 +307,7 @@ static int cypress_pcie_performance_request(struct radeon_device *rdev,
 		return 0;
 
 #if defined(CONFIG_ACPI)
+	struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
 	if ((perf_req == PCIE_PERF_REQ_PECI_GEN1) ||
 	    (perf_req == PCIE_PERF_REQ_PECI_GEN2)) {
 		eg_pi->pcie_performance_request_registered = true;
Signature · 1 line
1.8.1.2
#2 lore raw
In reply to Fabio Estevam
Quoted 9 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

With CONFIG_ACPI=n the following build warning is seen:

drivers/gpu/drm/radeon/ni_dpm.c:3448:31: warning: unused variable 'eg_pi' [-Wunused-variable]

Move the definition of eg_pi inside the CONFIG_ACPI 'if' block.

Added to my queue. For 2/2, I changed it a bit to not mix code and declarations.

Alex

Quoted 26 lines
---
 drivers/gpu/drm/radeon/ni_dpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/ni_dpm.c +1 -2
index f263390..cdc0030 100644
@@ -3445,9 +3445,9 @@ static int ni_enable_smc_cac(struct radeon_device *rdev,
 static int ni_pcie_performance_request(struct radeon_device *rdev,
                                       u8 perf_req, bool advertise)
 {
+#if defined(CONFIG_ACPI)
        struct evergreen_power_info *eg_pi = evergreen_get_pi(rdev);
 
-#if defined(CONFIG_ACPI)
        if ((perf_req == PCIE_PERF_REQ_PECI_GEN1) ||
             (perf_req == PCIE_PERF_REQ_PECI_GEN2)) {
                if (eg_pi->pcie_performance_request_registered == false)
--

1.8.1.2

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel