All of lore.kernel.org
 help / color / mirror / Atom feed
* [dlech-linux:bone-counter 1/12] drivers/counter/microchip-tcb-capture.c:173 mchp_tc_count_action_read() warn: bitwise AND condition is false here
@ 2020-10-14 11:52 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-10-14 11:52 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: William Breathitt Gray <vilhelm.gray@gmail.com>
CC: David Lechner <david@lechnology.com>

tree:   https://github.com/dlech/linux bone-counter
head:   f8f0ad10f30b5c1bea1a22f5de5dc9f2c6b7db1a
commit: 5251e7147d627fbe13308dc390347dc16efeb85b [1/12] counter: Internalize sysfs interface code
:::::: branch date: 10 hours ago
:::::: commit date: 2 days ago
config: x86_64-randconfig-m001-20201014 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

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

New smatch warnings:
drivers/counter/microchip-tcb-capture.c:173 mchp_tc_count_action_read() warn: bitwise AND condition is false here
drivers/counter/counter-sysfs.c:109 counter_comp_u8_show() error: uninitialized symbol 'err'.
drivers/counter/counter-sysfs.c:114 counter_comp_u8_show() error: uninitialized symbol 'data'.
drivers/counter/counter-sysfs.c:233 counter_comp_u64_show() error: uninitialized symbol 'err'.
drivers/counter/counter-sysfs.c:236 counter_comp_u64_show() error: uninitialized symbol 'data'.

Old smatch warnings:
drivers/counter/counter-sysfs.c:116 counter_comp_u8_show() error: uninitialized symbol 'data'.
drivers/counter/counter-sysfs.c:118 counter_comp_u8_show() error: uninitialized symbol 'data'.
drivers/counter/counter-sysfs.c:120 counter_comp_u8_show() error: uninitialized symbol 'data'.
drivers/counter/counter-sysfs.c:122 counter_comp_u8_show() error: uninitialized symbol 'data'.
drivers/counter/counter-sysfs.c:124 counter_comp_u8_show() error: uninitialized symbol 'data'.
drivers/counter/counter-sysfs.c:126 counter_comp_u8_show() error: uninitialized symbol 'data'.
drivers/counter/counter-sysfs.c:131 counter_comp_u8_show() error: uninitialized symbol 'data'.

vim +173 drivers/counter/microchip-tcb-capture.c

106b104137fd5f0 Kamel Bouhara          2020-07-06  160  
5251e7147d627fb William Breathitt Gray 2020-09-26  161  static int mchp_tc_count_action_read(struct counter_device *counter,
106b104137fd5f0 Kamel Bouhara          2020-07-06  162  				     struct counter_count *count,
106b104137fd5f0 Kamel Bouhara          2020-07-06  163  				     struct counter_synapse *synapse,
5251e7147d627fb William Breathitt Gray 2020-09-26  164  				     u8 *action)
106b104137fd5f0 Kamel Bouhara          2020-07-06  165  {
106b104137fd5f0 Kamel Bouhara          2020-07-06  166  	struct mchp_tc_data *const priv = counter->priv;
106b104137fd5f0 Kamel Bouhara          2020-07-06  167  	u32 cmr;
106b104137fd5f0 Kamel Bouhara          2020-07-06  168  
106b104137fd5f0 Kamel Bouhara          2020-07-06  169  	regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CMR), &cmr);
106b104137fd5f0 Kamel Bouhara          2020-07-06  170  
5251e7147d627fb William Breathitt Gray 2020-09-26  171  	*action = COUNTER_SYNAPSE_ACTION_NONE;
106b104137fd5f0 Kamel Bouhara          2020-07-06  172  
106b104137fd5f0 Kamel Bouhara          2020-07-06 @173  	if (cmr & ATMEL_TC_ETRGEDG_NONE)
5251e7147d627fb William Breathitt Gray 2020-09-26  174  		*action = COUNTER_SYNAPSE_ACTION_NONE;
106b104137fd5f0 Kamel Bouhara          2020-07-06  175  	else if (cmr & ATMEL_TC_ETRGEDG_RISING)
5251e7147d627fb William Breathitt Gray 2020-09-26  176  		*action = COUNTER_SYNAPSE_ACTION_RISING_EDGE;
106b104137fd5f0 Kamel Bouhara          2020-07-06  177  	else if (cmr & ATMEL_TC_ETRGEDG_FALLING)
5251e7147d627fb William Breathitt Gray 2020-09-26  178  		*action = COUNTER_SYNAPSE_ACTION_FALLING_EDGE;
106b104137fd5f0 Kamel Bouhara          2020-07-06  179  	else if (cmr & ATMEL_TC_ETRGEDG_BOTH)
5251e7147d627fb William Breathitt Gray 2020-09-26  180  		*action = COUNTER_SYNAPSE_ACTION_BOTH_EDGES;
106b104137fd5f0 Kamel Bouhara          2020-07-06  181  
106b104137fd5f0 Kamel Bouhara          2020-07-06  182  	return 0;
106b104137fd5f0 Kamel Bouhara          2020-07-06  183  }
106b104137fd5f0 Kamel Bouhara          2020-07-06  184  

:::::: The code at line 173 was first introduced by commit
:::::: 106b104137fd5f0dbcafadd7ad566b86ec183466 counter: Add microchip TCB capture counter

:::::: TO: Kamel Bouhara <kamel.bouhara@bootlin.com>
:::::: CC: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

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

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

* [dlech-linux:bone-counter 1/12] drivers/counter/microchip-tcb-capture.c:173 mchp_tc_count_action_read() warn: bitwise AND condition is false here
@ 2020-10-14 14:40 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2020-10-14 14:40 UTC (permalink / raw)
  To: kbuild

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

tree:   https://github.com/dlech/linux  bone-counter
head:   f8f0ad10f30b5c1bea1a22f5de5dc9f2c6b7db1a
commit: 5251e7147d627fbe13308dc390347dc16efeb85b [1/12] counter: Internalize sysfs interface code
config: x86_64-randconfig-m001-20201014 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

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

New smatch warnings:
drivers/counter/microchip-tcb-capture.c:173 mchp_tc_count_action_read() warn: bitwise AND condition is false here
drivers/counter/counter-sysfs.c:109 counter_comp_u8_show() error: uninitialized symbol 'err'.
drivers/counter/counter-sysfs.c:114 counter_comp_u8_show() error: uninitialized symbol 'data'.
drivers/counter/counter-sysfs.c:233 counter_comp_u64_show() error: uninitialized symbol 'err'.
drivers/counter/counter-sysfs.c:236 counter_comp_u64_show() error: uninitialized symbol 'data'.

Old smatch warnings:
drivers/counter/counter-sysfs.c:116 counter_comp_u8_show() error: uninitialized symbol 'data'.
drivers/counter/counter-sysfs.c:118 counter_comp_u8_show() error: uninitialized symbol 'data'.
drivers/counter/counter-sysfs.c:120 counter_comp_u8_show() error: uninitialized symbol 'data'.
drivers/counter/counter-sysfs.c:122 counter_comp_u8_show() error: uninitialized symbol 'data'.
drivers/counter/counter-sysfs.c:124 counter_comp_u8_show() error: uninitialized symbol 'data'.
drivers/counter/counter-sysfs.c:126 counter_comp_u8_show() error: uninitialized symbol 'data'.
drivers/counter/counter-sysfs.c:131 counter_comp_u8_show() error: uninitialized symbol 'data'.

vim +173 drivers/counter/microchip-tcb-capture.c

5251e7147d627fb William Breathitt Gray 2020-09-26  161  static int mchp_tc_count_action_read(struct counter_device *counter,
106b104137fd5f0 Kamel Bouhara          2020-07-06  162  				     struct counter_count *count,
106b104137fd5f0 Kamel Bouhara          2020-07-06  163  				     struct counter_synapse *synapse,
5251e7147d627fb William Breathitt Gray 2020-09-26  164  				     u8 *action)
106b104137fd5f0 Kamel Bouhara          2020-07-06  165  {
106b104137fd5f0 Kamel Bouhara          2020-07-06  166  	struct mchp_tc_data *const priv = counter->priv;
106b104137fd5f0 Kamel Bouhara          2020-07-06  167  	u32 cmr;
106b104137fd5f0 Kamel Bouhara          2020-07-06  168  
106b104137fd5f0 Kamel Bouhara          2020-07-06  169  	regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CMR), &cmr);
106b104137fd5f0 Kamel Bouhara          2020-07-06  170  
5251e7147d627fb William Breathitt Gray 2020-09-26  171  	*action = COUNTER_SYNAPSE_ACTION_NONE;
106b104137fd5f0 Kamel Bouhara          2020-07-06  172  
106b104137fd5f0 Kamel Bouhara          2020-07-06 @173  	if (cmr & ATMEL_TC_ETRGEDG_NONE)
                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
I'm guessing ATMEL_TC_ETRGEDG_NONE is zero and that's why Smatch thinks
this can't possibly be true.

5251e7147d627fb William Breathitt Gray 2020-09-26  174  		*action = COUNTER_SYNAPSE_ACTION_NONE;
106b104137fd5f0 Kamel Bouhara          2020-07-06  175  	else if (cmr & ATMEL_TC_ETRGEDG_RISING)
5251e7147d627fb William Breathitt Gray 2020-09-26  176  		*action = COUNTER_SYNAPSE_ACTION_RISING_EDGE;
106b104137fd5f0 Kamel Bouhara          2020-07-06  177  	else if (cmr & ATMEL_TC_ETRGEDG_FALLING)
5251e7147d627fb William Breathitt Gray 2020-09-26  178  		*action = COUNTER_SYNAPSE_ACTION_FALLING_EDGE;
106b104137fd5f0 Kamel Bouhara          2020-07-06  179  	else if (cmr & ATMEL_TC_ETRGEDG_BOTH)
5251e7147d627fb William Breathitt Gray 2020-09-26  180  		*action = COUNTER_SYNAPSE_ACTION_BOTH_EDGES;
106b104137fd5f0 Kamel Bouhara          2020-07-06  181  
106b104137fd5f0 Kamel Bouhara          2020-07-06  182  	return 0;
106b104137fd5f0 Kamel Bouhara          2020-07-06  183  }

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

_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org

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

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

end of thread, other threads:[~2020-10-14 14:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-14 11:52 [dlech-linux:bone-counter 1/12] drivers/counter/microchip-tcb-capture.c:173 mchp_tc_count_action_read() warn: bitwise AND condition is false here kernel test robot
2020-10-14 14:40 Dan Carpenter

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.