Skip to contentSkip to conversation

drm/amdgpu: use true and false for bool initialisations

PATCH Applied Sumera Priyadarsini 2 participants 2 messages Oct 26, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: use true and false for bool initialisations

Bool initialisation should use 'true' and 'false' values instead of 0 and 1.

Modify amdgpu_amdkfd_gpuvm.c to initialise variable is_imported to false instead of 0.

Issue found with Coccinelle.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +1 -1
index 64d4b5ff95d6..ba4bd06bfcc5 100644
@@ -1288,7 +1288,7 @@ int amdgpu_amdkfd_gpuvm_free_memory_of_gpu(
 	struct ttm_validate_buffer *bo_list_entry;
 	unsigned int mapped_to_gpu_memory;
 	int ret;
-	bool is_imported = 0;
+	bool is_imported = false;
 
 	mutex_lock(&mem->lock);
 	mapped_to_gpu_memory = mem->mapped_to_gpu_memory;
Signature · 1 line
2.25.1
Applied
#1 lore raw

Applied. Thanks!

Alex

Quoted 34 lines · Sumera Priyadarsini

Bool initialisation should use 'true' and 'false' values instead of 0 and 1.

Modify amdgpu_amdkfd_gpuvm.c to initialise variable is_imported to false instead of 0.

Issue found with Coccinelle.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +1 -2
index 64d4b5ff95d6..ba4bd06bfcc5 100644
@@ -1288,7 +1288,7 @@ int amdgpu_amdkfd_gpuvm_free_memory_of_gpu(
        struct ttm_validate_buffer *bo_list_entry;
        unsigned int mapped_to_gpu_memory;
        int ret;
-       bool is_imported = 0;
+       bool is_imported = false;
 
        mutex_lock(&mem->lock);
        mapped_to_gpu_memory = mem->mapped_to_gpu_memory;
--

2.25.1

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