PCI/sysfs: Rely on lengths from scnprintf(), dsm_label_utf16s_to_utf8s()
authorKrzysztof Wilczyński <kw@linux.com>
Thu, 3 Jun 2021 00:01:08 +0000 (00:01 +0000)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 3 Jun 2021 22:14:36 +0000 (17:14 -0500)
commit316ae33051215f92c72fe13bc1bfc4e513a26700
tree1cab88efef6cd3ebc148127417f091386836b790
parentbdcdaa13ad96f1a530711c29e6d4b8311eff767c
PCI/sysfs: Rely on lengths from scnprintf(), dsm_label_utf16s_to_utf8s()

scnprintf() returns the number of bytes written into the buffer.  Change
dsm_label_utf16s_to_utf8s() to do the same.  Rely on those values instead
of using strlen() to compute the buffer length.

No functional change intended.

[bhelgaas: reorder patch in series, len++ to include newline added by
dsm_label_utf16s_to_utf8s(), commit log]
Link: https://lore.kernel.org/r/20210603000112.703037-3-kw@linux.com
Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
drivers/pci/pci-label.c