Thread (6 messages) 6 messages, 2 authors, 2021-10-13

[PATCH 1/3] PCI: hv: Remove unnecessary integer promotion from dev_err()

flat view
STALE1830d LANDED

From: Krzysztof Wilczyński <hidden>
Date: 2021-10-08 22:27:37
Also in: linux-pci
Subsystem: hyper-v/azure core and drivers, pci native host bridge and endpoint drivers, pci subsystem, the rest · Maintainers: Haiyang Zhang, Wei Liu, Dexuan Cui, Lorenzo Pieralisi, Krzysztof Wilczyński, Manivannan Sadhasivam, Bjorn Helgaas, Linus Torvalds

Landed in mainline as f18312084300 on 2021-10-12.

Internally, printk() et al already correctly handles the standard
integer promotions, so there is no need to explicitly "%h" modifier as
part of a format string such as "%hx".

Thus, drop the "%h" modifier as it's completely unnecessary (N.B. this
wouldn't be true for the sscanf() function family), and match preferred
coding style.

Related:
  commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary
  commit 70eb2275ff8e ("checkpatch: add warning for unnecessary use of %h[xudi] and %hh[xudi]")
  https://lore.kernel.org/lkml/CAHk-=wgoxnmsj8GEVFJSvTwdnWm8wVJthefNk2n6+4TC=20e0Q@mail.gmail.com/ (local)

No change to functionality intended.

Signed-off-by: Krzysztof Wilczyński <redacted>
---
 drivers/pci/controller/pci-hyperv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
index 67c46e52c0dc..6733cb14e775 100644
--- a/drivers/pci/controller/pci-hyperv.c
+++ b/drivers/pci/controller/pci-hyperv.c
@@ -3126,14 +3126,14 @@ static int hv_pci_probe(struct hv_device *hdev,
 
 	if (dom == HVPCI_DOM_INVALID) {
 		dev_err(&hdev->device,
-			"Unable to use dom# 0x%hx or other numbers", dom_req);
+			"Unable to use dom# 0x%x or other numbers", dom_req);
 		ret = -EINVAL;
 		goto free_bus;
 	}
 
 	if (dom != dom_req)
 		dev_info(&hdev->device,
-			 "PCI dom# 0x%hx has collision, using 0x%hx",
+			 "PCI dom# 0x%x has collision, using 0x%x",
 			 dom_req, dom);
 
 	hbus->bridge->domain_nr = dom;
-- 
2.33.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help