diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2015-11-10 07:17:55 -0500 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2015-11-16 11:05:55 -0500 |
| commit | e1b35f6103b37e0d81184b32906b7010170dda02 (patch) | |
| tree | 2e8ec1974d1f13fd63062574c5b82a0c3a028f3e /drivers | |
| parent | 515c752dabee9945c1e8686c87f7cdeb3935eea4 (diff) | |
drm/amdgpu: fix seq_printf format string
The amdgpu driver has a debugfs interface that shows the amount of
VRAM in use, but the newly added code causes a build error on
all 32-bit architectures:
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1076:17: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'long long int' [-Wformat=]
This fixes the format string to use "%llu" for printing 64-bit
numbers, which works everywhere, as long as we also cast to 'u64'.
Unlike atomic64_t, u64 is defined as 'unsigned long long' on
all architectures.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: a2ef8a974931 ("drm/amdgpu: add vram usage into debugfs")
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 81bb8e9fc26d..d4bac5f49939 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | |||
| @@ -1073,10 +1073,10 @@ static int amdgpu_mm_dump_table(struct seq_file *m, void *data) | |||
| 1073 | ret = drm_mm_dump_table(m, mm); | 1073 | ret = drm_mm_dump_table(m, mm); |
| 1074 | spin_unlock(&glob->lru_lock); | 1074 | spin_unlock(&glob->lru_lock); |
| 1075 | if (ttm_pl == TTM_PL_VRAM) | 1075 | if (ttm_pl == TTM_PL_VRAM) |
| 1076 | seq_printf(m, "man size:%llu pages, ram usage:%luMB, vis usage:%luMB\n", | 1076 | seq_printf(m, "man size:%llu pages, ram usage:%lluMB, vis usage:%lluMB\n", |
| 1077 | adev->mman.bdev.man[ttm_pl].size, | 1077 | adev->mman.bdev.man[ttm_pl].size, |
| 1078 | atomic64_read(&adev->vram_usage) >> 20, | 1078 | (u64)atomic64_read(&adev->vram_usage) >> 20, |
| 1079 | atomic64_read(&adev->vram_vis_usage) >> 20); | 1079 | (u64)atomic64_read(&adev->vram_vis_usage) >> 20); |
| 1080 | return ret; | 1080 | return ret; |
| 1081 | } | 1081 | } |
| 1082 | 1082 | ||
