linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: sensor-hub: Fix typo and improve documentation for sensor_hub_remove_callback()
@ 2025-04-30 18:23 Chelsy Ratnawat
  2025-04-30 19:17 ` David Lechner
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Chelsy Ratnawat @ 2025-04-30 18:23 UTC (permalink / raw)
  To: jikos, jic23, srinivas.pandruvada, bentiss
  Cc: linux-input, linux-iio, linux-kernel, Chelsy Ratnawat

Fixed a typo in "registered" and improved grammar for better readability
and consistency with kernel-doc standards. No functional changes.

Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com>
---
 include/linux/hid-sensor-hub.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h
index c27329e2a5ad..5d2ac79429d4 100644
--- a/include/linux/hid-sensor-hub.h
+++ b/include/linux/hid-sensor-hub.h
@@ -130,10 +130,11 @@ int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev,
 /**
 * sensor_hub_remove_callback() - Remove client callbacks
 * @hsdev:	Hub device instance.
-* @usage_id:	Usage id of the client (E.g. 0x200076 for Gyro).
+* @usage_id:	Usage id of the client (e.g. 0x200076 for Gyro).
 *
-* If there is a callback registred, this call will remove that
-* callbacks, so that it will stop data and event notifications.
+* Removes a previously registered callback for the given usage ID.
+* Once removed, the client will no longer receive data or event
+* notifications.
 */
 int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev,
 			u32 usage_id);
-- 
2.43.5


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

* Re: [PATCH] HID: sensor-hub: Fix typo and improve documentation for sensor_hub_remove_callback()
  2025-04-30 18:23 [PATCH] HID: sensor-hub: Fix typo and improve documentation for sensor_hub_remove_callback() Chelsy Ratnawat
@ 2025-04-30 19:17 ` David Lechner
  2025-05-01 23:21   ` srinivas pandruvada
       [not found]   ` <CAOeBcHOw6CHbY6W+wAWvYsm_CGRMCgt_BLSV65X=rnhuU1r1hw@mail.gmail.com>
  2025-05-01 23:19 ` [PATCH v2] " Chelsy Ratnawat
  2025-05-02  0:36 ` Chelsy Ratnawat
  2 siblings, 2 replies; 8+ messages in thread
From: David Lechner @ 2025-04-30 19:17 UTC (permalink / raw)
  To: Chelsy Ratnawat, jikos, jic23, srinivas.pandruvada, bentiss
  Cc: linux-input, linux-iio, linux-kernel

On 4/30/25 1:23 PM, Chelsy Ratnawat wrote:
> Fixed a typo in "registered" and improved grammar for better readability
> and consistency with kernel-doc standards. No functional changes.
> 
> Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com>
> ---
>  include/linux/hid-sensor-hub.h | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h
> index c27329e2a5ad..5d2ac79429d4 100644
> --- a/include/linux/hid-sensor-hub.h
> +++ b/include/linux/hid-sensor-hub.h
> @@ -130,10 +130,11 @@ int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev,
>  /**
>  * sensor_hub_remove_callback() - Remove client callbacks

This says "callbacks", so is it possible to have more than one registered at a
time?

>  * @hsdev:	Hub device instance.
> -* @usage_id:	Usage id of the client (E.g. 0x200076 for Gyro).
> +* @usage_id:	Usage id of the client (e.g. 0x200076 for Gyro).

should we also make gyro lower-case?

>  *
> -* If there is a callback registred, this call will remove that
> -* callbacks, so that it will stop data and event notifications.
> +* Removes a previously registered callback for the given usage ID.
> +* Once removed, the client will no longer receive data or event
> +* notifications.

I like the revised wording, but possibly looses some clarity that could be
fixed with:

Removes a previously registered callback(s), if any, for the given usage ID.

As above, not sure if singular or plural callbacks is correct.

>  */
>  int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev,
>  			u32 usage_id);


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

* [PATCH v2] HID: sensor-hub: Fix typo and improve documentation for sensor_hub_remove_callback()
  2025-04-30 18:23 [PATCH] HID: sensor-hub: Fix typo and improve documentation for sensor_hub_remove_callback() Chelsy Ratnawat
  2025-04-30 19:17 ` David Lechner
@ 2025-05-01 23:19 ` Chelsy Ratnawat
  2025-05-01 23:30   ` David Lechner
  2025-05-02  0:36 ` Chelsy Ratnawat
  2 siblings, 1 reply; 8+ messages in thread
From: Chelsy Ratnawat @ 2025-05-01 23:19 UTC (permalink / raw)
  To: jic23, srinivas.pandruvada, bentiss, dlechner
  Cc: linux-input, linux-iio, linux-kernel, Chelsy Ratnawat

Changes in v2:
 - Improved the kernel-doc comment for sensor_hub_remove_callback().
 - Changed "Gyro" to "gyro".
 - Changed "usage ID" to "usage_id" for consistency with kernel-doc
   style.
 - Updated the comment to state that only one callback can be removed
   per (usage_id, hsdev) pair.

Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com>
---
 include/linux/hid-sensor-hub.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h
index c27329e2a5ad..0f9f7df865db 100644
--- a/include/linux/hid-sensor-hub.h
+++ b/include/linux/hid-sensor-hub.h
@@ -128,12 +128,13 @@ int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev,
 			struct hid_sensor_hub_callbacks *usage_callback);
 
 /**
-* sensor_hub_remove_callback() - Remove client callbacks
+* sensor_hub_remove_callback() - Remove client callback
 * @hsdev:	Hub device instance.
-* @usage_id:	Usage id of the client (E.g. 0x200076 for Gyro).
+* @usage_id:	Usage id of the client (e.g. 0x200076 for gyro).
 *
-* If there is a callback registred, this call will remove that
-* callbacks, so that it will stop data and event notifications.
+* Removes a previously registered callback for the given usage_id
+* and hsdev. Once removed, the client will no longer receive data or
+* event notifications.
 */
 int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev,
 			u32 usage_id);
-- 
2.43.5


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

* Re: [PATCH] HID: sensor-hub: Fix typo and improve documentation for sensor_hub_remove_callback()
  2025-04-30 19:17 ` David Lechner
@ 2025-05-01 23:21   ` srinivas pandruvada
       [not found]   ` <CAOeBcHOw6CHbY6W+wAWvYsm_CGRMCgt_BLSV65X=rnhuU1r1hw@mail.gmail.com>
  1 sibling, 0 replies; 8+ messages in thread
From: srinivas pandruvada @ 2025-05-01 23:21 UTC (permalink / raw)
  To: David Lechner, Chelsy Ratnawat, jikos, jic23, bentiss
  Cc: linux-input, linux-iio, linux-kernel

On Wed, 2025-04-30 at 14:17 -0500, David Lechner wrote:
> On 4/30/25 1:23 PM, Chelsy Ratnawat wrote:
> > Fixed a typo in "registered" and improved grammar for better
> > readability
> > and consistency with kernel-doc standards. No functional changes.
> > 
> > Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com>
> > ---
> >  include/linux/hid-sensor-hub.h | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-
> > sensor-hub.h
> > index c27329e2a5ad..5d2ac79429d4 100644
> > --- a/include/linux/hid-sensor-hub.h
> > +++ b/include/linux/hid-sensor-hub.h
> > @@ -130,10 +130,11 @@ int sensor_hub_register_callback(struct
> > hid_sensor_hub_device *hsdev,
> >  /**
> >  * sensor_hub_remove_callback() - Remove client callbacks
> 
> This says "callbacks", so is it possible to have more than one
> registered at a
> time?

This removes only one. So "callback" will be correct.

Thanks,
Srinivas


> 
> >  * @hsdev:	Hub device instance.
> > -* @usage_id:	Usage id of the client (E.g. 0x200076 for Gyro).
> > +* @usage_id:	Usage id of the client (e.g. 0x200076 for Gyro).
> 
> should we also make gyro lower-case?
> 
> >  *
> > -* If there is a callback registred, this call will remove that
> > -* callbacks, so that it will stop data and event notifications.
> > +* Removes a previously registered callback for the given usage ID.
> > +* Once removed, the client will no longer receive data or event
> > +* notifications.
> 
> I like the revised wording, but possibly looses some clarity that
> could be
> fixed with:
> 
> Removes a previously registered callback(s), if any, for the given
> usage ID.
> 
> As above, not sure if singular or plural callbacks is correct.
> 
> >  */
> >  int sensor_hub_remove_callback(struct hid_sensor_hub_device
> > *hsdev,
> >  			u32 usage_id);
> 


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

* Re: [PATCH v2] HID: sensor-hub: Fix typo and improve documentation for sensor_hub_remove_callback()
  2025-05-01 23:19 ` [PATCH v2] " Chelsy Ratnawat
@ 2025-05-01 23:30   ` David Lechner
  0 siblings, 0 replies; 8+ messages in thread
From: David Lechner @ 2025-05-01 23:30 UTC (permalink / raw)
  To: Chelsy Ratnawat, jic23, srinivas.pandruvada, bentiss
  Cc: linux-input, linux-iio, linux-kernel

On 5/1/25 6:19 PM, Chelsy Ratnawat wrote:
> Changes in v2:
>  - Improved the kernel-doc comment for sensor_hub_remove_callback().
>  - Changed "Gyro" to "gyro".
>  - Changed "usage ID" to "usage_id" for consistency with kernel-doc
>    style.
>  - Updated the comment to state that only one callback can be removed
>    per (usage_id, hsdev) pair.
> 
> Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com>
> ---

Normally people put the changes here below the --- rather than putting it in
the commit message.

Patch part looks good though.

Reviewed-by: David Lechner <dlechner@baylibre.com>


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

* Re: [PATCH] HID: sensor-hub: Fix typo and improve documentation for sensor_hub_remove_callback()
       [not found]   ` <CAOeBcHOw6CHbY6W+wAWvYsm_CGRMCgt_BLSV65X=rnhuU1r1hw@mail.gmail.com>
@ 2025-05-01 23:52     ` David Lechner
  0 siblings, 0 replies; 8+ messages in thread
From: David Lechner @ 2025-05-01 23:52 UTC (permalink / raw)
  To: chelsy ratnawat
  Cc: jikos, jic23, srinivas.pandruvada, bentiss, linux-input,
	linux-iio, linux-kernel

On 5/1/25 6:33 PM, chelsy ratnawat wrote:
> Hi, 

Watch out for HTML mail! The mailing list and other automated tools will reject
it, so some people won't see the whole conversation.

> Thanks for the feedback. Regarding your comments:
> 
> On Thu, May 1, 2025 at 12:47 AM David Lechner <dlechner@baylibre.com <mailto:dlechner@baylibre.com>> wrote:
> 
>     On 4/30/25 1:23 PM, Chelsy Ratnawat wrote:
>     > Fixed a typo in "registered" and improved grammar for better readability
>     > and consistency with kernel-doc standards. No functional changes.
>     >
>     > Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com <mailto:chelsyratnawat2001@gmail.com>>
>     > ---
>     >  include/linux/hid-sensor-hub.h | 7 ++++---
>     >  1 file changed, 4 insertions(+), 3 deletions(-)
>     >
>     > diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h
>     > index c27329e2a5ad..5d2ac79429d4 100644
>     > --- a/include/linux/hid-sensor-hub.h
>     > +++ b/include/linux/hid-sensor-hub.h
>     > @@ -130,10 +130,11 @@ int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev,
>     >  /**
>     >  * sensor_hub_remove_callback() - Remove client callbacks
> 
>     This says "callbacks", so is it possible to have more than one registered at a
>     time?
> 
>    
>    Regarding the use of "callback" instead of "callbacks", what I understand is- 
>    - The function `sensor_hub_register_callback()` ensures that only one callback is registered for each `(hsdev, usage_id)` pair. If another callback is registered for the same `(hsdev, usage_id)`, it returns `-EINVAL`.
>    - Therefore, `sensor_hub_remove_callback()` is designed to remove that single registered callback for a given `(hsdev, usage_id)` pair. The function does not need to handle multiple callbacks for the same pair, as only one
>      callback is registered at a time. 
>     
>    Please let me know if my understanding is correct, or if you have any additional feedback or suggestions.

Based on the reply from Srinivas, it sounds like you understand correctly.



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

* [PATCH v2] HID: sensor-hub: Fix typo and improve documentation for sensor_hub_remove_callback()
  2025-04-30 18:23 [PATCH] HID: sensor-hub: Fix typo and improve documentation for sensor_hub_remove_callback() Chelsy Ratnawat
  2025-04-30 19:17 ` David Lechner
  2025-05-01 23:19 ` [PATCH v2] " Chelsy Ratnawat
@ 2025-05-02  0:36 ` Chelsy Ratnawat
  2025-05-04 16:49   ` Jonathan Cameron
  2 siblings, 1 reply; 8+ messages in thread
From: Chelsy Ratnawat @ 2025-05-02  0:36 UTC (permalink / raw)
  To: jikos, bentiss, jic23, srinivas.pandruvada, dlechner
  Cc: linux-input, linux-iio, linux-kernel, Chelsy Ratnawat

Fixed a typo in "registered" and improved grammar for better readability
and consistency with kernel-doc standards. No functional changes.

Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
---
Changes in v2:
 - Improved the kernel-doc comment for sensor_hub_remove_callback().
 - Changed "Gyro" to "gyro".
 - Changed "usage ID" to "usage_id" for consistency with kernel-doc
   style.
 - Updated the comment to state that only one callback can be removed
   per (usage_id, hsdev) pair.

 include/linux/hid-sensor-hub.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h
index c27329e2a5ad..0f9f7df865db 100644
--- a/include/linux/hid-sensor-hub.h
+++ b/include/linux/hid-sensor-hub.h
@@ -128,12 +128,13 @@ int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev,
 			struct hid_sensor_hub_callbacks *usage_callback);
 
 /**
-* sensor_hub_remove_callback() - Remove client callbacks
+* sensor_hub_remove_callback() - Remove client callback
 * @hsdev:	Hub device instance.
-* @usage_id:	Usage id of the client (E.g. 0x200076 for Gyro).
+* @usage_id:	Usage id of the client (e.g. 0x200076 for gyro).
 *
-* If there is a callback registred, this call will remove that
-* callbacks, so that it will stop data and event notifications.
+* Removes a previously registered callback for the given usage_id
+* and hsdev. Once removed, the client will no longer receive data or
+* event notifications.
 */
 int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev,
 			u32 usage_id);
-- 
2.43.5


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

* Re: [PATCH v2] HID: sensor-hub: Fix typo and improve documentation for sensor_hub_remove_callback()
  2025-05-02  0:36 ` Chelsy Ratnawat
@ 2025-05-04 16:49   ` Jonathan Cameron
  0 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2025-05-04 16:49 UTC (permalink / raw)
  To: Chelsy Ratnawat
  Cc: jikos, bentiss, srinivas.pandruvada, dlechner, linux-input,
	linux-iio, linux-kernel

On Thu,  1 May 2025 17:36:55 -0700
Chelsy Ratnawat <chelsyratnawat2001@gmail.com> wrote:

> Fixed a typo in "registered" and improved grammar for better readability
> and consistency with kernel-doc standards. No functional changes.
> 
> Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com>
> Reviewed-by: David Lechner <dlechner@baylibre.com>
> ---
Even though trivial reason for resend, this is v3.

Posting it as v2 confuses some tooling such as b4.
I manually grabbed the right patch and applied.

Thanks,

Jonathan

> Changes in v2:
>  - Improved the kernel-doc comment for sensor_hub_remove_callback().
>  - Changed "Gyro" to "gyro".
>  - Changed "usage ID" to "usage_id" for consistency with kernel-doc
>    style.
>  - Updated the comment to state that only one callback can be removed
>    per (usage_id, hsdev) pair.
> 
>  include/linux/hid-sensor-hub.h | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h
> index c27329e2a5ad..0f9f7df865db 100644
> --- a/include/linux/hid-sensor-hub.h
> +++ b/include/linux/hid-sensor-hub.h
> @@ -128,12 +128,13 @@ int sensor_hub_register_callback(struct hid_sensor_hub_device *hsdev,
>  			struct hid_sensor_hub_callbacks *usage_callback);
>  
>  /**
> -* sensor_hub_remove_callback() - Remove client callbacks
> +* sensor_hub_remove_callback() - Remove client callback
>  * @hsdev:	Hub device instance.
> -* @usage_id:	Usage id of the client (E.g. 0x200076 for Gyro).
> +* @usage_id:	Usage id of the client (e.g. 0x200076 for gyro).
>  *
> -* If there is a callback registred, this call will remove that
> -* callbacks, so that it will stop data and event notifications.
> +* Removes a previously registered callback for the given usage_id
> +* and hsdev. Once removed, the client will no longer receive data or
> +* event notifications.
>  */
>  int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev,
>  			u32 usage_id);


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

end of thread, other threads:[~2025-05-04 16:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-30 18:23 [PATCH] HID: sensor-hub: Fix typo and improve documentation for sensor_hub_remove_callback() Chelsy Ratnawat
2025-04-30 19:17 ` David Lechner
2025-05-01 23:21   ` srinivas pandruvada
     [not found]   ` <CAOeBcHOw6CHbY6W+wAWvYsm_CGRMCgt_BLSV65X=rnhuU1r1hw@mail.gmail.com>
2025-05-01 23:52     ` David Lechner
2025-05-01 23:19 ` [PATCH v2] " Chelsy Ratnawat
2025-05-01 23:30   ` David Lechner
2025-05-02  0:36 ` Chelsy Ratnawat
2025-05-04 16:49   ` Jonathan Cameron

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