* [hverkuil-media:tegrav3 23/30] drivers/media/i2c/imx274.c:1864:10: warning: variable 'ret' is uninitialized when used here
@ 2020-07-18 19:38 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-07-18 19:38 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 7434 bytes --]
tree: git://linuxtv.org/hverkuil/media_tree.git tegrav3
head: a5858ebb6c4654422918c45ebeb72d824b58efe6
commit: 1c9ebe202e1ddbbd66449325fbd083162ed5cd27 [23/30] media: i2c: Add support for IMX274 supplies and external clock
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project ed6b578040a85977026c93bf4188f996148f3218)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git checkout 1c9ebe202e1ddbbd66449325fbd083162ed5cd27
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/media/i2c/imx274.c:1864:10: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
return ret;
^~~
drivers/media/i2c/imx274.c:1852:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
1 warning generated.
vim +/ret +1864 drivers/media/i2c/imx274.c
1847
1848 static int imx274_probe(struct i2c_client *client)
1849 {
1850 struct v4l2_subdev *sd;
1851 struct stimx274 *imx274;
1852 int ret;
1853
1854 /* initialize imx274 */
1855 imx274 = devm_kzalloc(&client->dev, sizeof(*imx274), GFP_KERNEL);
1856 if (!imx274)
1857 return -ENOMEM;
1858
1859 mutex_init(&imx274->lock);
1860
1861 imx274->xclk = devm_clk_get(&client->dev, "xclk");
1862 if (IS_ERR(imx274->xclk)) {
1863 dev_err(&client->dev, "Failed to get xclk\n");
> 1864 return ret;
1865 }
1866
1867 ret = clk_set_rate(imx274->xclk, IMX274_DEFAULT_CLK_FREQ);
1868 if (ret < 0) {
1869 dev_err(&client->dev, "Failed to set xclk rate\n");
1870 return ret;
1871 }
1872
1873 ret = imx274_get_regulators(&client->dev, imx274);
1874 if (ret) {
1875 dev_err(&client->dev, "Failed to get power regulators, err: %d\n", ret);
1876 return ret;
1877 }
1878
1879 /* initialize format */
1880 imx274->mode = &imx274_modes[IMX274_DEFAULT_BINNING];
1881 imx274->crop.width = IMX274_MAX_WIDTH;
1882 imx274->crop.height = IMX274_MAX_HEIGHT;
1883 imx274->format.width = imx274->crop.width / imx274->mode->bin_ratio;
1884 imx274->format.height = imx274->crop.height / imx274->mode->bin_ratio;
1885 imx274->format.field = V4L2_FIELD_NONE;
1886 imx274->format.code = MEDIA_BUS_FMT_SRGGB10_1X10;
1887 imx274->format.colorspace = V4L2_COLORSPACE_SRGB;
1888 imx274->frame_interval.numerator = 1;
1889 imx274->frame_interval.denominator = IMX274_DEF_FRAME_RATE;
1890
1891 /* initialize regmap */
1892 imx274->regmap = devm_regmap_init_i2c(client, &imx274_regmap_config);
1893 if (IS_ERR(imx274->regmap)) {
1894 dev_err(&client->dev,
1895 "regmap init failed: %ld\n", PTR_ERR(imx274->regmap));
1896 ret = -ENODEV;
1897 goto err_regmap;
1898 }
1899
1900 /* initialize subdevice */
1901 imx274->client = client;
1902 sd = &imx274->sd;
1903 v4l2_i2c_subdev_init(sd, client, &imx274_subdev_ops);
1904 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
1905
1906 /* initialize subdev media pad */
1907 imx274->pad.flags = MEDIA_PAD_FL_SOURCE;
1908 sd->entity.function = MEDIA_ENT_F_CAM_SENSOR;
1909 ret = media_entity_pads_init(&sd->entity, 1, &imx274->pad);
1910 if (ret < 0) {
1911 dev_err(&client->dev,
1912 "%s : media entity init Failed %d\n", __func__, ret);
1913 goto err_regmap;
1914 }
1915
1916 /* initialize sensor reset gpio */
1917 imx274->reset_gpio = devm_gpiod_get_optional(&client->dev, "reset",
1918 GPIOD_OUT_HIGH);
1919 if (IS_ERR(imx274->reset_gpio)) {
1920 if (PTR_ERR(imx274->reset_gpio) != -EPROBE_DEFER)
1921 dev_err(&client->dev, "Reset GPIO not setup in DT");
1922 ret = PTR_ERR(imx274->reset_gpio);
1923 goto err_me;
1924 }
1925
1926 /* initialize controls */
1927 ret = v4l2_ctrl_handler_init(&imx274->ctrls.handler, 4);
1928 if (ret < 0) {
1929 dev_err(&client->dev,
1930 "%s : ctrl handler init Failed\n", __func__);
1931 goto err_me;
1932 }
1933
1934 imx274->ctrls.handler.lock = &imx274->lock;
1935
1936 /* add new controls */
1937 imx274->ctrls.test_pattern = v4l2_ctrl_new_std_menu_items(
1938 &imx274->ctrls.handler, &imx274_ctrl_ops,
1939 V4L2_CID_TEST_PATTERN,
1940 ARRAY_SIZE(tp_qmenu) - 1, 0, 0, tp_qmenu);
1941
1942 imx274->ctrls.gain = v4l2_ctrl_new_std(
1943 &imx274->ctrls.handler,
1944 &imx274_ctrl_ops,
1945 V4L2_CID_GAIN, IMX274_MIN_GAIN,
1946 IMX274_MAX_DIGITAL_GAIN * IMX274_MAX_ANALOG_GAIN, 1,
1947 IMX274_DEF_GAIN);
1948
1949 imx274->ctrls.exposure = v4l2_ctrl_new_std(
1950 &imx274->ctrls.handler,
1951 &imx274_ctrl_ops,
1952 V4L2_CID_EXPOSURE, IMX274_MIN_EXPOSURE_TIME,
1953 1000000 / IMX274_DEF_FRAME_RATE, 1,
1954 IMX274_MIN_EXPOSURE_TIME);
1955
1956 imx274->ctrls.vflip = v4l2_ctrl_new_std(
1957 &imx274->ctrls.handler,
1958 &imx274_ctrl_ops,
1959 V4L2_CID_VFLIP, 0, 1, 1, 0);
1960
1961 imx274->sd.ctrl_handler = &imx274->ctrls.handler;
1962 if (imx274->ctrls.handler.error) {
1963 ret = imx274->ctrls.handler.error;
1964 goto err_ctrls;
1965 }
1966
1967 /* power on the sensor */
1968 ret = imx274_power_on(&client->dev);
1969 if (ret < 0) {
1970 dev_err(&client->dev,
1971 "%s : imx274 power on failed\n", __func__);
1972 goto err_ctrls;
1973 }
1974
1975 /* setup default controls */
1976 ret = v4l2_ctrl_handler_setup(&imx274->ctrls.handler);
1977 if (ret) {
1978 dev_err(&client->dev,
1979 "Error %d setup default controls\n", ret);
1980 goto err_power_off;
1981 }
1982
1983 /* load default control values */
1984 ret = imx274_load_default(imx274);
1985 if (ret) {
1986 dev_err(&client->dev,
1987 "%s : imx274_load_default failed %d\n",
1988 __func__, ret);
1989 goto err_power_off;
1990 }
1991
1992 /* register subdevice */
1993 ret = v4l2_async_register_subdev(sd);
1994 if (ret < 0) {
1995 dev_err(&client->dev,
1996 "%s : v4l2_async_register_subdev failed %d\n",
1997 __func__, ret);
1998 goto err_power_off;
1999 }
2000
2001 dev_info(&client->dev, "imx274 : imx274 probe success !\n");
2002 return 0;
2003
2004 err_power_off:
2005 imx274_power_off(&client->dev);
2006 err_ctrls:
2007 v4l2_ctrl_handler_free(&imx274->ctrls.handler);
2008 err_me:
2009 media_entity_cleanup(&sd->entity);
2010 err_regmap:
2011 mutex_destroy(&imx274->lock);
2012 return ret;
2013 }
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: 75336 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-07-18 19:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-18 19:38 [hverkuil-media:tegrav3 23/30] drivers/media/i2c/imx274.c:1864:10: warning: variable 'ret' is uninitialized when used here kernel test robot
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.