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] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <PN3P287MB351951A3DBA4FA85404DA410FF51A@PN3P287MB3519.INDP287.PROD.OUTLOOK.COM>
Date: Thu, 17 Jul 2025 07:26:49 +0000
From: Hardevsinh Palaniya <hardevsinh.palaniya@...iconsignals.io>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
CC: "sakari.ailus@...ux.intel.com" <sakari.ailus@...ux.intel.com>,
	"laurent.pinchart@...asonboard.com" <laurent.pinchart@...asonboard.com>,
	"krzk+dt@...nel.org" <krzk+dt@...nel.org>, Himanshu Bhavani
	<himanshu.bhavani@...iconsignals.io>, Mauro Carvalho Chehab
	<mchehab@...nel.org>, Rob Herring <robh@...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>, Hans
 de Goede <hansg@...nel.org>, André Apitzsch
	<git@...tzsch.eu>, Sylvain Petinot <sylvain.petinot@...s.st.com>, Matthias
 Fend <matthias.fend@...end.at>, Dongcheng Yan <dongcheng.yan@...el.com>,
	Benjamin Mugnier <benjamin.mugnier@...s.st.com>, Heimir Thor Sverrisson
	<heimir.sverrisson@...il.com>, Jingjing Xiong <jingjing.xiong@...el.com>,
	Arnd Bergmann <arnd@...db.de>, "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>
Subject: Re: [PATCH v4 2/2] media: i2c: add ov2735 image sensor driver

Hi Andy,

> On Wed, Jul 16, 2025 at 07:14:17PM +0530, Hardevsinh Palaniya wrote:
> > 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)
> 
> ...
> 
> > +static int ov2735_page_access(struct ov2735 *ov2735,
> > +                           u32 reg, void *val, int *err, bool is_read)
> > +{
> > +     u8 page = (reg >> CCI_REG_PRIVATE_SHIFT) & 0xff;
> > +     u32 addr = reg & ~CCI_REG_PRIVATE_MASK;
> > +     int ret = 0;
> > +
> > +     if (err && *err)
> > +             return *err;
> > +
> > +     mutex_lock(&ov2735->page_lock);
> > +
> > +     /* Perform page access before read/write */
> > +     if (ov2735->current_page != page) {
> > +             ret = cci_write(ov2735->cci, OV2735_REG_PAGE_SELECT, page, &ret);
> > +             if (ret)
> > +                     goto err_mutex_unlock;
> > +             ov2735->current_page = page;
> > +     }
> > +
> > +     if (is_read)
> > +             ret = cci_read(ov2735->cci, addr, (u64 *)val, err);
> > +     else
> > +             ret = cci_write(ov2735->cci, addr, *(u64 *)val, err);
> > +
> > +err_mutex_unlock:
> 
> > +     if (ret && err)
> 
> Why do you need to check for ret != 0?

To prevents overwriting *err with 0 on successful operations, which could 
obscure previous errors. 

Best Regards,
Hardev

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ