linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [input:next 2641/2648] drivers/input/touchscreen/iqs5xx.c:897:6: warning: variable 'error_bl' is used uninitialized whenever 'if' condition is true
@ 2021-01-25 12:35 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-01-25 12:35 UTC (permalink / raw)
  To: Jeff LaBundy; +Cc: kbuild-all, clang-built-linux, linux-input, Dmitry Torokhov

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
head:   3bdffa8ffb45c4f217d31a9250e90432ac31b35e
commit: 2539da6677b6355e124b99d1dbe15eb1066f1d46 [2641/2648] Input: iqs5xx - preserve bootloader errors
config: s390-randconfig-r025-20210125 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 12d0753aca22896fda2cf76781b0ee0524d55065)
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 s390 cross compiling tool for clang build
        # apt-get install binutils-s390x-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git/commit/?id=2539da6677b6355e124b99d1dbe15eb1066f1d46
        git remote add input https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git
        git fetch --no-tags input next
        git checkout 2539da6677b6355e124b99d1dbe15eb1066f1d46
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390 

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/input/touchscreen/iqs5xx.c:897:6: warning: variable 'error_bl' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (error)
               ^~~~~
   drivers/input/touchscreen/iqs5xx.c:952:6: note: uninitialized use occurs here
           if (error_bl)
               ^~~~~~~~
   drivers/input/touchscreen/iqs5xx.c:897:2: note: remove the 'if' if its condition is always false
           if (error)
           ^~~~~~~~~~
   drivers/input/touchscreen/iqs5xx.c:886:21: note: initialize the variable 'error_bl' to silence this warning
           int error, error_bl;
                              ^
                               = 0
   1 warning generated.


vim +897 drivers/input/touchscreen/iqs5xx.c

7b5bb55d0dad859e Jeff LaBundy 2019-04-30  882  
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  883  static int iqs5xx_fw_file_write(struct i2c_client *client, const char *fw_file)
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  884  {
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  885  	struct iqs5xx_private *iqs5xx = i2c_get_clientdata(client);
2539da6677b6355e Jeff LaBundy 2021-01-24  886  	int error, error_bl;
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  887  	u8 *pmap;
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  888  
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  889  	if (iqs5xx->bl_status == IQS5XX_BL_STATUS_NONE)
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  890  		return -EPERM;
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  891  
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  892  	pmap = kzalloc(IQS5XX_PMAP_LEN, GFP_KERNEL);
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  893  	if (!pmap)
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  894  		return -ENOMEM;
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  895  
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  896  	error = iqs5xx_fw_file_parse(client, fw_file, pmap);
7b5bb55d0dad859e Jeff LaBundy 2019-04-30 @897  	if (error)
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  898  		goto err_kfree;
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  899  
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  900  	mutex_lock(&iqs5xx->lock);
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  901  
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  902  	/*
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  903  	 * Disable the interrupt line in case the first attempt(s) to enter the
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  904  	 * bootloader don't happen quickly enough, in which case the device may
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  905  	 * assert the RDY output until the next attempt.
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  906  	 */
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  907  	disable_irq(client->irq);
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  908  
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  909  	iqs5xx->bl_status = IQS5XX_BL_STATUS_RESET;
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  910  
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  911  	error = iqs5xx_bl_cmd(client, IQS5XX_BL_CMD_VER, 0);
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  912  	if (error) {
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  913  		error = iqs5xx_bl_open(client);
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  914  		if (error)
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  915  			goto err_reset;
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  916  	}
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  917  
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  918  	error = iqs5xx_bl_write(client, IQS5XX_CHKSM, pmap, IQS5XX_PMAP_LEN);
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  919  	if (error)
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  920  		goto err_reset;
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  921  
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  922  	error = iqs5xx_bl_cmd(client, IQS5XX_BL_CMD_CRC, 0);
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  923  	if (error)
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  924  		goto err_reset;
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  925  
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  926  	error = iqs5xx_bl_verify(client, IQS5XX_CSTM,
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  927  				 pmap + IQS5XX_CHKSM_LEN + IQS5XX_APP_LEN,
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  928  				 IQS5XX_CSTM_LEN);
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  929  	if (error)
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  930  		goto err_reset;
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  931  
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  932  	error = iqs5xx_bl_cmd(client, IQS5XX_BL_CMD_EXEC, 0);
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  933  
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  934  err_reset:
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  935  	if (error) {
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  936  		iqs5xx_reset(client);
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  937  		usleep_range(10000, 10100);
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  938  	}
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  939  
2539da6677b6355e Jeff LaBundy 2021-01-24  940  	error_bl = error;
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  941  	error = iqs5xx_dev_init(client);
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  942  	if (!error && iqs5xx->bl_status == IQS5XX_BL_STATUS_RESET)
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  943  		error = -EINVAL;
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  944  
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  945  	enable_irq(client->irq);
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  946  
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  947  	mutex_unlock(&iqs5xx->lock);
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  948  
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  949  err_kfree:
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  950  	kfree(pmap);
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  951  
2539da6677b6355e Jeff LaBundy 2021-01-24  952  	if (error_bl)
2539da6677b6355e Jeff LaBundy 2021-01-24  953  		return error_bl;
2539da6677b6355e Jeff LaBundy 2021-01-24  954  
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  955  	return error;
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  956  }
7b5bb55d0dad859e Jeff LaBundy 2019-04-30  957  

:::::: The code at line 897 was first introduced by commit
:::::: 7b5bb55d0dad859ee5bb41b1664e2ac577378c38 Input: add support for Azoteq IQS550/572/525

:::::: TO: Jeff LaBundy <jeff@labundy.com>
:::::: CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>

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

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-26 19:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25 12:35 [input:next 2641/2648] drivers/input/touchscreen/iqs5xx.c:897:6: warning: variable 'error_bl' is used uninitialized whenever 'if' condition is true 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).