Re: [bug report] media: i2c: Add support for alvium camera

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dan,

On Thu, Jan 18, 2024 at 09:56:02AM +0300, Dan Carpenter wrote:
> On Thu, Jan 18, 2024 at 09:54:06AM +0300, Dan Carpenter wrote:
> > Hello Tommaso Merciai,
> > 
> > The patch 0a7af872915e: "media: i2c: Add support for alvium camera"
> > from Dec 4, 2023 (linux-next), leads to the following Smatch static
> > checker warning:
> > 
> > 	drivers/media/i2c/alvium-csi2.c:420 alvium_get_fw_version()
> > 	error: uninitialized symbol 'spec'.
> > 
> > drivers/media/i2c/alvium-csi2.c
> >     403 static int alvium_get_fw_version(struct alvium_dev *alvium)
> >     404 {
> >     405         struct device *dev = &alvium->i2c_client->dev;
> >     406         u64 spec, maj, min, pat;
> >     407         int ret = 0;
> >     408 
> >     409         ret = alvium_read(alvium, REG_BCRM_DEVICE_FW_SPEC_VERSION_R,
> >     410                           &spec, &ret);
> >     411         ret = alvium_read(alvium, REG_BCRM_DEVICE_FW_MAJOR_VERSION_R,
> >     412                           &maj, &ret);
> >     413         ret = alvium_read(alvium, REG_BCRM_DEVICE_FW_MINOR_VERSION_R,
> >     414                           &min, &ret);
> >     415         ret = alvium_read(alvium, REG_BCRM_DEVICE_FW_PATCH_VERSION_R,
> >     416                           &pat, &ret);
> >     417         if (ret)
> >     418                 return ret;
> > 
> > Only the last read is checked.
> 
> Oops.  Sorry for the noise.  I hadn't seen that it takes &ret as an
> argument and so it preserves the first error code.
> 

Thanks for your comment.
No problem :)

Yep ret is checked on every call, if one fail this is propaged to every
others calls.

We already talk about this into the driver thread and Laurent give me
this really smart solution :)


Thanks & Regards,
Tommaso

> regards,
> dan carpenter
> 
> 




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux