Skip to contentSkip to conversation

amdgpu_kms: Remove unnecessary condition check

PATCH Applied Aurabindo Pillai 2 participants 2 messages Apr 7, 2020 – Apr 8, 2020

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

PATCH 1/1 amdgpu_kms: Remove unnecessary condition check

Execution will only reach here if the asserted condition is true. Hence there is no need for the additional check.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +4 -6
index 60591dbc2..9fedfa531 100644
@@ -179,12 +179,10 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
 	/* Call ACPI methods: require modeset init
 	 * but failure is not fatal
 	 */
-	if (!r) {
-		acpi_status = amdgpu_acpi_init(adev);
-		if (acpi_status)
-			dev_dbg(&dev->pdev->dev,
-				"Error during ACPI methods call\n");
-	}
+
+	acpi_status = amdgpu_acpi_init(adev);
+	if (acpi_status)
+		dev_dbg(&dev->pdev->dev, "Error during ACPI methods call\n");
 
 	if (adev->runpm) {
 		dev_pm_set_driver_flags(dev->dev, DPM_FLAG_NEVER_SKIP);
Signature · 1 line
2.26.0
Applied
#1 lore raw
Quoted 5 lines · Aurabindo Pillai

Execution will only reach here if the asserted condition is true. Hence there is no need for the additional check.

Applied. Thanks!

Alex

Quoted 28 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +4 -7
index 60591dbc2..9fedfa531 100644
@@ -179,12 +179,10 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
        /* Call ACPI methods: require modeset init
         * but failure is not fatal
         */
-       if (!r) {
-               acpi_status = amdgpu_acpi_init(adev);
-               if (acpi_status)
-                       dev_dbg(&dev->pdev->dev,
-                               "Error during ACPI methods call\n");
-       }
+
+       acpi_status = amdgpu_acpi_init(adev);
+       if (acpi_status)
+               dev_dbg(&dev->pdev->dev, "Error during ACPI methods call\n");
 
        if (adev->runpm) {
                dev_pm_set_driver_flags(dev->dev, DPM_FLAG_NEVER_SKIP);
--

2.26.0

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx