From: Alex Williamson <alex.williamson@redhat.com>
To: Louis Taylor <louis@kragniz.eu>
Cc: aik@ozlabs.ru, kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
clang-built-linux@googlegroups.com, ndesaulniers@google.com,
jflat@chromium.org
Subject: Re: [PATCH] vfio/pci: use correct format characters
Date: Wed, 3 Apr 2019 12:52:20 -0600 [thread overview]
Message-ID: <20190403125220.4d6353ff@x1.home> (raw)
In-Reply-To: <20190228194812.30929-1-louis@kragniz.eu>
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);
> }
prev parent reply other threads:[~2019-04-03 18:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190403125220.4d6353ff@x1.home \
--to=alex.williamson@redhat.com \
--cc=aik@ozlabs.ru \
--cc=clang-built-linux@googlegroups.com \
--cc=jflat@chromium.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=louis@kragniz.eu \
--cc=ndesaulniers@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox