linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm: sti: sti_hqvdp: Fix compilation warning.
@ 2017-06-20  4:55 Arvind Yadav
  2017-06-20 11:29 ` Benjamin Gaignard
  2017-06-20 11:54 ` kbuild test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Arvind Yadav @ 2017-06-20  4:55 UTC (permalink / raw)
  To: benjamin.gaignard, vincent.abriou, airlied; +Cc: dri-devel, linux-kernel

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=]

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm: sti: sti_hqvdp: Fix compilation warning.
  2017-06-20  4:55 [PATCH] drm: sti: sti_hqvdp: Fix compilation warning Arvind Yadav
@ 2017-06-20 11:29 ` Benjamin Gaignard
  2017-06-20 11:54 ` kbuild test robot
  1 sibling, 0 replies; 3+ messages in thread
From: Benjamin Gaignard @ 2017-06-20 11:29 UTC (permalink / raw)
  To: Arvind Yadav
  Cc: Vincent Abriou, David Airlie, dri-devel, Linux Kernel Mailing List

2017-06-20 6:55 GMT+02:00 Arvind Yadav <arvind.yadav.cs@gmail.com>:
> 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 <arvind.yadav.cs@gmail.com>
> ---
>  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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm: sti: sti_hqvdp: Fix compilation warning.
  2017-06-20  4:55 [PATCH] drm: sti: sti_hqvdp: Fix compilation warning Arvind Yadav
  2017-06-20 11:29 ` Benjamin Gaignard
@ 2017-06-20 11:54 ` kbuild test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2017-06-20 11:54 UTC (permalink / raw)
  To: Arvind Yadav
  Cc: kbuild-all, benjamin.gaignard, vincent.abriou, airlied,
	dri-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2441 bytes --]

Hi Arvind,

[auto build test WARNING on drm/drm-next]
[also build test WARNING on v4.12-rc6 next-20170620]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Arvind-Yadav/drm-sti-sti_hqvdp-Fix-compilation-warning/20170620-170709
base:   git://people.freedesktop.org/~airlied/linux.git drm-next
config: arm-multi_v7_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm 

All warnings (new ones prefixed by >>):

   In file included from include/drm/drm_gem_cma_helper.h:4:0,
                    from drivers/gpu/drm/sti/sti_hqvdp.c:14:
   drivers/gpu/drm/sti/sti_hqvdp.c: In function 'sti_hqvdp_start_xp70':
>> drivers/gpu/drm/sti/sti_hqvdp.c:929:13: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'unsigned int' [-Wformat=]
      DRM_ERROR("Invalid fmw structure (%lu+%d+%d+%d+%d != %zu)\n",
                ^
   include/drm/drmP.h:187:36: note: in definition of macro 'DRM_ERROR'
     drm_printk(KERN_ERR, DRM_UT_NONE, fmt, ##__VA_ARGS__)
                                       ^~~

vim +929 drivers/gpu/drm/sti/sti_hqvdp.c

   913			return;
   914		}
   915	
   916		/* Check firmware parts */
   917		if (!firmware) {
   918			DRM_ERROR("Firmware not available\n");
   919			return;
   920		}
   921	
   922		header = (struct fw_header *)firmware->data;
   923		if (firmware->size < sizeof(*header)) {
   924			DRM_ERROR("Invalid firmware size (%zu)\n", firmware->size);
   925			goto out;
   926		}
   927		if ((sizeof(*header) + header->rd_size + header->wr_size +
   928			header->pmem_size + header->dmem_size) != firmware->size) {
 > 929			DRM_ERROR("Invalid fmw structure (%lu+%d+%d+%d+%d != %zu)\n",
   930				  sizeof(*header), header->rd_size, header->wr_size,
   931				  header->pmem_size, header->dmem_size,
   932				  firmware->size);
   933			goto out;
   934		}
   935	
   936		data = (u8 *)firmware->data;
   937		data += sizeof(*header);

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 41341 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-20 11:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-20  4:55 [PATCH] drm: sti: sti_hqvdp: Fix compilation warning Arvind Yadav
2017-06-20 11:29 ` Benjamin Gaignard
2017-06-20 11:54 ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).