Linux Media Controller development
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Hans Verkuil <hverkuil+cisco@kernel.org>
Cc: linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com
Subject: Re: [PATCH 03/14] media: omap3isp: isp_video_mbus_to_pix/pix_to_mbus fixes
Date: Mon, 1 Dec 2025 12:22:12 +0200	[thread overview]
Message-ID: <aS1sVLJsj2iDk2qD@kekkonen.localdomain> (raw)
In-Reply-To: <4788af27-120e-4e01-b3d1-f30e466b4980@kernel.org>

Hi Hans,

On Mon, Dec 01, 2025 at 09:27:55AM +0100, Hans Verkuil wrote:
> Hi Sakari,
> 
> On 22/10/2025 09:48, Sakari Ailus wrote:
> > Hi Hans,
> > 
> > Thanks for the set.
> > 
> > On Fri, Oct 17, 2025 at 03:26:40PM +0200, Hans Verkuil wrote:
> >> The isp_video_mbus_to_pix/pix_to_mbus functions did not take
> >> the last empty entry { 0, } of the formats array into account.
> >>
> >> As a result, isp_video_mbus_to_pix would accept code 0 and
> >> isp_video_pix_to_mbus would select code 0 if no match was found.
> >>
> >> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
> >> ---
> >>  drivers/media/platform/ti/omap3isp/ispvideo.c | 6 +++---
> >>  1 file changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/media/platform/ti/omap3isp/ispvideo.c b/drivers/media/platform/ti/omap3isp/ispvideo.c
> >> index 46609045e2c8..864d38140b87 100644
> >> --- a/drivers/media/platform/ti/omap3isp/ispvideo.c
> >> +++ b/drivers/media/platform/ti/omap3isp/ispvideo.c
> >> @@ -148,12 +148,12 @@ static unsigned int isp_video_mbus_to_pix(const struct isp_video *video,
> >>  	pix->width = mbus->width;
> >>  	pix->height = mbus->height;
> >>  
> >> -	for (i = 0; i < ARRAY_SIZE(formats); ++i) {
> >> +	for (i = 0; i < ARRAY_SIZE(formats) - 1; ++i) {
> > 
> > As it seems all users of the formats array depend on the size of the array
> > and not its contents, could we remove the sentinel entry from the array
> > instead?
> 
> Probably, but see this comment just before the sentinel in the array:
> 
>         /* Empty entry to catch the unsupported pixel code (0) used by the CCDC
>          * module and avoid NULL pointer dereferences.
>          */
>         { 0, }
> 
> Now, I wonder if this comment is out of date, since I don't see code 0 being used
> by CDDC. If you can confirm that that's indeed the case, then I can drop the sentinel.

Yes, please!

-- 
Kind regards,

Sakari Ailus

  reply	other threads:[~2025-12-01 10:22 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-17 13:26 [PATCH 00/14] media: omap3isp: v4l2-compliance fixes Hans Verkuil
2025-10-17 13:26 ` [PATCH 01/14] media: omap3isp: configure entity functions Hans Verkuil
2025-10-17 13:26 ` [PATCH 02/14] media: omap3isp: add V4L2_CAP_IO_MC and don't set bus_info Hans Verkuil
2025-10-17 13:26 ` [PATCH 03/14] media: omap3isp: isp_video_mbus_to_pix/pix_to_mbus fixes Hans Verkuil
2025-10-22  7:48   ` Sakari Ailus
2025-12-01  8:27     ` Hans Verkuil
2025-12-01 10:22       ` Sakari Ailus [this message]
2025-12-01 12:56         ` Sakari Ailus
2025-12-01 15:35           ` Hans Verkuil
2025-12-01 16:43             ` Sakari Ailus
2025-12-02  7:18               ` Hans Verkuil
2025-10-17 13:26 ` [PATCH 04/14] media: omap3isp: implement enum_fmt_vid_cap/out Hans Verkuil
2025-10-22  7:56   ` Sakari Ailus
2025-12-01  8:40     ` Hans Verkuil
2025-12-01 11:35       ` Sakari Ailus
2025-12-01 13:44         ` Hans Verkuil
2025-12-01 15:27           ` Sakari Ailus
2025-10-17 13:26 ` [PATCH 05/14] media: omap3isp: use V4L2_COLORSPACE_SRGB instead of _JPEG Hans Verkuil
2025-10-17 13:26 ` [PATCH 06/14] media: omap3isp: set initial format Hans Verkuil
2025-10-17 13:26 ` [PATCH 07/14] media: omap3isp: rework isp_video_try/set_format Hans Verkuil
2025-10-22  8:04   ` Sakari Ailus
2025-12-01  8:48     ` Hans Verkuil
2025-12-01 12:42       ` Sakari Ailus
2025-10-17 13:26 ` [PATCH 08/14] media: omap3isp: implement create/prepare_bufs Hans Verkuil
2025-10-22  8:06   ` Sakari Ailus
2025-12-01  8:54     ` Hans Verkuil
2025-12-01 12:42       ` Sakari Ailus
2025-10-17 13:26 ` [PATCH 09/14] media: omap3isp: better VIDIOC_G/S_PARM handling Hans Verkuil
2025-10-22  8:09   ` Sakari Ailus
2025-12-01 10:28     ` Hans Verkuil
2025-12-01 13:40       ` Hans Verkuil
2025-12-01 15:10         ` Sakari Ailus
2025-10-17 13:26 ` [PATCH 10/14] media: omap3isp: support ctrl events for isppreview Hans Verkuil
2025-10-17 13:26 ` [PATCH 11/14] media: omap3isp: ispccp2: always clamp in ccp2_try_format() Hans Verkuil
2025-10-17 13:26 ` [PATCH 12/14] media: omap3isp: isppreview: always clamp in preview_try_format() Hans Verkuil
2025-10-17 13:26 ` [PATCH 13/14] DO NOT MERGE: media: omap3isp: change default resolution to 864x648 Hans Verkuil
2025-10-17 13:26 ` [PATCH 14/14] DO NOT MERGE: omap3-beagle-xm.dts: add Leopard Imaging li5m03 support 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=aS1sVLJsj2iDk2qD@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=hverkuil+cisco@kernel.org \
    --cc=laurent.pinchart@ideasonboard.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox