Skip to contentSkip to conversation

drm/amdgpu: remove conversion to bool in amdgpu_device.c

PATCH Applied Jason Yan 3 participants 3 messages Apr 27, 2020

Subsystems (3)
lore
Share & tools
lore

Jason Yan

author
#0 lore raw

PATCH 1/1 drm/amdgpu: remove conversion to bool in amdgpu_device.c

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

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
index 3d601d5dd5af..ad94de3632d8 100644
@@ -3000,7 +3000,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 */
Signature · 1 line
2.21.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Am 27.04.20 um 08:36 schrieb Jason Yan:

Quoted 7 lines

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

Quoted 9 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 3d601d5dd5af..ad94de3632d8 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_init(struct amdgpu_device *adev, · line 3006

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
@@ -3000,7 +3000,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 */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Applied
#2 lore raw

Applied. thanks!

Alex

Quoted 27 lines · Christian König

Am 27.04.20 um 08:36 schrieb Jason Yan:

Quoted 7 lines

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

Quoted 15 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
index 3d601d5dd5af..ad94de3632d8 100644
@@ -3000,7 +3000,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;
 
Quoted 7 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_init(struct amdgpu_device *adev, · line 3006

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
      /* Registers mapping */
      /* TODO: block userspace mapping of io register */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx