diff options
| author | Louis Taylor <louis@kragniz.eu> | 2019-04-03 14:36:20 -0400 |
|---|---|---|
| committer | Alex Williamson <alex.williamson@redhat.com> | 2019-04-03 14:36:20 -0400 |
| commit | 426b046b748d1f47e096e05bdcc6fb4172791307 (patch) | |
| tree | a8ff5a5a0d73bbfacfe39bdb01f8117a124f1f3c | |
| parent | 79a3aaa7b82e3106be97842dedfd8429248896e6 (diff) | |
vfio/pci: use correct format characters
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>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| -rw-r--r-- | drivers/vfio/pci/vfio_pci.c | 4 |
1 files 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) | |||
| 1661 | rc = pci_add_dynid(&vfio_pci_driver, vendor, device, | 1661 | rc = pci_add_dynid(&vfio_pci_driver, vendor, device, |
| 1662 | subvendor, subdevice, class, class_mask, 0); | 1662 | subvendor, subdevice, class, class_mask, 0); |
| 1663 | if (rc) | 1663 | if (rc) |
| 1664 | pr_warn("failed to add dynamic id [%04hx:%04hx[%04hx:%04hx]] class %#08x/%08x (%d)\n", | 1664 | pr_warn("failed to add dynamic id [%04x:%04x[%04x:%04x]] class %#08x/%08x (%d)\n", |
| 1665 | vendor, device, subvendor, subdevice, | 1665 | vendor, device, subvendor, subdevice, |
| 1666 | class, class_mask, rc); | 1666 | class, class_mask, rc); |
| 1667 | else | 1667 | else |
| 1668 | pr_info("add [%04hx:%04hx[%04hx:%04hx]] class %#08x/%08x\n", | 1668 | pr_info("add [%04x:%04x[%04x:%04x]] class %#08x/%08x\n", |
| 1669 | vendor, device, subvendor, subdevice, | 1669 | vendor, device, subvendor, subdevice, |
| 1670 | class, class_mask); | 1670 | class, class_mask); |
| 1671 | } | 1671 | } |
