* Re: [PATCH v2 6/6] media: i2c: Add driver for mlx7502x ToF sensor
[not found] <6f9b20bb1946d8a50170963b84e32abfdee14ba7.1657786765.git.vkh@melexis.com>
@ 2022-07-18 6:20 ` kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-07-18 6:20 UTC (permalink / raw)
To: Volodymyr Kharuk, linux-media
Cc: llvm, kbuild-all, Volodymyr Kharuk, Andrii Kyselov,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Hyun Kwon, Laurent Pinchart, Michal Simek, Kieran Bingham,
devicetree
Hi Volodymyr,
I love your patch! Perhaps something to improve:
[auto build test WARNING on d8e8aa866ed8636fd6c1017c3d9453eab2922496]
url: https://github.com/intel-lab-lkp/linux/commits/Volodymyr-Kharuk/media-i2c-mlx7502x-ToF-camera-support/20220714-163709
base: d8e8aa866ed8636fd6c1017c3d9453eab2922496
config: hexagon-allyesconfig (https://download.01.org/0day-ci/archive/20220718/202207181432.DwoL0GPb-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 07022e6cf9b5b3baa642be53d0b3c3f1c403dbfd)
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
# https://github.com/intel-lab-lkp/linux/commit/59a691c2f449518699a328ea663098aa3ae038b9
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Volodymyr-Kharuk/media-i2c-mlx7502x-ToF-camera-support/20220714-163709
git checkout 59a691c2f449518699a328ea663098aa3ae038b9
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/media/i2c/ drivers/net/pcs/ kernel/trace/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/media/i2c/mlx7502x.c:981:13: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
} else if (!on && sensor->streaming) {
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/mlx7502x.c:993:9: note: uninitialized use occurs here
return ret;
^~~
drivers/media/i2c/mlx7502x.c:981:9: note: remove the 'if' if its condition is always true
} else if (!on && sensor->streaming) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/i2c/mlx7502x.c:981:13: warning: variable 'ret' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
} else if (!on && sensor->streaming) {
^~~
drivers/media/i2c/mlx7502x.c:993:9: note: uninitialized use occurs here
return ret;
^~~
drivers/media/i2c/mlx7502x.c:981:13: note: remove the '&&' if its condition is always true
} else if (!on && sensor->streaming) {
^~~~~~
drivers/media/i2c/mlx7502x.c:945:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
2 warnings generated.
vim +981 drivers/media/i2c/mlx7502x.c
941
942 static int mlx7502x_s_stream(struct v4l2_subdev *sd, int on)
943 {
944 struct mlx7502x *sensor = to_mlx7502x(sd);
945 int ret;
946
947 mutex_lock(&sensor->lock);
948
949 if (on && !sensor->streaming) {
950 ret = pm_runtime_resume_and_get(sensor->dev);
951 if (ret < 0) {
952 mutex_unlock(&sensor->lock);
953 return ret;
954 }
955
956 ret = __v4l2_ctrl_handler_setup(sd->ctrl_handler);
957 if (ret < 0)
958 goto error_stream;
959 /* the registers below depends on hmax, which is configured in controls */
960 ret = mlx7502x_set_link_freq(sensor);
961 if (ret < 0)
962 goto error_stream;
963 ret = mlx7502x_update_output_format(sensor);
964 if (ret < 0)
965 goto error_stream;
966 ret = mlx7502x_set_trigger_mode(sensor);
967 if (ret < 0)
968 goto error_stream;
969
970 ret = mlx7502x_write8(sd, MLX7502X_STREAM_EN_REG, 1u);
971 if (ret < 0)
972 goto error_stream;
973
974 sensor->streaming = 1u;
975 dev_dbg(sensor->dev, "stream enabled\n");
976
977 /* we need to wait to stabilize the system after streaming on */
978 usleep_range(MLX7502X_STREAMING_DELAY_US, MLX7502X_STREAMING_DELAY_US + 10);
979
980 gpiod_set_value_cansleep(sensor->leden, 1);
> 981 } else if (!on && sensor->streaming) {
982 gpiod_set_value_cansleep(sensor->leden, 0);
983
984 sensor->streaming = 0u;
985 ret = mlx7502x_write8(sd, MLX7502X_STREAM_EN_REG, 0u);
986 dev_dbg(sensor->dev, "stream disabled\n");
987
988 pm_runtime_mark_last_busy(sensor->dev);
989 pm_runtime_put_autosuspend(sensor->dev);
990 }
991
992 mutex_unlock(&sensor->lock);
993 return ret;
994
995 error_stream:
996 pm_runtime_put(sensor->dev);
997 mutex_unlock(&sensor->lock);
998 return ret;
999 }
1000
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-18 6:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <6f9b20bb1946d8a50170963b84e32abfdee14ba7.1657786765.git.vkh@melexis.com>
2022-07-18 6:20 ` [PATCH v2 6/6] media: i2c: Add driver for mlx7502x ToF sensor kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox