mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@iki.fi>
To: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
Cc: Sylvain Petinot <sylvain.petinot@foss.st.com>,
	mchehab@kernel.org, robh@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, hdegoede@redhat.com,
	laurent.pinchart@ideasonboard.com
Subject: Re: [PATCH 2/2] media: i2c: Add driver for ST VD56G3 camera sensor
Date: Mon, 27 May 2024 07:31:27 +0000	[thread overview]
Message-ID: <ZlQ2zymJguCipLMl@valkosipuli.retiisi.eu> (raw)
In-Reply-To: <c9b35dc4-6f52-48e2-8952-5a43c500f819@foss.st.com>

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

  reply	other threads:[~2024-05-27  7:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17 13:34 [PATCH 0/2] media: " Sylvain Petinot
2024-04-17 13:34 ` [PATCH 1/2] media: dt-bindings: Add ST VD56G3 camera sensor binding Sylvain Petinot
2024-04-18 13:09   ` Rob Herring
2024-05-03  8:25     ` Sylvain Petinot
2024-05-03 16:06       ` Krzysztof Kozlowski
2024-05-27 19:05         ` Krzysztof Kozlowski
2024-04-24 20:46   ` Sakari Ailus
2024-05-03  8:40     ` Sylvain Petinot
2024-04-17 13:34 ` [PATCH 2/2] media: i2c: Add driver for ST VD56G3 camera sensor Sylvain Petinot
2024-04-18  5:39   ` kernel test robot
2024-04-18  9:17   ` Tommaso Merciai
2024-05-03  7:54     ` Sylvain Petinot
2024-05-06  8:23       ` Tommaso Merciai
2024-04-24 21:12   ` Sakari Ailus
2024-05-03 10:10     ` Sylvain Petinot
2024-05-13 13:37       ` Benjamin Mugnier
2024-05-27  7:31         ` Sakari Ailus [this message]
2024-05-27  7:44           ` Benjamin Mugnier
2024-05-27  7:45             ` Sakari Ailus

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=ZlQ2zymJguCipLMl@valkosipuli.retiisi.eu \
    --to=sakari.ailus@iki.fi \
    --cc=benjamin.mugnier@foss.st.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=sylvain.petinot@foss.st.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

all inboxes | Powered by JetHome®