amdgpu_kms: Remove unnecessary condition check
diff mbox series

Message ID 20200407182618.2488-1-mail@aurabindo.in
State In Next
Commit 8679b224f8fba1a13ed06189b6df96d0f7d054e1
Headers show
Series
  • amdgpu_kms: Remove unnecessary condition check
Related show

Commit Message

Aurabindo Pillai April 7, 2020, 6:26 p.m. UTC
Execution will only reach here if the asserted condition is true.
Hence there is no need for the additional check.

Signed-off-by: Aurabindo Pillai <mail@aurabindo.in>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Alex Deucher April 8, 2020, 1:43 p.m. UTC | #1
On Tue, Apr 7, 2020 at 2:30 PM Aurabindo Pillai <mail@aurabindo.in> wrote:
>
> Execution will only reach here if the asserted condition is true.
> Hence there is no need for the additional check.
>
> Signed-off-by: Aurabindo Pillai <mail@aurabindo.in>

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index 60591dbc2..9fedfa531 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -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
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Patch
diff mbox series

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 60591dbc2..9fedfa531 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -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);