From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AA81C433E0 for ; Thu, 21 May 2020 21:09:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D55B1207D3 for ; Thu, 21 May 2020 21:09:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D55B1207D3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 572536E20F; Thu, 21 May 2020 21:09:30 +0000 (UTC) Received: from asavdk4.altibox.net (asavdk4.altibox.net [109.247.116.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 138896E20F for ; Thu, 21 May 2020 21:09:29 +0000 (UTC) Received: from ravnborg.org (unknown [158.248.194.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by asavdk4.altibox.net (Postfix) with ESMTPS id A1330804A3; Thu, 21 May 2020 23:09:25 +0200 (CEST) Date: Thu, 21 May 2020 23:09:24 +0200 From: Sam Ravnborg To: Lyude Paul Subject: Re: [PATCH] drm/vblank: Fix -Wformat compile warnings on some arches Message-ID: <20200521210924.GA1056842@ravnborg.org> References: <20200521204647.2578479-1-lyude@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200521204647.2578479-1-lyude@redhat.com> X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=MOBOZvRl c=1 sm=1 tr=0 a=UWs3HLbX/2nnQ3s7vZ42gw==:117 a=UWs3HLbX/2nnQ3s7vZ42gw==:17 a=kj9zAlcOel0A:10 a=20KFwNOVAAAA:8 a=e5mUnYsNAAAA:8 a=pm5h8qfB858e3dYQ7kEA:9 a=CjuIK1q_8ugA:10 a=Vxmtnl_E_bksehYqCbjh:22 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Dave Airlie , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, May 21, 2020 at 04:46:47PM -0400, Lyude Paul wrote: > On some architectures like ppc64le and aarch64, compiling with > -Wformat=1 will throw the following warnings: > > In file included from drivers/gpu/drm/drm_vblank.c:33: > drivers/gpu/drm/drm_vblank.c: In function 'drm_update_vblank_count': > drivers/gpu/drm/drm_vblank.c:273:16: warning: format '%llu' expects > argument of type 'long long unsigned int', but argument 4 has type > 'long int' [-Wformat=] > DRM_DEBUG_VBL("updating vblank count on crtc %u:" > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ./include/drm/drm_print.h:407:22: note: in definition of macro > 'DRM_DEBUG_VBL' > drm_dbg(DRM_UT_VBL, fmt, ##__VA_ARGS__) > ^~~ > drivers/gpu/drm/drm_vblank.c:274:22: note: format string is defined here > " current=%llu, diff=%u, hw=%u hw_last=%u\n", > ~~~^ > %lu > > So, fix that with a typecast. > > Signed-off-by: Lyude Paul > Co-developed-by: Dave Airlie > --- > drivers/gpu/drm/drm_vblank.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c > index acb3c3f65b579..1a96db2dd16fa 100644 > --- a/drivers/gpu/drm/drm_vblank.c > +++ b/drivers/gpu/drm/drm_vblank.c > @@ -342,7 +342,7 @@ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe, > > DRM_DEBUG_VBL("updating vblank count on crtc %u:" > " current=%llu, diff=%u, hw=%u hw_last=%u\n", > - pipe, atomic64_read(&vblank->count), diff, > + pipe, (unsigned long long)atomic64_read(&vblank->count), diff, > cur_vblank, vblank->last); While touching this you could consider introducing drm_dbg_vbl(). An maybe as a follow-up patch replace all logging in this file with the drm_* variants. Sam > > if (diff == 0) { > -- > 2.26.2 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel