Commit ab703932 authored by Monk Liu's avatar Monk Liu Committed by Alex Deucher

drm/ttm:fix wrong decoding of bo_count

we observe abnormal number from:
/sys/devices/virtual/drm/amdttm/buffer_objects/bo_count

bo_count is atomic_inc which is "int" type,
shouldn't explicitly turn it to unsigned long.
Signed-off-by: default avatarMonk Liu <monk.liu@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a101a41f
...@@ -109,8 +109,8 @@ static ssize_t ttm_bo_global_show(struct kobject *kobj, ...@@ -109,8 +109,8 @@ static ssize_t ttm_bo_global_show(struct kobject *kobj,
struct ttm_bo_global *glob = struct ttm_bo_global *glob =
container_of(kobj, struct ttm_bo_global, kobj); container_of(kobj, struct ttm_bo_global, kobj);
return snprintf(buffer, PAGE_SIZE, "%lu\n", return snprintf(buffer, PAGE_SIZE, "%d\n",
(unsigned long) atomic_read(&glob->bo_count)); atomic_read(&glob->bo_count));
} }
static struct attribute *ttm_bo_global_attrs[] = { static struct attribute *ttm_bo_global_attrs[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment