linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: "Krzysztof Wilczyński" <kw@linux.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>, linux-pci@vger.kernel.org
Subject: Re: [PATCH 0/3] PCI: Replace use of snprintf() with scnprintf() in show() functions
Date: Tue, 1 Sep 2020 14:05:51 -0500	[thread overview]
Message-ID: <20200901190551.GA197986@bjorn-Precision-5520> (raw)
In-Reply-To: <20200824233918.26306-1-kw@linux.com>

On Mon, Aug 24, 2020 at 11:39:15PM +0000, Krzysztof Wilczyński wrote:
> Replace use of snprintf() with scnprintf() in order to adhere to the
> rules in Documentation/filesystems/sysfs.txt, as per:
> 
>   show() must not use snprintf() when formatting the value to be
>   returned to user space. If you can guarantee that an overflow
>   will never happen you can use sprintf() otherwise you must use
>   scnprintf().
> 
> Also resolve the following Coccinelle warnings, for example:
> 
>   drivers/pci/p2pdma.c:69:8-16: WARNING: use scnprintf or sprintf
>   drivers/pci/p2pdma.c:78:8-16: WARNING: use scnprintf or sprintf
>   drivers/pci/p2pdma.c:56:8-16: WARNING: use scnprintf or sprintf
> 
> The Coccinelle warning was added in commit abfc19ff202d ("coccinelle:
> api: add device_attr_show script").
> 
> There is no change to the functionality.
> 
> Related:
>   https://patchwork.kernel.org/patch/9946759/#20969333
>   https://lwn.net/Articles/69419
> 
> Krzysztof Wilczyński (3):
>   PCI: Replace use of snprintf() with scnprintf() in
>     resource_alignment_show()
>   PCI: sysfs: Replace use of snprintf() with scnprintf() in
>     driver_override_show()
>   PCI/P2PDMA: Replace use of snprintf() with scnprintf() in show()
>     functions
> 
>  drivers/pci/p2pdma.c    | 8 ++++----
>  drivers/pci/pci-sysfs.c | 2 +-
>  drivers/pci/pci.c       | 2 +-
>  3 files changed, 6 insertions(+), 6 deletions(-)

Squashed together and applied to pci/misc for v5.10, thanks!

      parent reply	other threads:[~2020-09-01 19:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24 23:39 [PATCH 0/3] PCI: Replace use of snprintf() with scnprintf() in show() functions Krzysztof Wilczyński
2020-08-24 23:39 ` [PATCH 1/3] PCI: Replace use of snprintf() with scnprintf() in resource_alignment_show() Krzysztof Wilczyński
2020-08-24 23:39 ` [PATCH 2/3] PCI: sysfs: Replace use of snprintf() with scnprintf() in driver_override_show() Krzysztof Wilczyński
2020-08-24 23:39 ` [PATCH 3/3] PCI/P2PDMA: Replace use of snprintf() with scnprintf() in show() functions Krzysztof Wilczyński
2020-09-01 19:05 ` Bjorn Helgaas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200901190551.GA197986@bjorn-Precision-5520 \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=kw@linux.com \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).