drm/amdgpu: refine the scheduler job type conversion

Use container_of rather than casting.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: David Zhou <david1.zhou@amd.com>
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
This commit is contained in:
Junwei Zhang
2015-09-09 09:21:19 +08:00
committed by Alex Deucher
parent 4c7eb91cae
commit a6db8a33e1
3 changed files with 6 additions and 4 deletions

View File

@@ -1277,6 +1277,8 @@ struct amdgpu_job {
struct amdgpu_user_fence uf;
int (*free_job)(struct amdgpu_job *job);
};
#define to_amdgpu_job(sched_job) \
container_of((sched_job), struct amdgpu_job, base)
static inline u32 amdgpu_get_ib_value(struct amdgpu_cs_parser *p, uint32_t ib_idx, int idx)
{