* [pinchartl:nxp/v6.10/dev/rpi-cam-mipi 46/81] drivers/media/i2c/ar0144.c:470:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false
@ 2024-06-15 14:36 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-06-15 14:36 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: llvm, oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git nxp/v6.10/dev/rpi-cam-mipi
head: 5a42e32f7a80b2729b81fa757c9531a7ec7127f9
commit: a082838244bc3478b888d88e932e5afe6a361b49 [46/81] media: i2c: ar0144: Refactor s_stream
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20240615/202406152210.BoPs7o2U-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240615/202406152210.BoPs7o2U-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406152210.BoPs7o2U-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/media/i2c/ar0144.c:470:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
470 | if (enable) {
| ^~~~~~
drivers/media/i2c/ar0144.c:489:9: note: uninitialized use occurs here
489 | return ret;
| ^~~
drivers/media/i2c/ar0144.c:470:2: note: remove the 'if' if its condition is always true
470 | if (enable) {
| ^~~~~~~~~~~
471 | ret = pm_runtime_resume_and_get(sensor->dev);
472 | if (ret < 0)
473 | goto unlock;
474 |
475 | ret = ar0144_start_streaming(sensor, state);
476 | if (ret) {
477 | dev_err(sensor->dev, "Failed to start streaming: %d\n",
478 | ret);
479 | pm_runtime_put_sync(sensor->dev);
480 | }
481 | } else {
| ~~~~~~
482 | ar0144_stop_streaming(sensor);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
483 | pm_runtime_mark_last_busy(sensor->dev);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
484 | pm_runtime_put_autosuspend(sensor->dev);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
485 | }
| ~
drivers/media/i2c/ar0144.c:466:9: note: initialize the variable 'ret' to silence this warning
466 | int ret;
| ^
| = 0
1 warning generated.
vim +470 drivers/media/i2c/ar0144.c
457
458 /* -----------------------------------------------------------------------------
459 * V4L2 subdev operations
460 */
461
462 static int ar0144_s_stream(struct v4l2_subdev *subdev, int enable)
463 {
464 struct ar0144 *sensor = to_ar0144(subdev);
465 struct v4l2_subdev_state *state;
466 int ret;
467
468 state = v4l2_subdev_lock_and_get_active_state(subdev);
469
> 470 if (enable) {
471 ret = pm_runtime_resume_and_get(sensor->dev);
472 if (ret < 0)
473 goto unlock;
474
475 ret = ar0144_start_streaming(sensor, state);
476 if (ret) {
477 dev_err(sensor->dev, "Failed to start streaming: %d\n",
478 ret);
479 pm_runtime_put_sync(sensor->dev);
480 }
481 } else {
482 ar0144_stop_streaming(sensor);
483 pm_runtime_mark_last_busy(sensor->dev);
484 pm_runtime_put_autosuspend(sensor->dev);
485 }
486
487 unlock:
488 v4l2_subdev_unlock_state(state);
489 return ret;
490 }
491
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-06-15 14:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-15 14:36 [pinchartl:nxp/v6.10/dev/rpi-cam-mipi 46/81] drivers/media/i2c/ar0144.c:470:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false 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;
as well as URLs for NNTP newsgroup(s).