Skip to content
Commit e7a7499d authored by Krzysztof Wilczyński's avatar Krzysztof Wilczyński Committed by Bjorn Helgaas
Browse files

PCI: Use scnprintf(), not snprintf(), in sysfs "show" functions

Sysfs "show" methods should return the number of bytes printed into the
buffer.  This is the return value of scnprintf() [1].

snprintf(buf, size, ...) prints at most "size" bytes into "buf", but
returns the number of bytes that *would* be printed if "buf" were large
enough.

Replace use of snprintf() with scnprintf().  No functional change intended.

Related:
  https://patchwork.kernel.org/patch/9946759/#20969333
  https://lwn.net/Articles/69419



[1] Documentation/filesystems/sysfs.rst

[bhelgaas: squashed, commit log]
Suggested-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20200824233918.26306-2-kw@linux.com
Link: https://lore.kernel.org/r/20200824233918.26306-3-kw@linux.com
Link: https://lore.kernel.org/r/20200824233918.26306-4-kw@linux.com


Signed-off-by: default avatarKrzysztof Wilczyński <kw@linux.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 035fff1f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment