]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
nvme-pci: properly print controller address
authorMax Gurtovoy <maxg@mellanox.com>
Mon, 9 Mar 2020 15:04:12 +0000 (17:04 +0200)
committerKeith Busch <kbusch@kernel.org>
Wed, 25 Mar 2020 19:51:54 +0000 (04:51 +0900)
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]#

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
drivers/nvme/host/pci.c

index f45e26e6af7e9a73e2c22b9a3b3146fb0c3777c1..e6fa0c7bb96c29ecad23ce2564223d1cd26f47ff 100644 (file)
@@ -2656,7 +2656,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 = {