All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [hverkuil-media:tegrav5 4/19] drivers/media/i2c/imx274.c:1864 imx274_probe() error: uninitialized symbol 'ret'.
Date: Sun, 11 Oct 2020 13:50:04 +0800	[thread overview]
Message-ID: <202010111359.B4tWZuAq-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 14708 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Sowjanya Komatineni <skomatineni@nvidia.com>
CC: Hans Verkuil <hverkuil@xs4all.nl>

tree:   git://linuxtv.org/hverkuil/media_tree.git tegrav5
head:   acec5ab54458eb5f6c64faf259a83305398fcff7
commit: 1db17015125eb03cd05ce850e47e21f033b950ba [4/19] media: i2c: Add support for IMX274 supplies and external clock
:::::: branch date: 2 days ago
:::::: commit date: 4 weeks ago
config: i386-randconfig-m021-20201011 (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@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/media/i2c/imx274.c:1864 imx274_probe() error: uninitialized symbol 'ret'.

vim +/ret +1864 drivers/media/i2c/imx274.c

0985dd306f727df Leon Luo            2017-10-05  1847  
e671499303e4c0e Kieran Bingham      2019-07-10  1848  static int imx274_probe(struct i2c_client *client)
0985dd306f727df Leon Luo            2017-10-05  1849  {
0985dd306f727df Leon Luo            2017-10-05  1850  	struct v4l2_subdev *sd;
0985dd306f727df Leon Luo            2017-10-05  1851  	struct stimx274 *imx274;
0985dd306f727df Leon Luo            2017-10-05  1852  	int ret;
0985dd306f727df Leon Luo            2017-10-05  1853  
0985dd306f727df Leon Luo            2017-10-05  1854  	/* initialize imx274 */
0985dd306f727df Leon Luo            2017-10-05  1855  	imx274 = devm_kzalloc(&client->dev, sizeof(*imx274), GFP_KERNEL);
0985dd306f727df Leon Luo            2017-10-05  1856  	if (!imx274)
0985dd306f727df Leon Luo            2017-10-05  1857  		return -ENOMEM;
0985dd306f727df Leon Luo            2017-10-05  1858  
0985dd306f727df Leon Luo            2017-10-05  1859  	mutex_init(&imx274->lock);
0985dd306f727df Leon Luo            2017-10-05  1860  
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1861  	imx274->xclk = devm_clk_get(&client->dev, "xclk");
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1862  	if (IS_ERR(imx274->xclk)) {
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1863  		dev_err(&client->dev, "Failed to get xclk\n");
1db17015125eb03 Sowjanya Komatineni 2020-06-03 @1864  		return ret;
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1865  	}
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1866  
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1867  	ret = clk_set_rate(imx274->xclk, IMX274_DEFAULT_CLK_FREQ);
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1868  	if (ret < 0) {
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1869  		dev_err(&client->dev, "Failed to set xclk rate\n");
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1870  		return ret;
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1871  	}
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1872  
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1873  	ret = imx274_get_regulators(&client->dev, imx274);
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1874  	if (ret) {
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1875  		dev_err(&client->dev, "Failed to get power regulators, err: %d\n", ret);
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1876  		return ret;
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1877  	}
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1878  
438ac1fd5e1e132 Luca Ceresoli       2018-06-11  1879  	/* initialize format */
9648cb577b76ecf Luca Ceresoli       2018-08-24  1880  	imx274->mode = &imx274_modes[IMX274_DEFAULT_BINNING];
39dd23dc9d4c512 Luca Ceresoli       2018-07-25  1881  	imx274->crop.width = IMX274_MAX_WIDTH;
39dd23dc9d4c512 Luca Ceresoli       2018-07-25  1882  	imx274->crop.height = IMX274_MAX_HEIGHT;
39dd23dc9d4c512 Luca Ceresoli       2018-07-25  1883  	imx274->format.width = imx274->crop.width / imx274->mode->bin_ratio;
39dd23dc9d4c512 Luca Ceresoli       2018-07-25  1884  	imx274->format.height = imx274->crop.height / imx274->mode->bin_ratio;
438ac1fd5e1e132 Luca Ceresoli       2018-06-11  1885  	imx274->format.field = V4L2_FIELD_NONE;
438ac1fd5e1e132 Luca Ceresoli       2018-06-11  1886  	imx274->format.code = MEDIA_BUS_FMT_SRGGB10_1X10;
438ac1fd5e1e132 Luca Ceresoli       2018-06-11  1887  	imx274->format.colorspace = V4L2_COLORSPACE_SRGB;
438ac1fd5e1e132 Luca Ceresoli       2018-06-11  1888  	imx274->frame_interval.numerator = 1;
438ac1fd5e1e132 Luca Ceresoli       2018-06-11  1889  	imx274->frame_interval.denominator = IMX274_DEF_FRAME_RATE;
438ac1fd5e1e132 Luca Ceresoli       2018-06-11  1890  
0985dd306f727df Leon Luo            2017-10-05  1891  	/* initialize regmap */
0985dd306f727df Leon Luo            2017-10-05  1892  	imx274->regmap = devm_regmap_init_i2c(client, &imx274_regmap_config);
0985dd306f727df Leon Luo            2017-10-05  1893  	if (IS_ERR(imx274->regmap)) {
0985dd306f727df Leon Luo            2017-10-05  1894  		dev_err(&client->dev,
0985dd306f727df Leon Luo            2017-10-05  1895  			"regmap init failed: %ld\n", PTR_ERR(imx274->regmap));
0985dd306f727df Leon Luo            2017-10-05  1896  		ret = -ENODEV;
0985dd306f727df Leon Luo            2017-10-05  1897  		goto err_regmap;
0985dd306f727df Leon Luo            2017-10-05  1898  	}
0985dd306f727df Leon Luo            2017-10-05  1899  
0985dd306f727df Leon Luo            2017-10-05  1900  	/* initialize subdevice */
0985dd306f727df Leon Luo            2017-10-05  1901  	imx274->client = client;
0985dd306f727df Leon Luo            2017-10-05  1902  	sd = &imx274->sd;
0985dd306f727df Leon Luo            2017-10-05  1903  	v4l2_i2c_subdev_init(sd, client, &imx274_subdev_ops);
0985dd306f727df Leon Luo            2017-10-05  1904  	sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
0985dd306f727df Leon Luo            2017-10-05  1905  
0985dd306f727df Leon Luo            2017-10-05  1906  	/* initialize subdev media pad */
0985dd306f727df Leon Luo            2017-10-05  1907  	imx274->pad.flags = MEDIA_PAD_FL_SOURCE;
0985dd306f727df Leon Luo            2017-10-05  1908  	sd->entity.function = MEDIA_ENT_F_CAM_SENSOR;
0985dd306f727df Leon Luo            2017-10-05  1909  	ret = media_entity_pads_init(&sd->entity, 1, &imx274->pad);
0985dd306f727df Leon Luo            2017-10-05  1910  	if (ret < 0) {
0985dd306f727df Leon Luo            2017-10-05  1911  		dev_err(&client->dev,
0985dd306f727df Leon Luo            2017-10-05  1912  			"%s : media entity init Failed %d\n", __func__, ret);
0985dd306f727df Leon Luo            2017-10-05  1913  		goto err_regmap;
0985dd306f727df Leon Luo            2017-10-05  1914  	}
0985dd306f727df Leon Luo            2017-10-05  1915  
0985dd306f727df Leon Luo            2017-10-05  1916  	/* initialize sensor reset gpio */
0985dd306f727df Leon Luo            2017-10-05  1917  	imx274->reset_gpio = devm_gpiod_get_optional(&client->dev, "reset",
0985dd306f727df Leon Luo            2017-10-05  1918  						     GPIOD_OUT_HIGH);
0985dd306f727df Leon Luo            2017-10-05  1919  	if (IS_ERR(imx274->reset_gpio)) {
0985dd306f727df Leon Luo            2017-10-05  1920  		if (PTR_ERR(imx274->reset_gpio) != -EPROBE_DEFER)
0985dd306f727df Leon Luo            2017-10-05  1921  			dev_err(&client->dev, "Reset GPIO not setup in DT");
0985dd306f727df Leon Luo            2017-10-05  1922  		ret = PTR_ERR(imx274->reset_gpio);
0985dd306f727df Leon Luo            2017-10-05  1923  		goto err_me;
0985dd306f727df Leon Luo            2017-10-05  1924  	}
0985dd306f727df Leon Luo            2017-10-05  1925  
0985dd306f727df Leon Luo            2017-10-05  1926  	/* initialize controls */
82f5b507c0cf35e Luca Ceresoli       2018-11-27  1927  	ret = v4l2_ctrl_handler_init(&imx274->ctrls.handler, 4);
0985dd306f727df Leon Luo            2017-10-05  1928  	if (ret < 0) {
0985dd306f727df Leon Luo            2017-10-05  1929  		dev_err(&client->dev,
0985dd306f727df Leon Luo            2017-10-05  1930  			"%s : ctrl handler init Failed\n", __func__);
0985dd306f727df Leon Luo            2017-10-05  1931  		goto err_me;
0985dd306f727df Leon Luo            2017-10-05  1932  	}
0985dd306f727df Leon Luo            2017-10-05  1933  
0985dd306f727df Leon Luo            2017-10-05  1934  	imx274->ctrls.handler.lock = &imx274->lock;
0985dd306f727df Leon Luo            2017-10-05  1935  
0985dd306f727df Leon Luo            2017-10-05  1936  	/* add new controls */
0985dd306f727df Leon Luo            2017-10-05  1937  	imx274->ctrls.test_pattern = v4l2_ctrl_new_std_menu_items(
0985dd306f727df Leon Luo            2017-10-05  1938  		&imx274->ctrls.handler, &imx274_ctrl_ops,
0985dd306f727df Leon Luo            2017-10-05  1939  		V4L2_CID_TEST_PATTERN,
0985dd306f727df Leon Luo            2017-10-05  1940  		ARRAY_SIZE(tp_qmenu) - 1, 0, 0, tp_qmenu);
0985dd306f727df Leon Luo            2017-10-05  1941  
0985dd306f727df Leon Luo            2017-10-05  1942  	imx274->ctrls.gain = v4l2_ctrl_new_std(
0985dd306f727df Leon Luo            2017-10-05  1943  		&imx274->ctrls.handler,
0985dd306f727df Leon Luo            2017-10-05  1944  		&imx274_ctrl_ops,
0985dd306f727df Leon Luo            2017-10-05  1945  		V4L2_CID_GAIN, IMX274_MIN_GAIN,
0985dd306f727df Leon Luo            2017-10-05  1946  		IMX274_MAX_DIGITAL_GAIN * IMX274_MAX_ANALOG_GAIN, 1,
0985dd306f727df Leon Luo            2017-10-05  1947  		IMX274_DEF_GAIN);
0985dd306f727df Leon Luo            2017-10-05  1948  
0985dd306f727df Leon Luo            2017-10-05  1949  	imx274->ctrls.exposure = v4l2_ctrl_new_std(
0985dd306f727df Leon Luo            2017-10-05  1950  		&imx274->ctrls.handler,
0985dd306f727df Leon Luo            2017-10-05  1951  		&imx274_ctrl_ops,
0985dd306f727df Leon Luo            2017-10-05  1952  		V4L2_CID_EXPOSURE, IMX274_MIN_EXPOSURE_TIME,
0985dd306f727df Leon Luo            2017-10-05  1953  		1000000 / IMX274_DEF_FRAME_RATE, 1,
0985dd306f727df Leon Luo            2017-10-05  1954  		IMX274_MIN_EXPOSURE_TIME);
0985dd306f727df Leon Luo            2017-10-05  1955  
0985dd306f727df Leon Luo            2017-10-05  1956  	imx274->ctrls.vflip = v4l2_ctrl_new_std(
0985dd306f727df Leon Luo            2017-10-05  1957  		&imx274->ctrls.handler,
0985dd306f727df Leon Luo            2017-10-05  1958  		&imx274_ctrl_ops,
0985dd306f727df Leon Luo            2017-10-05  1959  		V4L2_CID_VFLIP, 0, 1, 1, 0);
0985dd306f727df Leon Luo            2017-10-05  1960  
0985dd306f727df Leon Luo            2017-10-05  1961  	imx274->sd.ctrl_handler = &imx274->ctrls.handler;
0985dd306f727df Leon Luo            2017-10-05  1962  	if (imx274->ctrls.handler.error) {
0985dd306f727df Leon Luo            2017-10-05  1963  		ret = imx274->ctrls.handler.error;
0985dd306f727df Leon Luo            2017-10-05  1964  		goto err_ctrls;
0985dd306f727df Leon Luo            2017-10-05  1965  	}
0985dd306f727df Leon Luo            2017-10-05  1966  
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1967  	/* power on the sensor */
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1968  	ret = imx274_power_on(&client->dev);
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1969  	if (ret < 0) {
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1970  		dev_err(&client->dev,
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1971  			"%s : imx274 power on failed\n", __func__);
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1972  		goto err_ctrls;
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1973  	}
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1974  
0985dd306f727df Leon Luo            2017-10-05  1975  	/* setup default controls */
0985dd306f727df Leon Luo            2017-10-05  1976  	ret = v4l2_ctrl_handler_setup(&imx274->ctrls.handler);
0985dd306f727df Leon Luo            2017-10-05  1977  	if (ret) {
0985dd306f727df Leon Luo            2017-10-05  1978  		dev_err(&client->dev,
0985dd306f727df Leon Luo            2017-10-05  1979  			"Error %d setup default controls\n", ret);
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1980  		goto err_power_off;
0985dd306f727df Leon Luo            2017-10-05  1981  	}
0985dd306f727df Leon Luo            2017-10-05  1982  
0985dd306f727df Leon Luo            2017-10-05  1983  	/* load default control values */
0985dd306f727df Leon Luo            2017-10-05  1984  	ret = imx274_load_default(imx274);
0985dd306f727df Leon Luo            2017-10-05  1985  	if (ret) {
0985dd306f727df Leon Luo            2017-10-05  1986  		dev_err(&client->dev,
0985dd306f727df Leon Luo            2017-10-05  1987  			"%s : imx274_load_default failed %d\n",
0985dd306f727df Leon Luo            2017-10-05  1988  			__func__, ret);
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1989  		goto err_power_off;
0985dd306f727df Leon Luo            2017-10-05  1990  	}
0985dd306f727df Leon Luo            2017-10-05  1991  
0985dd306f727df Leon Luo            2017-10-05  1992  	/* register subdevice */
0985dd306f727df Leon Luo            2017-10-05  1993  	ret = v4l2_async_register_subdev(sd);
0985dd306f727df Leon Luo            2017-10-05  1994  	if (ret < 0) {
0985dd306f727df Leon Luo            2017-10-05  1995  		dev_err(&client->dev,
0985dd306f727df Leon Luo            2017-10-05  1996  			"%s : v4l2_async_register_subdev failed %d\n",
0985dd306f727df Leon Luo            2017-10-05  1997  			__func__, ret);
1db17015125eb03 Sowjanya Komatineni 2020-06-03  1998  		goto err_power_off;
0985dd306f727df Leon Luo            2017-10-05  1999  	}
0985dd306f727df Leon Luo            2017-10-05  2000  
0985dd306f727df Leon Luo            2017-10-05  2001  	dev_info(&client->dev, "imx274 : imx274 probe success !\n");
0985dd306f727df Leon Luo            2017-10-05  2002  	return 0;
0985dd306f727df Leon Luo            2017-10-05  2003  
1db17015125eb03 Sowjanya Komatineni 2020-06-03  2004  err_power_off:
1db17015125eb03 Sowjanya Komatineni 2020-06-03  2005  	imx274_power_off(&client->dev);
0985dd306f727df Leon Luo            2017-10-05  2006  err_ctrls:
781b045baefdabf Sakari Ailus        2017-11-01  2007  	v4l2_ctrl_handler_free(&imx274->ctrls.handler);
0985dd306f727df Leon Luo            2017-10-05  2008  err_me:
0985dd306f727df Leon Luo            2017-10-05  2009  	media_entity_cleanup(&sd->entity);
0985dd306f727df Leon Luo            2017-10-05  2010  err_regmap:
0985dd306f727df Leon Luo            2017-10-05  2011  	mutex_destroy(&imx274->lock);
0985dd306f727df Leon Luo            2017-10-05  2012  	return ret;
0985dd306f727df Leon Luo            2017-10-05  2013  }
0985dd306f727df Leon Luo            2017-10-05  2014  

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33743 bytes --]

             reply	other threads:[~2020-10-11  5:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-11  5:50 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-10-12 12:29 [hverkuil-media:tegrav5 4/19] drivers/media/i2c/imx274.c:1864 imx274_probe() error: uninitialized symbol 'ret' Dan Carpenter
2020-10-12 12:29 ` Dan Carpenter

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=202010111359.B4tWZuAq-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.