Re: [PATCH 1/2] media: i2c: Add driver for the Sony Exmor-RS IMX300 camera sensor

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

 



Hi,

url:    https://github.com/0day-ci/linux/commits/kholk11-gmail-com/Add-support-for-the-Sony-Exmor-RS-IMX300-camera-sensor/20201018-203244
base:   git://linuxtv.org/media_tree.git master
config: x86_64-randconfig-m001-20201022 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

smatch warnings:
drivers/media/i2c/imx300.c:2413 imx300_set_framefmt() error: uninitialized symbol 'ret'.

vim +/ret +2413 drivers/media/i2c/imx300.c

c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2377  static int imx300_set_framefmt(struct imx300 *imx300)
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2378  {
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2379  	int ret;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2380  
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2381  	switch (imx300->fmt.code) {
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2382  	case MEDIA_BUS_FMT_SRGGB8_1X8:
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2383  		fallthrough;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2384  	case MEDIA_BUS_FMT_SGRBG8_1X8:
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2385  		fallthrough;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2386  	case MEDIA_BUS_FMT_SGBRG8_1X8:
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2387  		fallthrough;

These fallthrough annotations are not required.

c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2388  	case MEDIA_BUS_FMT_SBGGR8_1X8:
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2389  		ret = imx300_write_regs(imx300, raw8_framefmt_regs,
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2390  					ARRAY_SIZE(raw8_framefmt_regs));
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2391  		if (ret)
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2392  			return ret;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2393  		imx300->cur_bps = 8;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2394  		break;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2395  	case MEDIA_BUS_FMT_SRGGB10_1X10:
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2396  		fallthrough;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2397  	case MEDIA_BUS_FMT_SGRBG10_1X10:
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2398  		fallthrough;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2399  	case MEDIA_BUS_FMT_SGBRG10_1X10:
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2400  		fallthrough;

It would look a lot nicer with the annotations removed.  Fall through
is assumed with an empty label.

c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2401  	case MEDIA_BUS_FMT_SBGGR10_1X10:
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2402  		ret = imx300_write_regs(imx300, raw10_framefmt_regs,
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2403  					ARRAY_SIZE(raw10_framefmt_regs));
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2404  		if (ret)
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2405  			return ret;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2406  		imx300->cur_bps = 10;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2407  		break;

No default case.

c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2408  	}
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2409  
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2410  	/* Update the pixel rate to eventually save some power */
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2411  	__v4l2_ctrl_s_ctrl_int64(imx300->pixel_rate, get_pixel_rate(imx300));
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2412  
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18 @2413  	return ret;

Just "return 0;"  It's more readable to return a literal.

c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2414  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux