linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] v4l2-ctrl.h: fix comments
@ 2016-06-15 10:10 Hans Verkuil
  2016-06-15 12:14 ` Ian Arkver
  0 siblings, 1 reply; 2+ messages in thread
From: Hans Verkuil @ 2016-06-15 10:10 UTC (permalink / raw)
  To: linux-media; +Cc: Sakari Ailus

The comments for the unlocked v4l2_ctrl_s_ctrl* functions were wrong (copy
and pasted from the locked variants). Fix this, since it is confusing.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index 0bc9b35..e9e87e023 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -759,9 +759,9 @@ s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl);
  * @ctrl:	The control.
  * @val:	The new value.
  *
- * This set the control's new value safely by going through the control
- * framework. This function will lock the control's handler, so it cannot be
- * used from within the &v4l2_ctrl_ops functions.
+ * This sets the control's new value safely by going through the control
+ * framework. This function assumes the control's handler is already locked,
+ * allowing it to be used from within the &v4l2_ctrl_ops functions.
  *
  * This function is for integer type controls only.
  */
@@ -771,7 +771,7 @@ int __v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val);
  * @ctrl:	The control.
  * @val:	The new value.
  *
- * This set the control's new value safely by going through the control
+ * This sets the control's new value safely by going through the control
  * framework. This function will lock the control's handler, so it cannot be
  * used from within the &v4l2_ctrl_ops functions.
  *
@@ -807,9 +807,9 @@ s64 v4l2_ctrl_g_ctrl_int64(struct v4l2_ctrl *ctrl);
  * @ctrl:	The control.
  * @val:	The new value.
  *
- * This set the control's new value safely by going through the control
- * framework. This function will lock the control's handler, so it cannot be
- * used from within the &v4l2_ctrl_ops functions.
+ * This sets the control's new value safely by going through the control
+ * framework. This function assumes the control's handler is already locked,
+ * allowing it to be used from within the &v4l2_ctrl_ops functions.
  *
  * This function is for 64-bit integer type controls only.
  */
@@ -821,9 +821,9 @@ int __v4l2_ctrl_s_ctrl_int64(struct v4l2_ctrl *ctrl, s64 val);
  * @ctrl:	The control.
  * @val:	The new value.
  *
- * This set the control's new value safely by going through the control
- * framework. This function will lock the control's handler, so it cannot be
- * used from within the &v4l2_ctrl_ops functions.
+ * This sets the control's new value safely by going through the control
+ * framework. This function does not lock the control's handler, allowing it to
+ * be used from within the &v4l2_ctrl_ops functions.
  *
  * This function is for 64-bit integer type controls only.
  */
@@ -843,9 +843,9 @@ static inline int v4l2_ctrl_s_ctrl_int64(struct v4l2_ctrl *ctrl, s64 val)
  * @ctrl:	The control.
  * @s:		The new string.
  *
- * This set the control's new string safely by going through the control
- * framework. This function will lock the control's handler, so it cannot be
- * used from within the &v4l2_ctrl_ops functions.
+ * This sets the control's new string safely by going through the control
+ * framework. This function assumes the control's handler is already locked,
+ * allowing it to be used from within the &v4l2_ctrl_ops functions.
  *
  * This function is for string type controls only.
  */
@@ -857,7 +857,7 @@ int __v4l2_ctrl_s_ctrl_string(struct v4l2_ctrl *ctrl, const char *s);
  * @ctrl:	The control.
  * @s:		The new string.
  *
- * This set the control's new string safely by going through the control
+ * This sets the control's new string safely by going through the control
  * framework. This function will lock the control's handler, so it cannot be
  * used from within the &v4l2_ctrl_ops functions.
  *

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

* Re: [PATCH] v4l2-ctrl.h: fix comments
  2016-06-15 10:10 [PATCH] v4l2-ctrl.h: fix comments Hans Verkuil
@ 2016-06-15 12:14 ` Ian Arkver
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Arkver @ 2016-06-15 12:14 UTC (permalink / raw)
  To: Hans Verkuil, linux-media; +Cc: Sakari Ailus

On 15/06/16 11:10, Hans Verkuil wrote:
> The comments for the unlocked v4l2_ctrl_s_ctrl* functions were wrong (copy
> and pasted from the locked variants). Fix this, since it is confusing.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
>
> diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
> index 0bc9b35..e9e87e023 100644
> --- a/include/media/v4l2-ctrls.h
> +++ b/include/media/v4l2-ctrls.h
> @@ -759,9 +759,9 @@ s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl);
>    * @ctrl:	The control.
>    * @val:	The new value.
>    *
> - * This set the control's new value safely by going through the control
> - * framework. This function will lock the control's handler, so it cannot be
> - * used from within the &v4l2_ctrl_ops functions.
> + * This sets the control's new value safely by going through the control
> + * framework. This function assumes the control's handler is already locked,
> + * allowing it to be used from within the &v4l2_ctrl_ops functions.
>    *
>    * This function is for integer type controls only.
>    */
> @@ -771,7 +771,7 @@ int __v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val);
>    * @ctrl:	The control.
>    * @val:	The new value.
>    *
> - * This set the control's new value safely by going through the control
> + * This sets the control's new value safely by going through the control
>    * framework. This function will lock the control's handler, so it cannot be
>    * used from within the &v4l2_ctrl_ops functions.
>    *
> @@ -807,9 +807,9 @@ s64 v4l2_ctrl_g_ctrl_int64(struct v4l2_ctrl *ctrl);
>    * @ctrl:	The control.
>    * @val:	The new value.
>    *
> - * This set the control's new value safely by going through the control
> - * framework. This function will lock the control's handler, so it cannot be
> - * used from within the &v4l2_ctrl_ops functions.
> + * This sets the control's new value safely by going through the control
> + * framework. This function assumes the control's handler is already locked,
> + * allowing it to be used from within the &v4l2_ctrl_ops functions.
>    *
>    * This function is for 64-bit integer type controls only.
>    */
> @@ -821,9 +821,9 @@ int __v4l2_ctrl_s_ctrl_int64(struct v4l2_ctrl *ctrl, s64 val);
>    * @ctrl:	The control.
>    * @val:	The new value.
>    *
> - * This set the control's new value safely by going through the control
> - * framework. This function will lock the control's handler, so it cannot be
> - * used from within the &v4l2_ctrl_ops functions.
> + * This sets the control's new value safely by going through the control
> + * framework. This function does not lock the control's handler, allowing it to
> + * be used from within the &v4l2_ctrl_ops functions.
>    *
>    * This function is for 64-bit integer type controls only.
>    */
I think this comment is above v4l2_ctrl_s_ctrl_int64, without the 
underscores. Doesn't this fn take the lock, or have I missed a patch 
that removes that?

> @@ -843,9 +843,9 @@ static inline int v4l2_ctrl_s_ctrl_int64(struct v4l2_ctrl *ctrl, s64 val)
>    * @ctrl:	The control.
>    * @s:		The new string.
>    *
> - * This set the control's new string safely by going through the control
> - * framework. This function will lock the control's handler, so it cannot be
> - * used from within the &v4l2_ctrl_ops functions.
> + * This sets the control's new string safely by going through the control
> + * framework. This function assumes the control's handler is already locked,
> + * allowing it to be used from within the &v4l2_ctrl_ops functions.
>    *
>    * This function is for string type controls only.
>    */
> @@ -857,7 +857,7 @@ int __v4l2_ctrl_s_ctrl_string(struct v4l2_ctrl *ctrl, const char *s);
>    * @ctrl:	The control.
>    * @s:		The new string.
>    *
> - * This set the control's new string safely by going through the control
> + * This sets the control's new string safely by going through the control
>    * framework. This function will lock the control's handler, so it cannot be
>    * used from within the &v4l2_ctrl_ops functions.
>    *
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Regards,
Ian

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

end of thread, other threads:[~2016-06-15 12:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-15 10:10 [PATCH] v4l2-ctrl.h: fix comments Hans Verkuil
2016-06-15 12:14 ` Ian Arkver

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