Using the pointer is not adequate.
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
if (!id)
continue;
- if (atomic_long_read(&id->owner) != (long)vm)
+ if (atomic_long_read(&id->owner) != vm->client_id)
continue;
if (pd_addr != id->pd_gpu_addr)
list_move_tail(&id->list, &adev->vm_manager.ids_lru);
id->last_user = ring;
- atomic_long_set(&id->owner, (long)vm);
+ atomic_long_set(&id->owner, vm->client_id);
vm->ids[ring->idx] = id;
*vm_id = id - adev->vm_manager.ids;
list) {
if (!id)
continue;
- if (atomic_long_read(&id->owner) == (long)vm) {
+ if (atomic_long_read(&id->owner) == vm->client_id) {
atomic_long_set(&id->owner, 0);
id->pd_gpu_addr = 0;
}