linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vfio/pci: use correct format characters
@ 2019-02-28 19:48 Louis Taylor
  2019-02-28 20:45 ` Nick Desaulniers
  2019-04-03 18:52 ` Alex Williamson
  0 siblings, 2 replies; 3+ messages in thread
From: Louis Taylor @ 2019-02-28 19:48 UTC (permalink / raw)
  To: alex.williamson
  Cc: aik, kvm, linux-kernel, clang-built-linux, ndesaulniers, jflat,
	Louis Taylor

When compiling with -Wformat, clang emits the following warnings:

drivers/vfio/pci/vfio_pci.c:1601:5: warning: format specifies type
      'unsigned short' but the argument has type 'unsigned int' [-Wformat]
                                vendor, device, subvendor, subdevice,
                                ^~~~~~

drivers/vfio/pci/vfio_pci.c:1601:13: warning: format specifies type
      'unsigned short' but the argument has type 'unsigned int' [-Wformat]
                                vendor, device, subvendor, subdevice,
                                        ^~~~~~

drivers/vfio/pci/vfio_pci.c:1601:21: warning: format specifies type
      'unsigned short' but the argument has type 'unsigned int' [-Wformat]
                                vendor, device, subvendor, subdevice,
                                                ^~~~~~~~~

drivers/vfio/pci/vfio_pci.c:1601:32: warning: format specifies type
      'unsigned short' but the argument has type 'unsigned int' [-Wformat]
                                vendor, device, subvendor, subdevice,
                                                           ^~~~~~~~~

drivers/vfio/pci/vfio_pci.c:1605:5: warning: format specifies type
      'unsigned short' but the argument has type 'unsigned int' [-Wformat]
                                vendor, device, subvendor, subdevice,
                                ^~~~~~

drivers/vfio/pci/vfio_pci.c:1605:13: warning: format specifies type
      'unsigned short' but the argument has type 'unsigned int' [-Wformat]
                                vendor, device, subvendor, subdevice,
                                        ^~~~~~

drivers/vfio/pci/vfio_pci.c:1605:21: warning: format specifies type
      'unsigned short' but the argument has type 'unsigned int' [-Wformat]
                                vendor, device, subvendor, subdevice,
                                                ^~~~~~~~~

drivers/vfio/pci/vfio_pci.c:1605:32: warning: format specifies type
      'unsigned short' but the argument has type 'unsigned int' [-Wformat]
                                vendor, device, subvendor, subdevice,
                                                           ^~~~~~~~~
The types of these arguments are unconditionally defined, so this patch
updates the format character to the correct ones for unsigned ints.

Link: https://github.com/ClangBuiltLinux/linux/issues/378
Signed-off-by: Louis Taylor <louis@kragniz.eu>
---
 drivers/vfio/pci/vfio_pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
index a25659b5a5d1..3fa20e95a6bb 100644
--- a/drivers/vfio/pci/vfio_pci.c
+++ b/drivers/vfio/pci/vfio_pci.c
@@ -1661,11 +1661,11 @@ static void __init vfio_pci_fill_ids(void)
 		rc = pci_add_dynid(&vfio_pci_driver, vendor, device,
 				   subvendor, subdevice, class, class_mask, 0);
 		if (rc)
-			pr_warn("failed to add dynamic id [%04hx:%04hx[%04hx:%04hx]] class %#08x/%08x (%d)\n",
+			pr_warn("failed to add dynamic id [%04x:%04x[%04x:%04x]] class %#08x/%08x (%d)\n",
 				vendor, device, subvendor, subdevice,
 				class, class_mask, rc);
 		else
-			pr_info("add [%04hx:%04hx[%04hx:%04hx]] class %#08x/%08x\n",
+			pr_info("add [%04x:%04x[%04x:%04x]] class %#08x/%08x\n",
 				vendor, device, subvendor, subdevice,
 				class, class_mask);
 	}
-- 
2.20.1


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

* Re: [PATCH] vfio/pci: use correct format characters
  2019-02-28 19:48 [PATCH] vfio/pci: use correct format characters Louis Taylor
@ 2019-02-28 20:45 ` Nick Desaulniers
  2019-04-03 18:52 ` Alex Williamson
  1 sibling, 0 replies; 3+ messages in thread
From: Nick Desaulniers @ 2019-02-28 20:45 UTC (permalink / raw)
  To: Louis Taylor
  Cc: alex.williamson, aik, kvm, LKML, clang-built-linux, Jon Flatley

On Thu, Feb 28, 2019 at 11:49 AM Louis Taylor <louis@kragniz.eu> wrote:
>
> When compiling with -Wformat, clang emits the following warnings:
>
> drivers/vfio/pci/vfio_pci.c:1601:5: warning: format specifies type
>       'unsigned short' but the argument has type 'unsigned int' [-Wformat]
>                                 vendor, device, subvendor, subdevice,
>                                 ^~~~~~
>
> drivers/vfio/pci/vfio_pci.c:1601:13: warning: format specifies type
>       'unsigned short' but the argument has type 'unsigned int' [-Wformat]
>                                 vendor, device, subvendor, subdevice,
>                                         ^~~~~~
>
> drivers/vfio/pci/vfio_pci.c:1601:21: warning: format specifies type
>       'unsigned short' but the argument has type 'unsigned int' [-Wformat]
>                                 vendor, device, subvendor, subdevice,
>                                                 ^~~~~~~~~
>
> drivers/vfio/pci/vfio_pci.c:1601:32: warning: format specifies type
>       'unsigned short' but the argument has type 'unsigned int' [-Wformat]
>                                 vendor, device, subvendor, subdevice,
>                                                            ^~~~~~~~~
>
> drivers/vfio/pci/vfio_pci.c:1605:5: warning: format specifies type
>       'unsigned short' but the argument has type 'unsigned int' [-Wformat]
>                                 vendor, device, subvendor, subdevice,
>                                 ^~~~~~
>
> drivers/vfio/pci/vfio_pci.c:1605:13: warning: format specifies type
>       'unsigned short' but the argument has type 'unsigned int' [-Wformat]
>                                 vendor, device, subvendor, subdevice,
>                                         ^~~~~~
>
> drivers/vfio/pci/vfio_pci.c:1605:21: warning: format specifies type
>       'unsigned short' but the argument has type 'unsigned int' [-Wformat]
>                                 vendor, device, subvendor, subdevice,
>                                                 ^~~~~~~~~
>
> drivers/vfio/pci/vfio_pci.c:1605:32: warning: format specifies type
>       'unsigned short' but the argument has type 'unsigned int' [-Wformat]
>                                 vendor, device, subvendor, subdevice,
>                                                            ^~~~~~~~~
> The types of these arguments are unconditionally defined, so this patch
> updates the format character to the correct ones for unsigned ints.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/378
> Signed-off-by: Louis Taylor <louis@kragniz.eu>

Thanks for the patch! LGTM
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
>  drivers/vfio/pci/vfio_pci.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
> index a25659b5a5d1..3fa20e95a6bb 100644
> --- a/drivers/vfio/pci/vfio_pci.c
> +++ b/drivers/vfio/pci/vfio_pci.c
> @@ -1661,11 +1661,11 @@ static void __init vfio_pci_fill_ids(void)
>                 rc = pci_add_dynid(&vfio_pci_driver, vendor, device,
>                                    subvendor, subdevice, class, class_mask, 0);
>                 if (rc)
> -                       pr_warn("failed to add dynamic id [%04hx:%04hx[%04hx:%04hx]] class %#08x/%08x (%d)\n",
> +                       pr_warn("failed to add dynamic id [%04x:%04x[%04x:%04x]] class %#08x/%08x (%d)\n",
>                                 vendor, device, subvendor, subdevice,
>                                 class, class_mask, rc);
>                 else
> -                       pr_info("add [%04hx:%04hx[%04hx:%04hx]] class %#08x/%08x\n",
> +                       pr_info("add [%04x:%04x[%04x:%04x]] class %#08x/%08x\n",
>                                 vendor, device, subvendor, subdevice,
>                                 class, class_mask);
>         }
> --
> 2.20.1
>


-- 
Thanks,
~Nick Desaulniers

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

* Re: [PATCH] vfio/pci: use correct format characters
  2019-02-28 19:48 [PATCH] vfio/pci: use correct format characters Louis Taylor
  2019-02-28 20:45 ` Nick Desaulniers
@ 2019-04-03 18:52 ` Alex Williamson
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Williamson @ 2019-04-03 18:52 UTC (permalink / raw)
  To: Louis Taylor
  Cc: aik, kvm, linux-kernel, clang-built-linux, ndesaulniers, jflat

On Thu, 28 Feb 2019 19:48:12 +0000
Louis Taylor <louis@kragniz.eu> wrote:

> When compiling with -Wformat, clang emits the following warnings:
> 
> drivers/vfio/pci/vfio_pci.c:1601:5: warning: format specifies type
>       'unsigned short' but the argument has type 'unsigned int' [-Wformat]
>                                 vendor, device, subvendor, subdevice,
>                                 ^~~~~~
> 
> drivers/vfio/pci/vfio_pci.c:1601:13: warning: format specifies type
>       'unsigned short' but the argument has type 'unsigned int' [-Wformat]
>                                 vendor, device, subvendor, subdevice,
>                                         ^~~~~~
> 
> drivers/vfio/pci/vfio_pci.c:1601:21: warning: format specifies type
>       'unsigned short' but the argument has type 'unsigned int' [-Wformat]
>                                 vendor, device, subvendor, subdevice,
>                                                 ^~~~~~~~~
> 
> drivers/vfio/pci/vfio_pci.c:1601:32: warning: format specifies type
>       'unsigned short' but the argument has type 'unsigned int' [-Wformat]
>                                 vendor, device, subvendor, subdevice,
>                                                            ^~~~~~~~~
> 
> drivers/vfio/pci/vfio_pci.c:1605:5: warning: format specifies type
>       'unsigned short' but the argument has type 'unsigned int' [-Wformat]
>                                 vendor, device, subvendor, subdevice,
>                                 ^~~~~~
> 
> drivers/vfio/pci/vfio_pci.c:1605:13: warning: format specifies type
>       'unsigned short' but the argument has type 'unsigned int' [-Wformat]
>                                 vendor, device, subvendor, subdevice,
>                                         ^~~~~~
> 
> drivers/vfio/pci/vfio_pci.c:1605:21: warning: format specifies type
>       'unsigned short' but the argument has type 'unsigned int' [-Wformat]
>                                 vendor, device, subvendor, subdevice,
>                                                 ^~~~~~~~~
> 
> drivers/vfio/pci/vfio_pci.c:1605:32: warning: format specifies type
>       'unsigned short' but the argument has type 'unsigned int' [-Wformat]
>                                 vendor, device, subvendor, subdevice,
>                                                            ^~~~~~~~~
> The types of these arguments are unconditionally defined, so this patch
> updates the format character to the correct ones for unsigned ints.
> 
> Link: https://github.com/ClangBuiltLinux/linux/issues/378
> Signed-off-by: Louis Taylor <louis@kragniz.eu>
> ---

Applied to vfio for-linus branch for v5.1 with Nick's R-b.  Thanks!

Alex

>  drivers/vfio/pci/vfio_pci.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
> index a25659b5a5d1..3fa20e95a6bb 100644
> --- a/drivers/vfio/pci/vfio_pci.c
> +++ b/drivers/vfio/pci/vfio_pci.c
> @@ -1661,11 +1661,11 @@ static void __init vfio_pci_fill_ids(void)
>  		rc = pci_add_dynid(&vfio_pci_driver, vendor, device,
>  				   subvendor, subdevice, class, class_mask, 0);
>  		if (rc)
> -			pr_warn("failed to add dynamic id [%04hx:%04hx[%04hx:%04hx]] class %#08x/%08x (%d)\n",
> +			pr_warn("failed to add dynamic id [%04x:%04x[%04x:%04x]] class %#08x/%08x (%d)\n",
>  				vendor, device, subvendor, subdevice,
>  				class, class_mask, rc);
>  		else
> -			pr_info("add [%04hx:%04hx[%04hx:%04hx]] class %#08x/%08x\n",
> +			pr_info("add [%04x:%04x[%04x:%04x]] class %#08x/%08x\n",
>  				vendor, device, subvendor, subdevice,
>  				class, class_mask);
>  	}


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

end of thread, other threads:[~2019-04-03 18:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-28 19:48 [PATCH] vfio/pci: use correct format characters Louis Taylor
2019-02-28 20:45 ` Nick Desaulniers
2019-04-03 18:52 ` Alex Williamson

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).