From patchwork Wed Oct 7 10:41:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7344011 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0E1C5BEEA4 for ; Wed, 7 Oct 2015 10:41:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 384E420751 for ; Wed, 7 Oct 2015 10:41:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B750F20748 for ; Wed, 7 Oct 2015 10:41:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DC2D26E148; Wed, 7 Oct 2015 03:41:32 -0700 (PDT) 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.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id B6C496E148 for ; Wed, 7 Oct 2015 03:41:31 -0700 (PDT) Received: from wuerfel.localnet ([149.172.15.242]) by mrelayeu.kundenserver.de (mreue103) with ESMTPSA (Nemesis) id 0MBr6d-1ZsGDk3cdr-00AlKR; Wed, 07 Oct 2015 12:41:23 +0200 From: Arnd Bergmann To: Dave Airlie , Gerd Hoffmann Subject: [PATCH] drm/virtio: use %llu format string form atomic64_t Date: Wed, 07 Oct 2015 12:41:21 +0200 Message-ID: <5082760.FgB9zHNfte@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:6CZtzdiRPzqO/rPwP/4ORWKRnVPq50wG/Aad5b5+71Tvn5zjHow qXGAfdYfvoBfYXld7MPTdRyK/2vrE0maJCZ4K3RiZxD2RDbYXuAmzLOyhgRQP4OrdQDj/d0 SCeOGtDxE4UorpEl+tbtB7pz+87oDWDhqrHkU90ijbu5CPMVaxAcTixJH060IgVoXbxjMOu WMKH8177ih3mCt3Yd+cAg== X-UI-Out-Filterresults: notjunk:1; V01:K0:in2G0vLxQ+g=:Tvsk64nvAg5qa1POFvvKof GQgKG7tmwk85AuRbeOj6sQda5WsHEoUEcc1GZiXW4yyWMkiIPgYPercdCbFQY6mQxav0QPjMV kUj8s6iXpNbrUmM6Z5YXOL1ZTniQi+HP3u7CbvsptbMTgi8eSz7mC20CWoNOJbz+SyPyoZgVk sW+mmAg2moEI2fng/o1po1wAua3fLUPL+QqaJMdf3ZcIgJIxCrgWImHa0KC84jj6C1QU5u2QN XiOm/v64coQFSB4mSN1jofVaUu6b9SLZEKSaoqWN1WFhAkYuQTjDzVBFyGKSGgbjKMkcixS0u GP5w6h7Cqi1aRtCk+aglQWHGLqERd6x4P51MiTr/APMx0p4/OpRv5f5Z2nEC0geGWARlHaD2v 27hcYxSaeZ5LWtheKXxny0RIJ/p4Ztub/gLorzycb0vTAvDu16ZnKQsWyuxKlSOa9xF7G6BxG AodeYBOGknIj2qHng17UgK71sGAz0xyq7hF8otU5U/POaE9XmxT2tq75DgI6SiMmn5magPny6 4yZEIxyR7iH3EVQ3vHnRmtVffxVnclR+UOQBfYz9V4HtXvN0Wmsta5D38fTTJ8P+qJL/OROT+ Ce8hEMzEoY64h+/LfcBFsccK+pRcpT4Ak4XaTsQiFUDxGaJg+4nJySII+LhFAv/X4ODJK9yVP dgfnXnzqq835zYIOj+jbBahT4bvo/ztaesi7Mf2Z9Fd4GA/03jdm0KdsPu1fm5YU+SVdRAfSh Fl3D/vWFWqUNmGBd Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 virtgpu driver prints the last_seq variable using the %ld or %lu format string, which does not work correctly on all architectures and causes this compiler warning on ARM: drivers/gpu/drm/virtio/virtgpu_fence.c: In function 'virtio_timeline_value_str': drivers/gpu/drm/virtio/virtgpu_fence.c:64:22: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'long long int' [-Wformat=] snprintf(str, size, "%lu", atomic64_read(&fence->drv->last_seq)); ^ drivers/gpu/drm/virtio/virtgpu_debugfs.c: In function 'virtio_gpu_debugfs_irq_info': drivers/gpu/drm/virtio/virtgpu_debugfs.c:37:16: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'long long int' [-Wformat=] seq_printf(m, "fence %ld %lld\n", ^ In order to avoid the warnings, this changes the format strings to %llu and adds a cast to u64, which makes it work the same way everywhere. Signed-off-by: Arnd Bergmann diff --git a/drivers/gpu/drm/virtio/virtgpu_debugfs.c b/drivers/gpu/drm/virtio/virtgpu_debugfs.c index db8b49101a8b..512263919282 100644 --- a/drivers/gpu/drm/virtio/virtgpu_debugfs.c +++ b/drivers/gpu/drm/virtio/virtgpu_debugfs.c @@ -34,8 +34,8 @@ virtio_gpu_debugfs_irq_info(struct seq_file *m, void *data) struct drm_info_node *node = (struct drm_info_node *) m->private; struct virtio_gpu_device *vgdev = node->minor->dev->dev_private; - seq_printf(m, "fence %ld %lld\n", - atomic64_read(&vgdev->fence_drv.last_seq), + seq_printf(m, "fence %llu %lld\n", + (u64)atomic64_read(&vgdev->fence_drv.last_seq), vgdev->fence_drv.sync_seq); return 0; } diff --git a/drivers/gpu/drm/virtio/virtgpu_fence.c b/drivers/gpu/drm/virtio/virtgpu_fence.c index 1da632631dac..67097c9ce9c1 100644 --- a/drivers/gpu/drm/virtio/virtgpu_fence.c +++ b/drivers/gpu/drm/virtio/virtgpu_fence.c @@ -61,7 +61,7 @@ static void virtio_timeline_value_str(struct fence *f, char *str, int size) { struct virtio_gpu_fence *fence = to_virtio_fence(f); - snprintf(str, size, "%lu", atomic64_read(&fence->drv->last_seq)); + snprintf(str, size, "%llu", (u64)atomic64_read(&fence->drv->last_seq)); } static const struct fence_ops virtio_fence_ops = {