OSDN Git Service

drm/amdgpu: remove conversion to bool in amdgpu_device.c
authorJason Yan <yanaijie@huawei.com>
Mon, 27 Apr 2020 06:36:55 +0000 (14:36 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 27 Apr 2020 19:52:16 +0000 (15:52 -0400)
The '>' expression itself is bool, no need to convert it to bool again.
This fixes the following coccicheck warning:

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:3004:68-73: WARNING:
conversion to bool not needed here

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index 11f7c4e..09ede17 100644 (file)
@@ -2998,7 +2998,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
        INIT_WORK(&adev->xgmi_reset_work, amdgpu_device_xgmi_reset_func);
 
        adev->gfx.gfx_off_req_count = 1;
-       adev->pm.ac_power = power_supply_is_system_supplied() > 0 ? true : false;
+       adev->pm.ac_power = power_supply_is_system_supplied() > 0;
 
        /* Registers mapping */
        /* TODO: block userspace mapping of io register */