All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Kate Hsuan <hpa@redhat.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans de Goede <hdegoede@redhat.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Kate Hsuan <hpa@redhat.com>
Subject: Re: [PATCH] media: Add t4ka3 camera sensor driver
Date: Thu, 3 Oct 2024 19:24:22 +0800	[thread overview]
Message-ID: <202410031909.fcXYISbG-lkp@intel.com> (raw)
In-Reply-To: <20241002093037.50875-1-hpa@redhat.com>

Hi Kate,

kernel test robot noticed the following build warnings:

[auto build test WARNING on media-tree/master]
[also build test WARNING on linuxtv-media-stage/master sailus-media-tree/master linus/master v6.12-rc1 next-20241003]
[cannot apply to sailus-media-tree/streams]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Kate-Hsuan/media-Add-t4ka3-camera-sensor-driver/20241002-173303
base:   git://linuxtv.org/media_tree.git master
patch link:    https://lore.kernel.org/r/20241002093037.50875-1-hpa%40redhat.com
patch subject: [PATCH] media: Add t4ka3 camera sensor driver
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20241003/202410031909.fcXYISbG-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241003/202410031909.fcXYISbG-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/202410031909.fcXYISbG-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/media/i2c/t4ka3.c:628:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
     628 |         if (sensor->streaming == enable) {
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/t4ka3.c:689:9: note: uninitialized use occurs here
     689 |         return ret;
         |                ^~~
   drivers/media/i2c/t4ka3.c:628:2: note: remove the 'if' if its condition is always false
     628 |         if (sensor->streaming == enable) {
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     629 |                 dev_warn(sensor->dev, "Stream already %s\n", enable ? "started" : "stopped");
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     630 |                 goto error_unlock;
         |                 ~~~~~~~~~~~~~~~~~~
     631 |         }
         |         ~
   drivers/media/i2c/t4ka3.c:624:9: note: initialize the variable 'ret' to silence this warning
     624 |         int ret;
         |                ^
         |                 = 0
   1 warning generated.


vim +628 drivers/media/i2c/t4ka3.c

   620	
   621	static int t4ka3_s_stream(struct v4l2_subdev *sd, int enable)
   622	{
   623		struct t4ka3_data *sensor = to_t4ka3_sensor(sd);
   624		int ret;
   625	
   626		mutex_lock(&sensor->lock);
   627	
 > 628		if (sensor->streaming == enable) {
   629			dev_warn(sensor->dev, "Stream already %s\n", enable ? "started" : "stopped");
   630			goto error_unlock;
   631		}
   632	
   633		if (enable) {
   634			ret = pm_runtime_get_sync(sensor->sd.dev);
   635			if (ret) {
   636				dev_err(sensor->dev, "power-up err.\n");
   637				goto error_unlock;
   638			}
   639	
   640			cci_multi_reg_write(sensor->regmap, t4ka3_init_config,
   641					    ARRAY_SIZE(t4ka3_init_config), &ret);
   642			/* enable group hold */
   643			cci_write(sensor->regmap, T4KA3_REG_PARAM_HOLD, 1, &ret);
   644			cci_multi_reg_write(sensor->regmap, t4ka3_pre_mode_set_regs,
   645					    ARRAY_SIZE(t4ka3_pre_mode_set_regs), &ret);
   646			if (ret)
   647				goto error_powerdown;
   648	
   649			ret = t4ka3_set_mode(sensor);
   650			if (ret)
   651				goto error_powerdown;
   652	
   653			ret = cci_multi_reg_write(sensor->regmap, t4ka3_post_mode_set_regs,
   654						  ARRAY_SIZE(t4ka3_post_mode_set_regs), NULL);
   655			if (ret)
   656				goto error_powerdown;
   657	
   658			/* Restore value of all ctrls */
   659			ret = __v4l2_ctrl_handler_setup(&sensor->ctrls.handler);
   660			if (ret)
   661				goto error_powerdown;
   662	
   663			/* disable group hold */
   664			cci_write(sensor->regmap, T4KA3_REG_PARAM_HOLD, 0, &ret);
   665			cci_write(sensor->regmap, T4KA3_REG_STREAM, 1, &ret);
   666			if (ret)
   667				goto error_powerdown;
   668	
   669			sensor->streaming = 1;
   670		} else {
   671			ret = cci_write(sensor->regmap, T4KA3_REG_STREAM, 0, NULL);
   672			if (ret)
   673				goto error_powerdown;
   674	
   675			ret = pm_runtime_put(sensor->sd.dev);
   676			if (ret)
   677				goto error_unlock;
   678	
   679			sensor->streaming = 0;
   680		}
   681	
   682		mutex_unlock(&sensor->lock);
   683		return ret;
   684	
   685	error_powerdown:
   686		ret = pm_runtime_put(sensor->sd.dev);
   687	error_unlock:
   688		mutex_unlock(&sensor->lock);
   689		return ret;
   690	}
   691	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

      parent reply	other threads:[~2024-10-03 11:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-02  9:30 [PATCH] media: Add t4ka3 camera sensor driver Kate Hsuan
2024-10-02 21:02 ` Christophe JAILLET
2024-10-04  6:30   ` Kate Hsuan
2024-10-03 10:22 ` kernel test robot
2024-10-03 11:24 ` kernel test robot [this message]

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=202410031909.fcXYISbG-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=hdegoede@redhat.com \
    --cc=hpa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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.