Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751446AbdFTL3R (ORCPT ); Tue, 20 Jun 2017 07:29:17 -0400 Received: from mail-qk0-f180.google.com ([209.85.220.180]:34559 "EHLO mail-qk0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750925AbdFTL3Q (ORCPT ); Tue, 20 Jun 2017 07:29:16 -0400 MIME-Version: 1.0 In-Reply-To: <25d78b6834eb4cf99b1b71eb2f28178ecbadc166.1497934297.git.arvind.yadav.cs@gmail.com> References: <25d78b6834eb4cf99b1b71eb2f28178ecbadc166.1497934297.git.arvind.yadav.cs@gmail.com> From: Benjamin Gaignard Date: Tue, 20 Jun 2017 13:29:15 +0200 Message-ID: Subject: Re: [PATCH] drm: sti: sti_hqvdp: Fix compilation warning. To: Arvind Yadav Cc: Vincent Abriou , David Airlie , "dri-devel@lists.freedesktop.org" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v5KBTRG8015006 Content-Length: 2184 Lines: 46 2017-06-20 6:55 GMT+02:00 Arvind Yadav : > Replace '%d' by '%zu' and '%lu' to fix the following compilation warning:- > > drivers/gpu/drm/sti/sti_hqvdp.c: In function ‘sti_hqvdp_start_xp70’: > drivers/gpu/drm/sti/sti_hqvdp.c:925:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat=] > DRM_ERROR("Invalid firmware size (%d)\n", firmware->size); > ^ > drivers/gpu/drm/sti/sti_hqvdp.c:930:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long unsigned int’ [-Wformat=] > DRM_ERROR("Invalid fmw structure (%d+%d+%d+%d+%d != %d)\n", > ^ > drivers/gpu/drm/sti/sti_hqvdp.c:930:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 9 has type ‘size_t’ [-Wformat=] I do not manage to reproduce the warnings on my side so I will merge this patch yet. Regards Benjamin > > Signed-off-by: Arvind Yadav > --- > drivers/gpu/drm/sti/sti_hqvdp.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c > index 66f8431..267d816 100644 > --- a/drivers/gpu/drm/sti/sti_hqvdp.c > +++ b/drivers/gpu/drm/sti/sti_hqvdp.c > @@ -922,12 +922,12 @@ static void sti_hqvdp_start_xp70(struct sti_hqvdp *hqvdp) > > header = (struct fw_header *)firmware->data; > if (firmware->size < sizeof(*header)) { > - DRM_ERROR("Invalid firmware size (%d)\n", firmware->size); > + DRM_ERROR("Invalid firmware size (%zu)\n", firmware->size); > goto out; > } > if ((sizeof(*header) + header->rd_size + header->wr_size + > header->pmem_size + header->dmem_size) != firmware->size) { > - DRM_ERROR("Invalid fmw structure (%d+%d+%d+%d+%d != %d)\n", > + DRM_ERROR("Invalid fmw structure (%lu+%d+%d+%d+%d != %zu)\n", > sizeof(*header), header->rd_size, header->wr_size, > header->pmem_size, header->dmem_size, > firmware->size); > -- > 1.9.1 >