diff options
author | Monk Liu <monk.liu@amd.com> | 2017-08-10 08:38:41 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-08-29 15:27:45 -0400 |
commit | 172423bcc7654a9cc71ff208b8f797e5e11a08af (patch) | |
tree | 6eba9d71390d2974c1343a74da0763e54f8643c8 | |
parent | 7e96a13523af12645b7e18d7cc268a95b72ff026 (diff) |
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: Monk Liu <monk.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index cba11f13d994..180ce6296416 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
@@ -109,8 +109,8 @@ static ssize_t ttm_bo_global_show(struct kobject *kobj, | |||
109 | struct ttm_bo_global *glob = | 109 | struct ttm_bo_global *glob = |
110 | container_of(kobj, struct ttm_bo_global, kobj); | 110 | container_of(kobj, struct ttm_bo_global, kobj); |
111 | 111 | ||
112 | return snprintf(buffer, PAGE_SIZE, "%lu\n", | 112 | return snprintf(buffer, PAGE_SIZE, "%d\n", |
113 | (unsigned long) atomic_read(&glob->bo_count)); | 113 | atomic_read(&glob->bo_count)); |
114 | } | 114 | } |
115 | 115 | ||
116 | static struct attribute *ttm_bo_global_attrs[] = { | 116 | static struct attribute *ttm_bo_global_attrs[] = { |