All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/power/supply/bq256xx_charger.c:346:12: warning: Identical inner 'if' condition is always true. [identicalInnerCondition]
@ 2021-04-20 18:57 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-04-20 18:57 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: "Ricardo Rivera-Matos" <r-rivera-matos@ti.com>
CC: Sebastian Reichel <sre@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7af08140979a6e7e12b78c93b8625c8d25b084e2
commit: 32e4978bb920d047fe5de3ea42d176f267c01f63 power: supply: bq256xx: Introduce the BQ256XX charger driver
date:   3 months ago
:::::: branch date: 21 hours ago
:::::: commit date: 3 months ago
compiler: mips64-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> drivers/power/supply/bq256xx_charger.c:346:12: warning: Identical inner 'if' condition is always true. [identicalInnerCondition]
      if (val < array[i])
              ^
   drivers/power/supply/bq256xx_charger.c:345:33: note: outer condition: val<array[i]
     if (val > array[i - 1] && val < array[i]) {
                                   ^
   drivers/power/supply/bq256xx_charger.c:346:12: note: identical inner condition: val<array[i]
      if (val < array[i])
              ^

vim +/if +346 drivers/power/supply/bq256xx_charger.c

32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  330  
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  331  static int bq256xx_array_parse(int array_size, int val, const int array[])
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  332  {
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  333  	int i = 0;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  334  
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  335  	if (val < array[i])
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  336  		return i - 1;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  337  
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  338  	if (val >= array[array_size - 1])
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  339  		return array_size - 1;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  340  
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  341  	for (i = 1; i < array_size; i++) {
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  342  		if (val == array[i])
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  343  			return i;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  344  
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  345  		if (val > array[i - 1] && val < array[i]) {
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06 @346  			if (val < array[i])
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  347  				return i - 1;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  348  			else
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  349  				return i;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  350  		}
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  351  	}
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  352  	return -EINVAL;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  353  }
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  354  

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* drivers/power/supply/bq256xx_charger.c:346:12: warning: Identical inner 'if' condition is always true. [identicalInnerCondition]
@ 2021-04-21  1:59 ` kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-04-21  1:59 UTC (permalink / raw)
  To: Ricardo Rivera-Matos; +Cc: kbuild-all, linux-kernel, Sebastian Reichel

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7af08140979a6e7e12b78c93b8625c8d25b084e2
commit: 32e4978bb920d047fe5de3ea42d176f267c01f63 power: supply: bq256xx: Introduce the BQ256XX charger driver
date:   3 months ago
compiler: mips64-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> drivers/power/supply/bq256xx_charger.c:346:12: warning: Identical inner 'if' condition is always true. [identicalInnerCondition]
      if (val < array[i])
              ^
   drivers/power/supply/bq256xx_charger.c:345:33: note: outer condition: val<array[i]
     if (val > array[i - 1] && val < array[i]) {
                                   ^
   drivers/power/supply/bq256xx_charger.c:346:12: note: identical inner condition: val<array[i]
      if (val < array[i])
              ^

vim +/if +346 drivers/power/supply/bq256xx_charger.c

32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  330  
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  331  static int bq256xx_array_parse(int array_size, int val, const int array[])
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  332  {
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  333  	int i = 0;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  334  
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  335  	if (val < array[i])
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  336  		return i - 1;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  337  
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  338  	if (val >= array[array_size - 1])
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  339  		return array_size - 1;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  340  
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  341  	for (i = 1; i < array_size; i++) {
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  342  		if (val == array[i])
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  343  			return i;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  344  
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  345  		if (val > array[i - 1] && val < array[i]) {
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06 @346  			if (val < array[i])
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  347  				return i - 1;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  348  			else
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  349  				return i;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  350  		}
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  351  	}
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  352  	return -EINVAL;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  353  }
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  354  

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* drivers/power/supply/bq256xx_charger.c:346:12: warning: Identical inner 'if' condition is always true. [identicalInnerCondition]
@ 2021-04-21  1:59 ` kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-04-21  1:59 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7af08140979a6e7e12b78c93b8625c8d25b084e2
commit: 32e4978bb920d047fe5de3ea42d176f267c01f63 power: supply: bq256xx: Introduce the BQ256XX charger driver
date:   3 months ago
compiler: mips64-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> drivers/power/supply/bq256xx_charger.c:346:12: warning: Identical inner 'if' condition is always true. [identicalInnerCondition]
      if (val < array[i])
              ^
   drivers/power/supply/bq256xx_charger.c:345:33: note: outer condition: val<array[i]
     if (val > array[i - 1] && val < array[i]) {
                                   ^
   drivers/power/supply/bq256xx_charger.c:346:12: note: identical inner condition: val<array[i]
      if (val < array[i])
              ^

vim +/if +346 drivers/power/supply/bq256xx_charger.c

32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  330  
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  331  static int bq256xx_array_parse(int array_size, int val, const int array[])
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  332  {
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  333  	int i = 0;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  334  
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  335  	if (val < array[i])
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  336  		return i - 1;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  337  
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  338  	if (val >= array[array_size - 1])
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  339  		return array_size - 1;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  340  
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  341  	for (i = 1; i < array_size; i++) {
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  342  		if (val == array[i])
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  343  			return i;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  344  
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  345  		if (val > array[i - 1] && val < array[i]) {
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06 @346  			if (val < array[i])
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  347  				return i - 1;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  348  			else
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  349  				return i;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  350  		}
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  351  	}
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  352  	return -EINVAL;
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  353  }
32e4978bb920d0 Ricardo Rivera-Matos 2021-01-06  354  

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-21  2:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20 18:57 drivers/power/supply/bq256xx_charger.c:346:12: warning: Identical inner 'if' condition is always true. [identicalInnerCondition] kernel test robot
2021-04-21  1:59 kernel test robot
2021-04-21  1:59 ` 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.