Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: remove useless condition in amdgpu_job_stop_all_jobs_on_sched()

Local variable 'rq' is initialized by an address
of field of drm_sched_job, so it does not make
sense to compare 'rq' with NULL.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: Andrey Strachuk <strochuk@ispras.ru>
Fixes: 7c6e68c777f1 ("drm/amdgpu: Avoid HW GPU reset for RAS.")
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Andrey Strachuk and committed by
Alex Deucher
bf7f7efb 1af9add1

-4
-4
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
··· 272 272 /* Signal all jobs not yet scheduled */ 273 273 for (i = DRM_SCHED_PRIORITY_COUNT - 1; i >= DRM_SCHED_PRIORITY_MIN; i--) { 274 274 struct drm_sched_rq *rq = &sched->sched_rq[i]; 275 - 276 - if (!rq) 277 - continue; 278 - 279 275 spin_lock(&rq->lock); 280 276 list_for_each_entry(s_entity, &rq->entities, list) { 281 277 while ((s_job = to_drm_sched_job(spsc_queue_pop(&s_entity->job_queue)))) {