浏览代码

drm/amdgpu: fix warning in scheduler

This should never happen so warn when the count does
not equal the expected size.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Alex Deucher 10 年之前
父节点
当前提交
5134e999cb
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      drivers/gpu/drm/amd/scheduler/gpu_scheduler.c

+ 3 - 2
drivers/gpu/drm/amd/scheduler/gpu_scheduler.c

@@ -332,7 +332,7 @@ static int amd_sched_main(void *param)
 {
 	struct sched_param sparam = {.sched_priority = 1};
 	struct amd_gpu_scheduler *sched = (struct amd_gpu_scheduler *)param;
-	int r;
+	int r, count;
 
 	sched_setscheduler(current, SCHED_FIFO, &sparam);
 
@@ -361,7 +361,8 @@ static int amd_sched_main(void *param)
 			fence_put(fence);
 		}
 
-		kfifo_out(&entity->job_queue, &job, sizeof(job));
+		count = kfifo_out(&entity->job_queue, &job, sizeof(job));
+		WARN_ON(count != sizeof(job));
 		wake_up(&sched->job_scheduled);
 	}
 	return 0;