From patchwork Tue Nov 10 12:17:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7590011 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4F17F9F1AF for ; Tue, 10 Nov 2015 12:18:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 637032065F for ; Tue, 10 Nov 2015 12:18:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9183D20650 for ; Tue, 10 Nov 2015 12:18:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B93F06E854; Tue, 10 Nov 2015 04:18:14 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id F34266E854 for ; Tue, 10 Nov 2015 04:18:12 -0800 (PST) Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0MORwj-1a1NCH258X-005nty; Tue, 10 Nov 2015 13:18:00 +0100 From: Arnd Bergmann To: Christian =?ISO-8859-1?Q?K=F6nig?= , Dave Airlie Subject: [PATCH] drm/amdgpu: fix seq_printf format string Date: Tue, 10 Nov 2015 13:17:55 +0100 Message-ID: <6655728.oIVJfmhexk@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:GRbBPFoeEdZzq4JDt3DWCdCHOGVnW8IXBb9MtUnKD8GMI2TCahH mtou9+EVsY0kJ81eBILHv2Xzl6ApUslTpKsSN8zEJqBM9VaiuFuTCkyl+8iKVQeVfJ57GXG HmLsB3nTH6CDI7NeRZm2P5glYhEkJu4GNoZaYVO0S9iZnlP0vKRJ5oP1g8nMsHj5RhcfQDy 4BmpDEfxuaEbePNVDvn6Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:VIncryxLRYQ=:XinwSySnFmtHX1+qxBRbZL UKSijZO6Qhartw0IOrFgC4jHyCZLWT3+MI1BeNs5hnhWd3zUtpAmK/7K7i0owwFSWRQEVYIO4 Ouhbu5Gs6DkNDmouXHmrQqO8J2klPXbT5dkcKpVX6JnUhN0QNgapfKbs47SuK2kEqLgCTDG+V Nba7VY0bmuGhs5B4PqS+aEexcBk8d2vxPGE4rCmKMrXuizN/xpu9Q0RmdBJzMyKDNRGz9LLwE 9hFhMO2papf9wIcQvgxUYsV38BZECVZuzbhIQncxL9v/Q4Ztzh2dnkiB3dqVxdvVQXQGjYel3 L8jzgUuO04LV5DP7R9xVWsWbti0NhWIBOOHGUcJp8EYdCvnfLwUjy+Lz95HwDfZXvOSyP4hhb 6NjwUbM6+CM/vb79/YWxuW9J+HGVCz410d3Ry0wJjxUvbX2QQpDo0vvXGzgOEVS0vyGPCt9Av nKc9cnoMJtN32hlljU2VTcvKKWkCfic9rnywbtJk4JMYtlIO9yPgoBYUlksQH5CJNByGNWwAh Z+43i0FLTzm+KgV3iK5A9Z3MCRw+KuvAEUC//PY65OBU3PnVM3Hc5hxr4Oqr8uwSsmCm48527 csvnjz8NY/Wu4qDymhHkb0ZvWHjD1enMKVeg8OoBReE2PBpVyCPAd+9UrdhsSxQZfOjHbgHSD 9gzm+DgWRYKvGfLx0jb4zyxqk6YnzHWtcVRLGnU3AC4CA4DEcMqaj6g9js06KXyezzR1WTV0N G0sAdS57bEubKQeU Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Fixes: a2ef8a974931 ("drm/amdgpu: add vram usage into debugfs") --- This appeared a few weeks ago with ARM allmodconfig. I was waiting for someone to complain about the warning on x86 first, but that apparently has not happened. 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) ret = drm_mm_dump_table(m, mm); spin_unlock(&glob->lru_lock); if (ttm_pl == TTM_PL_VRAM) - seq_printf(m, "man size:%llu pages, ram usage:%luMB, vis usage:%luMB\n", + seq_printf(m, "man size:%llu pages, ram usage:%lluMB, vis usage:%lluMB\n", adev->mman.bdev.man[ttm_pl].size, - atomic64_read(&adev->vram_usage) >> 20, - atomic64_read(&adev->vram_vis_usage) >> 20); + (u64)atomic64_read(&adev->vram_usage) >> 20, + (u64)atomic64_read(&adev->vram_vis_usage) >> 20); return ret; }