diff mbox

drm/amdgpu: remove an unnecessary condition

Message ID 20150611081924.GA27090@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter June 11, 2015, 8:19 a.m. UTC
We already checked "if (r)" so there is no need to check again.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Christian König June 11, 2015, 9:26 a.m. UTC | #1
On 11.06.2015 10:19, Dan Carpenter wrote:
> We already checked "if (r)" so there is no need to check again.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Hi Dan,

thanks for taking a look into this. This patch and the other two you 
send today are Reviewed-by: Christian König <christian.koenig@amd.com>

That code was branched of from Radeon it is possible that the same 
changes apply there as well. Since it looks like you created those 
patches at least partially automatically could you run your tool on the 
Radeon code once more as well?

Thanks in advance,
Christian.

>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index 5533434..b7d0425 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -111,12 +111,9 @@ 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 (amdgpu_device_is_px(dev)) {
>   		pm_runtime_use_autosuspend(dev->dev);
diff mbox

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 5533434..b7d0425 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -111,12 +111,9 @@  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 (amdgpu_device_is_px(dev)) {
 		pm_runtime_use_autosuspend(dev->dev);