linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nelson Penn <nelsonapenn@protonmail.com>
To: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Nelson Penn <nelsonapenn@protonmail.com>
Subject: [PATCH] documentation: Format button_dev as a pointer.
Date: Sun, 22 May 2022 19:50:38 +0000	[thread overview]
Message-ID: <20220522194953.12097-1-nelsonapenn@protonmail.com> (raw)

The docs on creating an input device driver have an example in which
button_dev is a pointer to an input_dev struct. However, in two code
snippets below, button_dev is used as if it is not a pointer. Make these
occurrences of button_dev reflect that it is a pointer.

Signed-off-by: Nelson Penn <nelsonapenn@protonmail.com>
---
 Documentation/input/input-programming.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/input/input-programming.rst b/Documentation/input/input-programming.rst
index 2638dce69764..c9264814c7aa 100644
--- a/Documentation/input/input-programming.rst
+++ b/Documentation/input/input-programming.rst
@@ -85,15 +85,15 @@ accepted by this input device. Our example device can only generate EV_KEY
 type events, and from those only BTN_0 event code. Thus we only set these
 two bits. We could have used::

-	set_bit(EV_KEY, button_dev.evbit);
-	set_bit(BTN_0, button_dev.keybit);
+	set_bit(EV_KEY, button_dev->evbit);
+	set_bit(BTN_0, button_dev->keybit);

 as well, but with more than single bits the first approach tends to be
 shorter.

 Then the example driver registers the input device structure by calling::

-	input_register_device(&button_dev);
+	input_register_device(button_dev);

 This adds the button_dev structure to linked lists of the input driver and
 calls device handler modules _connect functions to tell them a new input
--
2.25.1



             reply	other threads:[~2022-05-22 19:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-22 19:50 Nelson Penn [this message]
2022-06-01 15:34 ` [PATCH] documentation: Format button_dev as a pointer Jonathan Corbet

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=20220522194953.12097-1-nelsonapenn@protonmail.com \
    --to=nelsonapenn@protonmail.com \
    --cc=corbet@lwn.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@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).