Skip to contentSkip to conversation

PCI/IOV: Make the display of vf_device more readble

PATCH In review Guixin Liu 2 participants 3 messages Mar 24, 2025 – Aug 12, 2025 PCI

lore
Share & tools
lore

Guixin Liu

author
#0 lore raw

PATCH 1/1 PCI/IOV: Make the display of vf_device more readble

Add "0x" prefixes and set its print width to enhance formatting.

---
 drivers/pci/iov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/iov.c +1 -1
index 9e4770cdd4d5..df40663c1881 100644
@@ -500,7 +500,7 @@ static ssize_t sriov_vf_device_show(struct device *dev,
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
 
-	return sysfs_emit(buf, "%x\n", pdev->sriov->vf_device);
+	return sysfs_emit(buf, "0x%04x\n", pdev->sriov->vf_device);
 }
 
 static ssize_t sriov_drivers_autoprobe_show(struct device *dev,
Signature · 1 line
2.43.0
author
#1 lore raw

Gently ping...

Quoted 20 lines · Guixin Liu

Add "0x" prefixes and set its print width to enhance formatting.

---
  drivers/pci/iov.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/iov.c +1 -1
index 9e4770cdd4d5..df40663c1881 100644
@@ -500,7 +500,7 @@ static ssize_t sriov_vf_device_show(struct device *dev,
  {
  	struct pci_dev *pdev = to_pci_dev(dev);
 
-	return sysfs_emit(buf, "%x\n", pdev->sriov->vf_device);
+	return sysfs_emit(buf, "0x%04x\n", pdev->sriov->vf_device);
  }
 
  static ssize_t sriov_drivers_autoprobe_show(struct device *dev,
Reviewed-by on v1 1/1
#2 lore raw
In reply to Guixin Liu
Quoted 3 lines · Guixin Liu

Add "0x" prefixes and set its print width to enhance formatting.

- Mani

Quoted 20 lines
---
 drivers/pci/iov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/iov.c +1 -1
index 9e4770cdd4d5..df40663c1881 100644
@@ -500,7 +500,7 @@ static ssize_t sriov_vf_device_show(struct device *dev,
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
 
-	return sysfs_emit(buf, "%x\n", pdev->sriov->vf_device);
+	return sysfs_emit(buf, "0x%04x\n", pdev->sriov->vf_device);
 }
 
 static ssize_t sriov_drivers_autoprobe_show(struct device *dev,
Signature · 1 line
2.43.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்