[PATCH 2/3] drm/amdgpu: fix compiler warning.

Deucher, Alexander Alexander.Deucher at amd.com
Thu Sep 8 12:36:00 UTC 2016


> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces at lists.freedesktop.org] On Behalf
> Of Rex Zhu
> Sent: Thursday, September 08, 2016 2:05 AM
> To: amd-gfx at lists.freedesktop.org
> Cc: Zhu, Rex
> Subject: [PATCH 2/3] drm/amdgpu: fix compiler warning.
> 
> no parentheses around assignment used as truth value.
> 
> Change-Id: I6bc4b74d3838a4d0c4c7a1b46c74a5d405e76f4e
> Signed-off-by: Rex Zhu <Rex.Zhu at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index f17fc6d..d497c11 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1977,7 +1977,8 @@ int amdgpu_device_resume(struct drm_device
> *dev, bool resume, bool fbcon)
>  	if (resume) {
>  		pci_set_power_state(dev->pdev, PCI_D0);
>  		pci_restore_state(dev->pdev);
> -		if (r = pci_enable_device(dev->pdev)) {
> +		r = pci_enable_device(dev->pdev);
> +		if (r != 0) {

This can be simplified to just:
if (r) {

With that fixed:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

>  			if (fbcon)
>  				console_unlock();
>  			return r;
> --
> 1.9.1
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list