All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] documentation: Format button_dev as a pointer.
@ 2022-05-22 19:50 Nelson Penn
  2022-06-01 15:34 ` Jonathan Corbet
  0 siblings, 1 reply; 2+ messages in thread
From: Nelson Penn @ 2022-05-22 19:50 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: linux-doc, kernel-janitors, linux-kernel, Nelson Penn

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] documentation: Format button_dev as a pointer.
  2022-05-22 19:50 [PATCH] documentation: Format button_dev as a pointer Nelson Penn
@ 2022-06-01 15:34 ` Jonathan Corbet
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Corbet @ 2022-06-01 15:34 UTC (permalink / raw)
  To: Nelson Penn; +Cc: linux-doc, kernel-janitors, linux-kernel, Nelson Penn

Nelson Penn <nelsonapenn@protonmail.com> writes:

> 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(-)

Applied, thanks.

jon

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-01 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-22 19:50 [PATCH] documentation: Format button_dev as a pointer Nelson Penn
2022-06-01 15:34 ` Jonathan Corbet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.