All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Ezequiel Garcia <ezequiel@collabora.com>
Cc: linux-media@vger.kernel.org,
	Hans Verkuil <hans.verkuil@cisco.com>,
	kernel@collabora.com
Subject: Re: [PATCH v3 1/2] media: v4l2-ctrl: Initialize _BUTTON and _CTRL_CLASS
Date: Thu, 6 Jun 2019 19:36:44 +0200	[thread overview]
Message-ID: <20190606193644.767f5246@collabora.com> (raw)
In-Reply-To: <20190606161254.17311-1-ezequiel@collabora.com>

On Thu,  6 Jun 2019 13:12:53 -0300
Ezequiel Garcia <ezequiel@collabora.com> wrote:

> These two control types don't really need a default value,
> as they are not expected to carry any value.
> 
> However, it's slightly clearer to initialize them explicitly
> instead of falling back to the switch default.
> 
> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

> ---
> Changes from v2:
> * Initialize the controls to zero, instead of default.
> 
> Changes from v1:
> * No change.
> ---
>  drivers/media/v4l2-core/v4l2-ctrls.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
> index 1870cecad9ae..92a5521f6813 100644
> --- a/drivers/media/v4l2-core/v4l2-ctrls.c
> +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
> @@ -1532,6 +1532,10 @@ static void std_init(const struct v4l2_ctrl *ctrl, u32 idx,
>  	case V4L2_CTRL_TYPE_BOOLEAN:
>  		ptr.p_s32[idx] = ctrl->default_value;
>  		break;
> +	case V4L2_CTRL_TYPE_BUTTON:
> +	case V4L2_CTRL_TYPE_CTRL_CLASS:
> +		ptr.p_s32[idx] = 0;
> +		break;
>  	case V4L2_CTRL_TYPE_U8:
>  		ptr.p_u8[idx] = ctrl->default_value;
>  		break;


      parent reply	other threads:[~2019-06-06 17:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06 16:12 [PATCH v3 1/2] media: v4l2-ctrl: Initialize _BUTTON and _CTRL_CLASS Ezequiel Garcia
2019-06-06 16:12 ` [PATCH v3 2/2] media: v4l2-ctrl: Move compound control initialization Ezequiel Garcia
2019-06-06 17:37   ` Boris Brezillon
2019-06-12 13:34   ` Hans Verkuil
2019-06-18 23:17     ` [PATCH v3] " Ezequiel Garcia
2019-06-19 12:59       ` Ezequiel Garcia
2019-06-06 17:36 ` Boris Brezillon [this message]

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=20190606193644.767f5246@collabora.com \
    --to=boris.brezillon@collabora.com \
    --cc=ezequiel@collabora.com \
    --cc=hans.verkuil@cisco.com \
    --cc=kernel@collabora.com \
    --cc=linux-media@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 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.