Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2536506ybi; Mon, 17 Jun 2019 06:33:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8WMFVbPm7gOGHmoIMAeb7utPHQBZDSTEhgnW8uu+g+gA5Hc7D92QwSdoS1aAG+5UcAaVu X-Received: by 2002:aa7:9ad2:: with SMTP id x18mr33967348pfp.192.1560778381953; Mon, 17 Jun 2019 06:33:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560778381; cv=none; d=google.com; s=arc-20160816; b=XSsmRBFg62/mouIuksbPkVNsofp8gTFrf+D0LNm3KWEUTZ6RvojzKJcaHOYjT3ey3y blPg2etEXFTFgnw5NtaZ1b/VjJ/6hQ0qOIHuydiLgxo2irBMfbqt/AuTPdLDJh36UJHf ptCouooR1wWrJq5d2q6Rn986c6kKIhF+owjjQQiX8b+uRhGOmy11yuA8PRdtWPU35/HL cSIP4mu5cJ+gFuHA94++mEgyiqKz8TZyEIyH4OsG+xNPjARypC/birSlBcjzfXW6BAdH AAUe0qiD//wkuoHYr/KB+ScKZG9pXxYI95dd2zo9cEGMdfefRbrxZTeiSZVyY5L3W25d Uvlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=JSFjA2M4Qxh3Xz6yTtLNp872fm2q94azOFBSnkUM0lc=; b=kbY2GwKz5nNeKxaF3sgyzljZL6szx7PMT4n9PA99KjZArL8XSC/sxswnGacBa80EtX /v4CMFw02ZA5AXPafFfrIODmiJ83y9SVDTcy5TpM0wSvCsr9R+AQTwf7VXUv/S2mkTmL J0lMx31l0CZP1Xol2pdaPU+Kipwpa1wn854HOESSLd0hG5/5/L7S8t2hUAMjcwxmK1H7 HVN/m4aKImLNR/85aYmkCGj1opDWda3KIKPCJ3TixQnlM8r0LnAk/YPWx8iGz8Ury5NB 3DUrr7gavlCavIjTd7BB1am6jJfWmqkdKZJKl5nzk4oAMKUOeeWKdyOlJNlTkHv53fj2 QeAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p19si10609177pgk.309.2019.06.17.06.32.45; Mon, 17 Jun 2019 06:33:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726920AbfFQNcQ (ORCPT + 99 others); Mon, 17 Jun 2019 09:32:16 -0400 Received: from foss.arm.com ([217.140.110.172]:50142 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725884AbfFQNcP (ORCPT ); Mon, 17 Jun 2019 09:32:15 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C3CC8344; Mon, 17 Jun 2019 06:32:14 -0700 (PDT) Received: from e110455-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A43BE3F246; Mon, 17 Jun 2019 06:32:14 -0700 (PDT) Received: by e110455-lin.cambridge.arm.com (Postfix, from userid 1000) id 67DD5682413; Mon, 17 Jun 2019 14:32:13 +0100 (BST) Date: Mon, 17 Jun 2019 14:32:13 +0100 From: Liviu Dudau To: Arnd Bergmann Cc: "James (Qian) Wang" , Brian Starkey , David Airlie , Daniel Vetter , "Lowry Li (Arm Technology China)" , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/komeda: fix size_t format string Message-ID: <20190617133213.GY4173@e110455-lin.cambridge.arm.com> References: <20190617125002.1312331-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190617125002.1312331-1-arnd@arndb.de> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On Mon, Jun 17, 2019 at 02:49:18PM +0200, Arnd Bergmann wrote: > The debug output uses the wrong format string for printing a size_t: > > In file included from include/drm/drm_mm.h:49, > from include/drm/drm_vma_manager.h:26, > from include/drm/drm_gem.h:40, > from drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c:9: > drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c: In function 'komeda_fb_afbc_size_check': > drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c:96:17: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Werror=format=] > DRM_DEBUG_KMS("afbc size check failed, obj_size: 0x%lx. min_size 0x%x.\n", > > This is harmless in the kernel as size_t and long are always the same > width, but it's always better to use the correct format string > to shut up the warning. > > Fixes: 9ccf536e53cb ("drm/komeda: Added AFBC support for komeda driver") > Signed-off-by: Arnd Bergmann Thank you for the patch! I did see the warning email sent by the build bots and I've had the same fix in my stash, but then I've looked at the code using min_size and I'm not happy with it, so I've asked James to come up with a patch to fix things in a better way. So, if you don't mind, I will delay this patch until James comes up with a fix in the next couple of days. If he is not, then I'll pull the patch into mali-dp tree (shared with komeda). Best regards, Liviu > --- > drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c > index abc8c0ccc053..58ff34e718d0 100644 > --- a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c > @@ -93,7 +93,7 @@ komeda_fb_afbc_size_check(struct komeda_fb *kfb, struct drm_file *file, > AFBC_SUPERBLK_ALIGNMENT); > min_size = kfb->afbc_size + fb->offsets[0]; > if (min_size > obj->size) { > - DRM_DEBUG_KMS("afbc size check failed, obj_size: 0x%lx. min_size 0x%x.\n", > + DRM_DEBUG_KMS("afbc size check failed, obj_size: 0x%zx. min_size 0x%x.\n", > obj->size, min_size); > goto check_failed; > } > @@ -137,7 +137,7 @@ komeda_fb_none_afbc_size_check(struct komeda_dev *mdev, struct komeda_fb *kfb, > min_size = komeda_fb_get_pixel_addr(kfb, 0, fb->height, i) > - to_drm_gem_cma_obj(obj)->paddr; > if (obj->size < min_size) { > - DRM_DEBUG_KMS("The fb->obj[%d] size: %ld lower than the minimum requirement: %d.\n", > + DRM_DEBUG_KMS("The fb->obj[%d] size: %zd lower than the minimum requirement: %d.\n", > i, obj->size, min_size); > return -EINVAL; > } > -- > 2.20.0 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯