gpu:No need to cast kmalloc() return values in AMD kfd driver
Subsystems (4)
PATCH 12/15 gpu:No need to cast kmalloc() return values in AMD kfd driver
kmalloc() returns a void pointer - no need to cast it in drivers/gpu/drm/amd/amdkfd/kfd_process.c::kfd_process_destroy_delayed()
Signed-off-by Firo Yang <[email protected]>
--- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_process.c +1 -2
@@ -203,8 +203,7 @@ static void kfd_process_destroy_delayed(struct rcu_head *rcu)mmdrop (p->mm); - work = (struct kfd_process_release_work *) -kmalloc (sizeof (struct kfd_process_release_work ),GFP_ATOMIC ); + work =kmalloc (sizeof (struct kfd_process_release_work ),GFP_ATOMIC );if (work) {INIT_WORK ((struct work_struct *) work, kfd_process_wq_release);
Signature · 1 line
2.1.0
Again, gpu does not seem like the right information for the subject line. git log --oneline for this file shows multiple uses of amdkfd.
julia
Quoted 26 lines · Firo Yang
kmalloc()returns a void pointer - no need to cast it in drivers/gpu/drm/amd/amdkfd/kfd_process.c::kfd_process_destroy_delayed()Signed-off-by Firo Yang <[email protected]>--- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_process.c +1
-3@@ -203,8 +203,7 @@ static void kfd_process_destroy_delayed(struct rcu_head *rcu)mmdrop (p->mm); - work = (struct kfd_process_release_work *) -kmalloc (sizeof (struct kfd_process_release_work ),GFP_ATOMIC ); + work =kmalloc (sizeof (struct kfd_process_release_work ),GFP_ATOMIC );if (work) {INIT_WORK ((struct work_struct *) work, kfd_process_wq_release); --2.1.0