All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: linux-media@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Sakari Ailus <sakari.ailus@linux.intel.com>
Subject: Re: [PATCH v3 5/5] media: v4l2-subdev: fix and rename check_cfg()
Date: Thu, 10 Jun 2021 14:26:56 +0300	[thread overview]
Message-ID: <YMH3AOK961VIVmkI@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20210610094903.343183-4-tomi.valkeinen@ideasonboard.com>

Hi Tomi,

Thank you for the patch.

On Thu, Jun 10, 2021 at 12:49:03PM +0300, Tomi Valkeinen wrote:
> Rename check_cfg() to check_state_pads() as it is now checking the pads
> of the state.
> 
> Also fix the check so that it verifies that both state and state->pads
> exist.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/v4l2-core/v4l2-subdev.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
> index 25c80d6de23b..daf7ffdd8882 100644
> --- a/drivers/media/v4l2-core/v4l2-subdev.c
> +++ b/drivers/media/v4l2-core/v4l2-subdev.c
> @@ -148,9 +148,9 @@ static inline int check_pad(struct v4l2_subdev *sd, u32 pad)
>  	return 0;
>  }
>  
> -static int check_cfg(u32 which, struct v4l2_subdev_state *state)
> +static int check_state_pads(u32 which, struct v4l2_subdev_state *state)
>  {
> -	if (which == V4L2_SUBDEV_FORMAT_TRY && !state)
> +	if (which == V4L2_SUBDEV_FORMAT_TRY && (!state || !state->pads))
>  		return -EINVAL;
>  
>  	return 0;
> @@ -164,7 +164,7 @@ static inline int check_format(struct v4l2_subdev *sd,
>  		return -EINVAL;
>  
>  	return check_which(format->which) ? : check_pad(sd, format->pad) ? :
> -	       check_cfg(format->which, state);
> +	       check_state_pads(format->which, state);
>  }
>  
>  static int call_get_fmt(struct v4l2_subdev *sd,
> @@ -191,7 +191,7 @@ static int call_enum_mbus_code(struct v4l2_subdev *sd,
>  		return -EINVAL;
>  
>  	return check_which(code->which) ? : check_pad(sd, code->pad) ? :
> -	       check_cfg(code->which, state) ? :
> +	       check_state_pads(code->which, state) ? :
>  	       sd->ops->pad->enum_mbus_code(sd, state, code);
>  }
>  
> @@ -203,7 +203,7 @@ static int call_enum_frame_size(struct v4l2_subdev *sd,
>  		return -EINVAL;
>  
>  	return check_which(fse->which) ? : check_pad(sd, fse->pad) ? :
> -	       check_cfg(fse->which, state) ? :
> +	       check_state_pads(fse->which, state) ? :
>  	       sd->ops->pad->enum_frame_size(sd, state, fse);
>  }
>  
> @@ -238,7 +238,7 @@ static int call_enum_frame_interval(struct v4l2_subdev *sd,
>  		return -EINVAL;
>  
>  	return check_which(fie->which) ? : check_pad(sd, fie->pad) ? :
> -	       check_cfg(fie->which, state) ? :
> +	       check_state_pads(fie->which, state) ? :
>  	       sd->ops->pad->enum_frame_interval(sd, state, fie);
>  }
>  
> @@ -250,7 +250,7 @@ static inline int check_selection(struct v4l2_subdev *sd,
>  		return -EINVAL;
>  
>  	return check_which(sel->which) ? : check_pad(sd, sel->pad) ? :
> -	       check_cfg(sel->which, state);
> +	       check_state_pads(sel->which, state);
>  }
>  
>  static int call_get_selection(struct v4l2_subdev *sd,

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2021-06-10 11:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 10:02 [PATCH v3 0/1] media: v4l2-subdev: add subdev-wide state struct Tomi Valkeinen
     [not found] ` <20210609100228.278798-2-tomi.valkeinen@ideasonboard.com>
2021-06-10  8:00   ` [PATCH v3 1/1] " Hans Verkuil
2021-06-10  8:24     ` Tomi Valkeinen
2021-06-10 11:11     ` Laurent Pinchart
2021-06-10  9:49 ` [PATCH v3 2/5] media: omap3isp: fix indentation Tomi Valkeinen
2021-06-10  9:49   ` [PATCH v3 3/5] media: fix kernel doc errors for sd_state parameter Tomi Valkeinen
2021-06-10 11:25     ` Laurent Pinchart
2021-06-10  9:49   ` [PATCH v3 4/5] media: v4l2-subdev: v4l2_subdev_free_state() to accept a NULL state Tomi Valkeinen
2021-06-10 11:26     ` Laurent Pinchart
2021-06-10  9:49   ` [PATCH v3 5/5] media: v4l2-subdev: fix and rename check_cfg() Tomi Valkeinen
2021-06-10 11:26     ` Laurent Pinchart [this message]
2021-06-10 11:23   ` [PATCH v3 2/5] media: omap3isp: fix indentation Laurent Pinchart
2021-06-10  9:51 ` [PATCH v3 0/1] media: v4l2-subdev: add subdev-wide state struct Tomi Valkeinen
2021-06-10  9:54   ` Hans Verkuil

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=YMH3AOK961VIVmkI@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tomi.valkeinen@ideasonboard.com \
    /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.