lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
 <PN3P287MB35195F77DB9C8690ED553E1BFF06A@PN3P287MB3519.INDP287.PROD.OUTLOOK.COM>
Date: Tue, 2 Sep 2025 14:30:38 +0000
From: Hardevsinh Palaniya <hardevsinh.palaniya@...iconsignals.io>
To: "sakari.ailus@...ux.intel.com" <sakari.ailus@...ux.intel.com>
CC: Himanshu Bhavani <himanshu.bhavani@...iconsignals.io>, Mauro Carvalho
 Chehab <mchehab@...nel.org>, Rob Herring <robh@...nel.org>, Krzysztof
 Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Hans
 Verkuil <hverkuil@...all.nl>, Ricardo Ribalda <ribalda@...omium.org>, Bryan
 O'Donoghue <bryan.odonoghue@...aro.org>, André Apitzsch
	<git@...tzsch.eu>, Heimir Thor Sverrisson <heimir.sverrisson@...il.com>,
	Benjamin Mugnier <benjamin.mugnier@...s.st.com>, Matthias Fend
	<matthias.fend@...end.at>, Dongcheng Yan <dongcheng.yan@...el.com>, Sylvain
 Petinot <sylvain.petinot@...s.st.com>, Arnd Bergmann <arnd@...db.de>, Andy
 Shevchenko <andriy.shevchenko@...ux.intel.com>, Hans de Goede
	<hansg@...nel.org>, Jingjing Xiong <jingjing.xiong@...el.com>,
	"linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Tarang Raval
	<tarang.raval@...iconsignals.io>
Subject: Re: [PATCH v9 2/2] media: i2c: add ov2735 image sensor driver

Hi Sakari,

> On Mon, Sep 01, 2025 at 06:44:46AM +0000, Tarang Raval wrote:
> > Hi Hardev, Sakari
> >
> > > Add a v4l2 subdevice driver for the Omnivision OV2735 sensor.
> > >
> > > The Omnivision OV2735 is a 1/2.7-Inch CMOS image sensor with an
> > > active array size of 1920 x 1080.
> > >
> > > The following features are supported:
> > > - Manual exposure an gain control support
> > > - vblank/hblank control support
> > > - Test pattern support control
> > > - Supported resolution: 1920 x 1080 @ 30fps (SGRBG10)
> > >
> > > Co-developed-by: Himanshu Bhavani <himanshu.bhavani@...iconsignals.io>
> > > Signed-off-by: Himanshu Bhavani <himanshu.bhavani@...iconsignals.io>
> > > Signed-off-by: Hardevsinh Palaniya <hardevsinh.palaniya@...iconsignals.io>
> > > ---
> > >  MAINTAINERS                |    1 +
> > >  drivers/media/i2c/Kconfig  |   10 +
> > >  drivers/media/i2c/Makefile |    1 +
> > >  drivers/media/i2c/ov2735.c | 1109 ++++++++++++++++++++++++++++++++++++
> > >  4 files changed, 1121 insertions(+)
> > >  create mode 100644 drivers/media/i2c/ov2735.c
> >
> > ...
> >
> > > +static int ov2735_enum_mbus_code(struct v4l2_subdev *sd,
> > > +                                struct v4l2_subdev_state *sd_state,
> > > +                                struct v4l2_subdev_mbus_code_enum *code)
> > > +{
> > > +       if (code->index >= 0)
> >
> > Hardev, I believe this condition is always true.
> >
> > You should write:
> > if (code->index > 0)
> >
> > Sakari, Could you please remove the equals sign when you apply the patch?
> 
> Done. I also switched it to container_of_const(); the diff is:
> 
> diff --git a/drivers/media/i2c/ov2735.c b/drivers/media/i2c/ov2735.c
> index da5978b96146..b96600204141 100644
> --- a/drivers/media/i2c/ov2735.c
> +++ b/drivers/media/i2c/ov2735.c
> @@ -402,7 +402,7 @@ static int ov2735_multi_reg_write(struct ov2735 *ov2735,
> 
>  static inline struct ov2735 *to_ov2735(struct v4l2_subdev *_sd)
>  {
> -       return container_of(_sd, struct ov2735, sd);
> +       return container_of_const(_sd, struct ov2735, sd);
>  }
> 
>  static int ov2735_enable_test_pattern(struct ov2735 *ov2735, u32 pattern)
> @@ -428,8 +428,8 @@ static int ov2735_enable_test_pattern(struct ov2735 *ov2735, u32 pattern)
> 
>  static int ov2735_set_ctrl(struct v4l2_ctrl *ctrl)
>  {
> -       struct ov2735 *ov2735 = container_of(ctrl->handler, struct ov2735,
> -                                            handler);
> +       struct ov2735 *ov2735 =
> +               container_of_const(ctrl->handler, struct ov2735, handler);
>         struct v4l2_mbus_framefmt *fmt;
>         struct v4l2_subdev_state *state;
>         u64 vts;
> @@ -697,7 +697,7 @@ static int ov2735_enum_mbus_code(struct v4l2_subdev *sd,
>                                  struct v4l2_subdev_state *sd_state,
>                                  struct v4l2_subdev_mbus_code_enum *code)
>  {
> -       if (code->index >= 0)
> +       if (code->index)
>                 return -EINVAL;
> 
>         code->code = MEDIA_BUS_FMT_SGRBG10_1X10;

Thanks for your help.

Best Regards,
Hardev

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ