Linux Documentation
 help / color / mirror / Atom feed
From: Kenny Ballou <kballou@devnulllabs.io>
To: linux-doc@vger.kernel.org
Cc: bhelgaas@google.com, corbet@lwn.net, googlegot@yahoo.com,
	Kenny Ballou <kballou@devnulllabs.io>
Subject: [PATCH] doc: sysfs-pci: update enable 'rom' file instructions
Date: Tue, 13 Mar 2018 15:58:52 -0600	[thread overview]
Message-ID: <20180313215852.14338-1-kballou@devnulllabs.io> (raw)

Update the instructions for enabling and disabling read access to the
special sysfs 'rom' file for PCI devices.  The function that interprets
user data for enabling and disabling the device actually expects _at
least_ 2 bytes, more than what is expressly implied by "1" or "0".

It should also be noted, that the code path for enabling read access to
the special file can receive any length of input as long as it doesn't
start with "0".  However, this is not added to the documentation as this
is, perhaps, not a "feature" of the file system we want to encourage.

This patch is submitted in place of accepting [pci: use kstrtobool over
ad hoc string parsing][0] as to not break existing functionality.
Similarly, this patch is in reference to a bugzilla report: [Sysfs PCI
rom file functionality does not match documentation][1].

[0]: https://www.spinics.net/lists/linux-pci/msg69073.html
[1]: https://bugzilla.kernel.org/show_bug.cgi?id=111301

Reported-by: googlegot@yahoo.com
Signed-off-by: Kenny Ballou <kballou@devnulllabs.io>
---
 Documentation/filesystems/sysfs-pci.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/filesystems/sysfs-pci.txt b/Documentation/filesystems/sysfs-pci.txt
index 06f1d64c6f70..0cc9a32ebab0 100644
--- a/Documentation/filesystems/sysfs-pci.txt
+++ b/Documentation/filesystems/sysfs-pci.txt
@@ -75,8 +75,8 @@ may not be reversed.
 
 The 'rom' file is special in that it provides read-only access to the device's
 ROM file, if available.  It's disabled by default, however, so applications
-should write the string "1" to the file to enable it before attempting a read
-call, and disable it following the access by writing "0" to the file.  Note
+should write the string "1\n" to the file to enable it before attempting a read
+call, and disable it following the access by writing "0\n" to the file.  Note
 that the device must be enabled for a rom read to return data successfully.
 In the event a driver is not bound to the device, it can be enabled using the
 'enable' file, documented above.
-- 
2.16.1

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

                 reply	other threads:[~2018-03-13 22:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20180313215852.14338-1-kballou@devnulllabs.io \
    --to=kballou@devnulllabs.io \
    --cc=bhelgaas@google.com \
    --cc=corbet@lwn.net \
    --cc=googlegot@yahoo.com \
    --cc=linux-doc@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