From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Subject: Re: [PATCH v5 01/12] media: rcar-vin: Use correct count of remote subdevices
Date: Mon, 9 Jun 2025 09:39:40 +0000 [thread overview]
Message-ID: <aEar3NonNYosp4Nm@kekkonen.localdomain> (raw)
In-Reply-To: <20250606182606.3984508-2-niklas.soderlund+renesas@ragnatech.se>
Hejssan,
On Fri, Jun 06, 2025 at 08:25:55PM +0200, Niklas Söderlund wrote:
> When extending the driver with Gen4 support the iteration of over
> possible remote subdevices changed from being R-Car CSI-2 Rx only to
> also cover R-Car CSISP instances. In two loops updating the bounds
> variable was missed.
>
> This had no ill effect as the count the two values have always been the
> same in the past. Fix it by looking at the array size.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> Tested-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
> * Changes since v4
> - Use ARRAY_SIZE() instead of updating the incorrect define to
> RVIN_REMOTES_MAX.
Do you still need RVIN_REMOTES_MAX()? Couldn't you use ARRAY_SIZE()
elsewhere, too?
> ---
> drivers/media/platform/renesas/rcar-vin/rcar-core.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-core.c b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> index 846ae7989b1d..cf5830d7d7b1 100644
> --- a/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> +++ b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> @@ -213,7 +213,7 @@ static int rvin_group_entity_to_remote_id(struct rvin_group *group,
>
> sd = media_entity_to_v4l2_subdev(entity);
>
> - for (i = 0; i < RVIN_REMOTES_MAX; i++)
> + for (i = 0; i < ARRAY_SIZE(group->remotes); i++)
> if (group->remotes[i].subdev == sd)
> return i;
>
> @@ -262,7 +262,7 @@ static void rvin_group_notify_unbind(struct v4l2_async_notifier *notifier,
>
> mutex_lock(&vin->group->lock);
>
> - for (i = 0; i < RVIN_CSI_MAX; i++) {
> + for (i = 0; i < ARRAY_SIZE(vin->group->remotes); i++) {
> if (vin->group->remotes[i].asc != asc)
> continue;
> vin->group->remotes[i].subdev = NULL;
> @@ -284,7 +284,7 @@ static int rvin_group_notify_bound(struct v4l2_async_notifier *notifier,
>
> mutex_lock(&vin->group->lock);
>
> - for (i = 0; i < RVIN_CSI_MAX; i++) {
> + for (i = 0; i < ARRAY_SIZE(vin->group->remotes); i++) {
> if (vin->group->remotes[i].asc != asc)
> continue;
> vin->group->remotes[i].subdev = subdev;
--
Kind regards,
Sakari Ailus
next prev parent reply other threads:[~2025-06-09 9:39 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-06 18:25 [PATCH v5 00/12] media: rcar-vin: Unify notifiers and enable MC on Gen2 Niklas Söderlund
2025-06-06 18:25 ` [PATCH v5 01/12] media: rcar-vin: Use correct count of remote subdevices Niklas Söderlund
2025-06-09 9:39 ` Sakari Ailus [this message]
2025-06-09 9:41 ` Sakari Ailus
2025-06-06 18:25 ` [PATCH v5 02/12] media: rcar-vin: Store platform info with group structure Niklas Söderlund
2025-06-12 0:19 ` Laurent Pinchart
2025-06-06 18:25 ` [PATCH v5 03/12] media: rcar-vin: Change link setup argument Niklas Söderlund
2025-06-12 0:31 ` Laurent Pinchart
2025-06-06 18:25 ` [PATCH v5 04/12] media: rcar-vin: Generate a VIN group ID for Gen2 Niklas Söderlund
2025-06-06 18:25 ` [PATCH v5 05/12] media: rcar-vin: Prepare for unifying all v4l-async notifiers Niklas Söderlund
2025-06-06 18:26 ` [PATCH v5 06/12] media: rcar-vin: Improve error paths for parallel devices Niklas Söderlund
2025-06-12 0:22 ` Laurent Pinchart
2025-06-06 18:26 ` [PATCH v5 07/12] media: rcar-vin: Merge all notifiers Niklas Söderlund
2025-06-12 23:15 ` Laurent Pinchart
2025-06-18 7:44 ` Geert Uytterhoeven
2025-06-18 8:58 ` Laurent Pinchart
2025-06-18 10:59 ` Geert Uytterhoeven
2025-06-18 11:03 ` Wolfram Sang
2025-06-06 18:26 ` [PATCH v5 08/12] media: rcar-vin: Always create a media pad Niklas Söderlund
2025-06-12 0:25 ` Laurent Pinchart
2025-06-06 18:26 ` [PATCH v5 09/12] media: rcar-vin: Remove NTSC workaround Niklas Söderlund
2025-06-12 23:17 ` Laurent Pinchart
2025-06-06 18:26 ` [PATCH v5 10/12] media: rcar-vin: Only expose VIN controls Niklas Söderlund
2025-06-12 23:28 ` Laurent Pinchart
2025-06-13 10:16 ` Niklas Söderlund
2025-06-06 18:26 ` [PATCH v5 11/12] media: rcar-vin: Enable media-graph on Gen2 Niklas Söderlund
2025-06-12 23:53 ` Laurent Pinchart
2025-06-13 9:38 ` Niklas Söderlund
2025-06-06 18:26 ` [PATCH v5 12/12] media: rcar-vin: Fold event notifier into only user Niklas Söderlund
2025-06-12 0:28 ` Laurent Pinchart
2025-06-12 7:22 ` Niklas Söderlund
2025-06-12 9:44 ` Laurent Pinchart
2025-06-12 9:56 ` Niklas Söderlund
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=aEar3NonNYosp4Nm@kekkonen.localdomain \
--to=sakari.ailus@linux.intel.com \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=niklas.soderlund+renesas@ragnatech.se \
--cc=tomi.valkeinen+renesas@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox