gpu: drm/amd: Fix the bug in list_for_each_entry() loops
Subsystems (3)
PATCH 1/1 gpu: drm/amd: Fix the bug in list_for_each_entry() loops
pqn bound in list_for_each_entry loop will not be null, so there is no need to check whether pqn is NULL or not.
We could remove this check.
Signed-off-by Lu Hongfei <[email protected]>
--- drivers/gpu/drm/amd/amdkfd/kfd_debug.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_debug.c +0 -3
@@ -1097,9 +1097,6 @@ void kfd_dbg_set_enabled_debug_exception_mask(struct kfd_process *target, pqm = &target->pqm;list_for_each_entry (pqn, &pqm->queues, process_queue_list) { -if (!pqn) -continue ; - found_mask |= pqn->q->properties.exception_status; }
Signature · 1 line
2.39.0
Quoted 2 lines
pqn bound in
list_for_each_entryloop will not be null, so there is no need to check whether pqn is NULL or not.
Would it be more appropriate to use the wording “Delete an unnecessary check within a list_for_each_entry() loop” instead of
“Fix the bug in list_for_each_entry() loops” in the patch subject?
Quoted 1 line
We could remove this check.
I suggest to use the sentence “Thus remove a redundant null pointer check.”.
Regards,
Markus