]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.4/vfio-pci-use-correct-format-characters.patch
4.4-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.4 / vfio-pci-use-correct-format-characters.patch
CommitLineData
288d6f25
SL
1From 7635389c96cd3546fd017c04f33aed0ed5b6f029 Mon Sep 17 00:00:00 2001
2From: Louis Taylor <louis@kragniz.eu>
3Date: Wed, 3 Apr 2019 12:36:20 -0600
4Subject: vfio/pci: use correct format characters
5
6[ Upstream commit 426b046b748d1f47e096e05bdcc6fb4172791307 ]
7
8When compiling with -Wformat, clang emits the following warnings:
9
10drivers/vfio/pci/vfio_pci.c:1601:5: warning: format specifies type
11 'unsigned short' but the argument has type 'unsigned int' [-Wformat]
12 vendor, device, subvendor, subdevice,
13 ^~~~~~
14
15drivers/vfio/pci/vfio_pci.c:1601:13: warning: format specifies type
16 'unsigned short' but the argument has type 'unsigned int' [-Wformat]
17 vendor, device, subvendor, subdevice,
18 ^~~~~~
19
20drivers/vfio/pci/vfio_pci.c:1601:21: warning: format specifies type
21 'unsigned short' but the argument has type 'unsigned int' [-Wformat]
22 vendor, device, subvendor, subdevice,
23 ^~~~~~~~~
24
25drivers/vfio/pci/vfio_pci.c:1601:32: warning: format specifies type
26 'unsigned short' but the argument has type 'unsigned int' [-Wformat]
27 vendor, device, subvendor, subdevice,
28 ^~~~~~~~~
29
30drivers/vfio/pci/vfio_pci.c:1605:5: warning: format specifies type
31 'unsigned short' but the argument has type 'unsigned int' [-Wformat]
32 vendor, device, subvendor, subdevice,
33 ^~~~~~
34
35drivers/vfio/pci/vfio_pci.c:1605:13: warning: format specifies type
36 'unsigned short' but the argument has type 'unsigned int' [-Wformat]
37 vendor, device, subvendor, subdevice,
38 ^~~~~~
39
40drivers/vfio/pci/vfio_pci.c:1605:21: warning: format specifies type
41 'unsigned short' but the argument has type 'unsigned int' [-Wformat]
42 vendor, device, subvendor, subdevice,
43 ^~~~~~~~~
44
45drivers/vfio/pci/vfio_pci.c:1605:32: warning: format specifies type
46 'unsigned short' but the argument has type 'unsigned int' [-Wformat]
47 vendor, device, subvendor, subdevice,
48 ^~~~~~~~~
49The types of these arguments are unconditionally defined, so this patch
50updates the format character to the correct ones for unsigned ints.
51
52Link: https://github.com/ClangBuiltLinux/linux/issues/378
53Signed-off-by: Louis Taylor <louis@kragniz.eu>
54Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
55Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
56Signed-off-by: Sasha Levin <sashal@kernel.org>
57---
58 drivers/vfio/pci/vfio_pci.c | 4 ++--
59 1 file changed, 2 insertions(+), 2 deletions(-)
60
61diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
62index b31b84f56e8f..47b229fa5e8e 100644
63--- a/drivers/vfio/pci/vfio_pci.c
64+++ b/drivers/vfio/pci/vfio_pci.c
65@@ -1191,11 +1191,11 @@ static void __init vfio_pci_fill_ids(void)
66 rc = pci_add_dynid(&vfio_pci_driver, vendor, device,
67 subvendor, subdevice, class, class_mask, 0);
68 if (rc)
69- pr_warn("failed to add dynamic id [%04hx:%04hx[%04hx:%04hx]] class %#08x/%08x (%d)\n",
70+ pr_warn("failed to add dynamic id [%04x:%04x[%04x:%04x]] class %#08x/%08x (%d)\n",
71 vendor, device, subvendor, subdevice,
72 class, class_mask, rc);
73 else
74- pr_info("add [%04hx:%04hx[%04hx:%04hx]] class %#08x/%08x\n",
75+ pr_info("add [%04x:%04x[%04x:%04x]] class %#08x/%08x\n",
76 vendor, device, subvendor, subdevice,
77 class, class_mask);
78 }
79--
802.20.1
81