linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] amdgpu_kms: Remove unnecessary condition check
@ 2020-04-07 18:26 Aurabindo Pillai
  2020-04-08 13:43 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Aurabindo Pillai @ 2020-04-07 18:26 UTC (permalink / raw)
  To: alexander.deucher, christian.koenig, David1.Zhou
  Cc: airlied, daniel, amd-gfx, dri-devel, linux-kernel

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

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] amdgpu_kms: Remove unnecessary condition check
  2020-04-07 18:26 [PATCH] amdgpu_kms: Remove unnecessary condition check Aurabindo Pillai
@ 2020-04-08 13:43 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2020-04-08 13:43 UTC (permalink / raw)
  To: Aurabindo Pillai
  Cc: Deucher, Alexander, Christian Koenig, Chunming Zhou, Dave Airlie,
	Maling list - DRI developers, amd-gfx list, Daniel Vetter, LKML

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-08 13:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-07 18:26 [PATCH] amdgpu_kms: Remove unnecessary condition check Aurabindo Pillai
2020-04-08 13:43 ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).