All of lore.kernel.org
 help / color / mirror / Atom feed
* [iio:fixes-togreg 19/19] drivers/iio/adc/mcp3422.c:155 mcp3422_read_channel() warn: inconsistent returns 'adc->lock'.
@ 2020-08-29 18:15 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2020-08-29 18:15 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Angelo Compagnucci <angelo.compagnucci@gmail.com>
CC: Jonathan Cameron <Jonathan.Cameron@huawei.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git fixes-togreg
head:   ba255800f7fbb8da411c92c33b25d52970558509
commit: ba255800f7fbb8da411c92c33b25d52970558509 [19/19] iio: adc: mcp3422: fix locking scope
:::::: branch date: 54 minutes ago
:::::: commit date: 54 minutes ago
config: x86_64-randconfig-m001-20200830 (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>

smatch warnings:
drivers/iio/adc/mcp3422.c:155 mcp3422_read_channel() warn: inconsistent returns 'adc->lock'.

# https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?id=ba255800f7fbb8da411c92c33b25d52970558509
git remote add iio https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
git fetch --no-tags iio fixes-togreg
git checkout ba255800f7fbb8da411c92c33b25d52970558509
vim +155 drivers/iio/adc/mcp3422.c

07914c84ba30e3 Angelo Compagnucci 2013-09-02  129  
07914c84ba30e3 Angelo Compagnucci 2013-09-02  130  static int mcp3422_read_channel(struct mcp3422 *adc,
07914c84ba30e3 Angelo Compagnucci 2013-09-02  131  				struct iio_chan_spec const *channel, int *value)
07914c84ba30e3 Angelo Compagnucci 2013-09-02  132  {
07914c84ba30e3 Angelo Compagnucci 2013-09-02  133  	int ret;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  134  	u8 config;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  135  	u8 req_channel = channel->channel;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  136  
ba255800f7fbb8 Angelo Compagnucci 2020-08-19  137  	mutex_lock(&adc->lock);
ba255800f7fbb8 Angelo Compagnucci 2020-08-19  138  
07914c84ba30e3 Angelo Compagnucci 2013-09-02  139  	if (req_channel != MCP3422_CHANNEL(adc->config)) {
07914c84ba30e3 Angelo Compagnucci 2013-09-02  140  		config = adc->config;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  141  		config &= ~MCP3422_CHANNEL_MASK;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  142  		config |= MCP3422_CHANNEL_VALUE(req_channel);
07914c84ba30e3 Angelo Compagnucci 2013-09-02  143  		config &= ~MCP3422_PGA_MASK;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  144  		config |= MCP3422_PGA_VALUE(adc->pga[req_channel]);
07914c84ba30e3 Angelo Compagnucci 2013-09-02  145  		ret = mcp3422_update_config(adc, config);
07914c84ba30e3 Angelo Compagnucci 2013-09-02  146  		if (ret < 0)
07914c84ba30e3 Angelo Compagnucci 2013-09-02  147  			return ret;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  148  		msleep(mcp3422_read_times[MCP3422_SAMPLE_RATE(adc->config)]);
07914c84ba30e3 Angelo Compagnucci 2013-09-02  149  	}
07914c84ba30e3 Angelo Compagnucci 2013-09-02  150  
ba255800f7fbb8 Angelo Compagnucci 2020-08-19  151  	ret = mcp3422_read(adc, value, &config);
ba255800f7fbb8 Angelo Compagnucci 2020-08-19  152  
ba255800f7fbb8 Angelo Compagnucci 2020-08-19  153  	mutex_unlock(&adc->lock);
ba255800f7fbb8 Angelo Compagnucci 2020-08-19  154  
ba255800f7fbb8 Angelo Compagnucci 2020-08-19 @155  	return ret;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  156  }
07914c84ba30e3 Angelo Compagnucci 2013-09-02  157  

---
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: 36656 bytes --]

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

* [iio:fixes-togreg 19/19] drivers/iio/adc/mcp3422.c:155 mcp3422_read_channel() warn: inconsistent returns 'adc->lock'.
@ 2020-08-31 12:40 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2020-08-31 12:40 UTC (permalink / raw)
  To: kbuild

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git fixes-togreg
head:   ba255800f7fbb8da411c92c33b25d52970558509
commit: ba255800f7fbb8da411c92c33b25d52970558509 [19/19] iio: adc: mcp3422: fix locking scope
config: x86_64-randconfig-m001-20200830 (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>

smatch warnings:
drivers/iio/adc/mcp3422.c:155 mcp3422_read_channel() warn: inconsistent returns 'adc->lock'.

# https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?id=ba255800f7fbb8da411c92c33b25d52970558509
git remote add iio https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
git fetch --no-tags iio fixes-togreg
git checkout ba255800f7fbb8da411c92c33b25d52970558509
vim +155 drivers/iio/adc/mcp3422.c

07914c84ba30e3 Angelo Compagnucci 2013-09-02  130  static int mcp3422_read_channel(struct mcp3422 *adc,
07914c84ba30e3 Angelo Compagnucci 2013-09-02  131  				struct iio_chan_spec const *channel, int *value)
07914c84ba30e3 Angelo Compagnucci 2013-09-02  132  {
07914c84ba30e3 Angelo Compagnucci 2013-09-02  133  	int ret;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  134  	u8 config;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  135  	u8 req_channel = channel->channel;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  136  
ba255800f7fbb8 Angelo Compagnucci 2020-08-19  137  	mutex_lock(&adc->lock);
                                                        ^^^^^^^^^^^^^^^^^^^^^^
Lock

ba255800f7fbb8 Angelo Compagnucci 2020-08-19  138  
07914c84ba30e3 Angelo Compagnucci 2013-09-02  139  	if (req_channel != MCP3422_CHANNEL(adc->config)) {
07914c84ba30e3 Angelo Compagnucci 2013-09-02  140  		config = adc->config;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  141  		config &= ~MCP3422_CHANNEL_MASK;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  142  		config |= MCP3422_CHANNEL_VALUE(req_channel);
07914c84ba30e3 Angelo Compagnucci 2013-09-02  143  		config &= ~MCP3422_PGA_MASK;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  144  		config |= MCP3422_PGA_VALUE(adc->pga[req_channel]);
07914c84ba30e3 Angelo Compagnucci 2013-09-02  145  		ret = mcp3422_update_config(adc, config);
07914c84ba30e3 Angelo Compagnucci 2013-09-02  146  		if (ret < 0)
07914c84ba30e3 Angelo Compagnucci 2013-09-02  147  			return ret;
                                                                        ^^^^^^^^^^
goto unlock

07914c84ba30e3 Angelo Compagnucci 2013-09-02  148  		msleep(mcp3422_read_times[MCP3422_SAMPLE_RATE(adc->config)]);
07914c84ba30e3 Angelo Compagnucci 2013-09-02  149  	}
07914c84ba30e3 Angelo Compagnucci 2013-09-02  150  
ba255800f7fbb8 Angelo Compagnucci 2020-08-19  151  	ret = mcp3422_read(adc, value, &config);
ba255800f7fbb8 Angelo Compagnucci 2020-08-19  152  
ba255800f7fbb8 Angelo Compagnucci 2020-08-19  153  	mutex_unlock(&adc->lock);
ba255800f7fbb8 Angelo Compagnucci 2020-08-19  154  
ba255800f7fbb8 Angelo Compagnucci 2020-08-19 @155  	return ret;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  156  }

---
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: 36656 bytes --]

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

* [iio:fixes-togreg 19/19] drivers/iio/adc/mcp3422.c:155 mcp3422_read_channel() warn: inconsistent returns 'adc->lock'.
@ 2020-08-31 12:40 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2020-08-31 12:40 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git fixes-togreg
head:   ba255800f7fbb8da411c92c33b25d52970558509
commit: ba255800f7fbb8da411c92c33b25d52970558509 [19/19] iio: adc: mcp3422: fix locking scope
config: x86_64-randconfig-m001-20200830 (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>

smatch warnings:
drivers/iio/adc/mcp3422.c:155 mcp3422_read_channel() warn: inconsistent returns 'adc->lock'.

# https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?id=ba255800f7fbb8da411c92c33b25d52970558509
git remote add iio https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
git fetch --no-tags iio fixes-togreg
git checkout ba255800f7fbb8da411c92c33b25d52970558509
vim +155 drivers/iio/adc/mcp3422.c

07914c84ba30e3 Angelo Compagnucci 2013-09-02  130  static int mcp3422_read_channel(struct mcp3422 *adc,
07914c84ba30e3 Angelo Compagnucci 2013-09-02  131  				struct iio_chan_spec const *channel, int *value)
07914c84ba30e3 Angelo Compagnucci 2013-09-02  132  {
07914c84ba30e3 Angelo Compagnucci 2013-09-02  133  	int ret;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  134  	u8 config;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  135  	u8 req_channel = channel->channel;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  136  
ba255800f7fbb8 Angelo Compagnucci 2020-08-19  137  	mutex_lock(&adc->lock);
                                                        ^^^^^^^^^^^^^^^^^^^^^^
Lock

ba255800f7fbb8 Angelo Compagnucci 2020-08-19  138  
07914c84ba30e3 Angelo Compagnucci 2013-09-02  139  	if (req_channel != MCP3422_CHANNEL(adc->config)) {
07914c84ba30e3 Angelo Compagnucci 2013-09-02  140  		config = adc->config;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  141  		config &= ~MCP3422_CHANNEL_MASK;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  142  		config |= MCP3422_CHANNEL_VALUE(req_channel);
07914c84ba30e3 Angelo Compagnucci 2013-09-02  143  		config &= ~MCP3422_PGA_MASK;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  144  		config |= MCP3422_PGA_VALUE(adc->pga[req_channel]);
07914c84ba30e3 Angelo Compagnucci 2013-09-02  145  		ret = mcp3422_update_config(adc, config);
07914c84ba30e3 Angelo Compagnucci 2013-09-02  146  		if (ret < 0)
07914c84ba30e3 Angelo Compagnucci 2013-09-02  147  			return ret;
                                                                        ^^^^^^^^^^
goto unlock

07914c84ba30e3 Angelo Compagnucci 2013-09-02  148  		msleep(mcp3422_read_times[MCP3422_SAMPLE_RATE(adc->config)]);
07914c84ba30e3 Angelo Compagnucci 2013-09-02  149  	}
07914c84ba30e3 Angelo Compagnucci 2013-09-02  150  
ba255800f7fbb8 Angelo Compagnucci 2020-08-19  151  	ret = mcp3422_read(adc, value, &config);
ba255800f7fbb8 Angelo Compagnucci 2020-08-19  152  
ba255800f7fbb8 Angelo Compagnucci 2020-08-19  153  	mutex_unlock(&adc->lock);
ba255800f7fbb8 Angelo Compagnucci 2020-08-19  154  
ba255800f7fbb8 Angelo Compagnucci 2020-08-19 @155  	return ret;
07914c84ba30e3 Angelo Compagnucci 2013-09-02  156  }

---
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: 36656 bytes --]

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

end of thread, other threads:[~2020-08-31 12:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-29 18:15 [iio:fixes-togreg 19/19] drivers/iio/adc/mcp3422.c:155 mcp3422_read_channel() warn: inconsistent returns 'adc->lock' kernel test robot
2020-08-31 12:40 Dan Carpenter
2020-08-31 12: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.