]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.9.174/vfio-pci-use-correct-format-characters.patch
fix up queue-3.18/ipv6-flowlabel-wait-rcu-grace-period-before-put_pid.patch
[thirdparty/kernel/stable-queue.git] / releases / 4.9.174 / vfio-pci-use-correct-format-characters.patch
1 From 51a2c4ae27ff2b708fe1f0481c9ce871dc68edc4 Mon Sep 17 00:00:00 2001
2 From: Louis Taylor <louis@kragniz.eu>
3 Date: Wed, 3 Apr 2019 12:36:20 -0600
4 Subject: vfio/pci: use correct format characters
5
6 [ Upstream commit 426b046b748d1f47e096e05bdcc6fb4172791307 ]
7
8 When compiling with -Wformat, clang emits the following warnings:
9
10 drivers/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
15 drivers/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
20 drivers/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
25 drivers/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
30 drivers/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
35 drivers/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
40 drivers/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
45 drivers/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 ^~~~~~~~~
49 The types of these arguments are unconditionally defined, so this patch
50 updates the format character to the correct ones for unsigned ints.
51
52 Link: https://github.com/ClangBuiltLinux/linux/issues/378
53 Signed-off-by: Louis Taylor <louis@kragniz.eu>
54 Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
55 Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
56 Signed-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
61 diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
62 index 7338e43faa17..f9a75df2d22d 100644
63 --- a/drivers/vfio/pci/vfio_pci.c
64 +++ b/drivers/vfio/pci/vfio_pci.c
65 @@ -1467,11 +1467,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 --
80 2.20.1
81