[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZlQ2zymJguCipLMl@valkosipuli.retiisi.eu>
Date: Mon, 27 May 2024 07:31:27 +0000
From: Sakari Ailus <sakari.ailus@....fi>
To: Benjamin Mugnier <benjamin.mugnier@...s.st.com>
Cc: Sylvain Petinot <sylvain.petinot@...s.st.com>, mchehab@...nel.org,
robh@...nel.org, krzysztof.kozlowski+dt@...aro.org,
conor+dt@...nel.org, linux-media@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
hdegoede@...hat.com, laurent.pinchart@...asonboard.com
Subject: Re: [PATCH 2/2] media: i2c: Add driver for ST VD56G3 camera sensor
Hi Benjamin,
On Mon, May 13, 2024 at 03:37:25PM +0200, Benjamin Mugnier wrote:
> >>> +static int vd56g3_read_expo_cluster(struct vd56g3 *sensor, bool force_cur_val)
> >>> +{
> >>> + u64 exposure = 0;
> >>> + u64 again = 0;
> >>> + u64 dgain = 0;
> >>
> >> Do you need the assignments? The values are assigned by cci_read() below,
> >> right?
> >
> > Well initially, I didn't have those assignments and some checker
> > complains (Honestly I didn't investigate the warning).
> > I will double check and see if they are necessary.
> >
>
> Since I have smatch ready, I ran it without these initialization against
> the latest media tree. I got these :
>
> drivers/media/i2c/st-vd56g3.c:403 vd56g3_read_expo_cluster() error:
> uninitialized symbol 'exposure'.
> drivers/media/i2c/st-vd56g3.c:404 vd56g3_read_expo_cluster() error:
> uninitialized symbol 'again'.
> drivers/media/i2c/st-vd56g3.c:405 vd56g3_read_expo_cluster() error:
> uninitialized symbol 'dgain'.
> drivers/media/i2c/st-vd56g3.c:407 vd56g3_read_expo_cluster() error:
> uninitialized symbol 'exposure'.
> drivers/media/i2c/st-vd56g3.c:408 vd56g3_read_expo_cluster() error:
> uninitialized symbol 'again'.
> drivers/media/i2c/st-vd56g3.c:409 vd56g3_read_expo_cluster() error:
> uninitialized symbol 'dgain'.
>
> cci_read() is indeed not modifying its 'var' argument in the default
> case of the switch [1]. Spawning these errors.
> Adding a '*val = 0' in the default case would also fix it, but will
> change the function behavior.
I think I'd add the assignment to cci_read(). This isn't the only driver
that's affected. In the best case smatch would be fixed to figure this out.
Any thoughts?
Cc also Hans and Laurent.
--
Regards,
Sakari Ailus
Powered by blists - more mailing lists