Skip to contentSkip to conversation

nvme/pci: properly print controller address

PATCH Applied Max Gurtovoy 3 participants 3 messages Mar 9, 2020 – Mar 10, 2020 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme/pci: properly print controller address

Align PCI address print with fabrics address that is printed with newline character.

Before:
[root@server40 linux]# cat /sys/class/nvme/nvme2/address 0000:0b:00.0[root@server40 linux]#

After:
[root@server40 linux]# cat /sys/class/nvme/nvme2/address 0000:0b:00.0
[root@server40 linux]#

---
 drivers/nvme/host/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/pci.c +1 -1
index d3f23d6..ef06b24 100644
@@ -2689,7 +2689,7 @@ static int nvme_pci_get_address(struct nvme_ctrl *ctrl, char *buf, int size)
 {
 	struct pci_dev *pdev = to_pci_dev(to_nvme_dev(ctrl)->dev);
 
-	return snprintf(buf, size, "%s", dev_name(&pdev->dev));
+	return snprintf(buf, size, "%s\n", dev_name(&pdev->dev));
 }
 
 static const struct nvme_ctrl_ops nvme_pci_ctrl_ops = {
Signature · 7 lines
1.8.3.1


_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
maintainer Applied
#2 lore raw
In reply to Max Gurtovoy
Quoted 7 lines · Max Gurtovoy

Align PCI address print with fabrics address that is printed with newline character.

Before:
[root@server40 linux]# cat /sys/class/nvme/nvme2/address 0000:0b:00.0[root@server40 linux]#

Quoted 6 lines

After:
[root@server40 linux]# cat /sys/class/nvme/nvme2/address 0000:0b:00.0
[root@server40 linux]#

Applied to 5.7 with the minor subject edit.

_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme