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

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

 



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.  Sometimes people OR the results together.

	ret = 0;
	ret |= alvium_read();
	ret |= alvium_read();
	ret |= alvium_read();
	if (ret)
		return -EIO;

    419 
--> 420         dev_info(dev, "fw version: %llu.%llu.%llu.%llu\n", spec, maj, min, pat);
    421 
    422         return 0;
    423 }

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