devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Anshul Dalal <anshulusr@gmail.com>,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev, Anshul Dalal <anshulusr@gmail.com>,
	Conor Dooley <conor+dt@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	linux-kernel-mentees@lists.linuxfoundation.org,
	Jonathan Cameron <jic23@kernel.org>,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH 2/2] iio: dac: driver for MCP4821
Date: Sun, 19 Nov 2023 10:08:01 +0800	[thread overview]
Message-ID: <202311190944.LgtvolpG-lkp@intel.com> (raw)
In-Reply-To: <20231117073040.685860-2-anshulusr@gmail.com>

Hi Anshul,

kernel test robot noticed the following build warnings:

[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on robh/for-next linus/master v6.7-rc1 next-20231117]
[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/Anshul-Dalal/iio-dac-driver-for-MCP4821/20231117-153451
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link:    https://lore.kernel.org/r/20231117073040.685860-2-anshulusr%40gmail.com
patch subject: [PATCH 2/2] iio: dac: driver for MCP4821
config: i386-randconfig-061-20231119 (https://download.01.org/0day-ci/archive/20231119/202311190944.LgtvolpG-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231119/202311190944.LgtvolpG-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/202311190944.LgtvolpG-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/iio/dac/mcp4821.c:120:27: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __be16 [usertype] write_val @@     got unsigned long @@
   drivers/iio/dac/mcp4821.c:120:27: sparse:     expected restricted __be16 [usertype] write_val
   drivers/iio/dac/mcp4821.c:120:27: sparse:     got unsigned long
>> drivers/iio/dac/mcp4821.c:122:35: sparse: sparse: invalid assignment: |=
>> drivers/iio/dac/mcp4821.c:122:35: sparse:    left side has type restricted __be16
>> drivers/iio/dac/mcp4821.c:122:35: sparse:    right side has type unsigned long
>> drivers/iio/dac/mcp4821.c:123:36: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned short [usertype] val @@     got restricted __be16 [usertype] write_val @@
   drivers/iio/dac/mcp4821.c:123:36: sparse:     expected unsigned short [usertype] val
   drivers/iio/dac/mcp4821.c:123:36: sparse:     got restricted __be16 [usertype] write_val
   drivers/iio/dac/mcp4821.c: note: in included file (through include/linux/rculist.h, include/linux/pid.h, include/linux/sched.h, ...):
   include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true

vim +120 drivers/iio/dac/mcp4821.c

   106	
   107	static int mcp4821_write_raw(struct iio_dev *indio_dev,
   108				     struct iio_chan_spec const *chan, int val,
   109				     int val2, long mask)
   110	{
   111		struct mcp4821_state *state;
   112		__be16 write_val;
   113		u8 write_buffer[2];
   114		int ret;
   115		bool is_value_valid = val >= 0 && val < BIT(chan->scan_type.realbits) &&
   116				      val2 == 0;
   117		if (mask == IIO_CHAN_INFO_RAW && is_value_valid) {
   118			state = iio_priv(indio_dev);
   119	
 > 120			write_val = MCP4821_ACTIVE_MODE | val << chan->scan_type.shift;
   121			if (chan->channel)
 > 122				write_val |= MCP4802_SECOND_CHAN;
 > 123			put_unaligned_be16(write_val, write_buffer);
   124			ret = spi_write(state->spi, write_buffer, sizeof(write_buffer));
   125			if (ret) {
   126				dev_err(&state->spi->dev,
   127					"Failed to write to device: %d", ret);
   128				return ret;
   129			}
   130	
   131			mutex_lock(&state->lock);
   132			state->dac_value[chan->channel] = val;
   133			mutex_unlock(&state->lock);
   134			return 0;
   135		} else {
   136			return -EINVAL;
   137		}
   138	}
   139	

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

  reply	other threads:[~2023-11-19  2:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-17  7:30 [PATCH 1/2] dt-bindings: iio: dac: add MCP4821 Anshul Dalal
2023-11-17  7:30 ` [PATCH 2/2] iio: dac: driver for MCP4821 Anshul Dalal
2023-11-19  2:08   ` kernel test robot [this message]
2023-11-25 12:07   ` Jonathan Cameron
2023-11-19 13:47 ` [PATCH 1/2] dt-bindings: iio: dac: add MCP4821 Conor Dooley
2023-11-25 11:36 ` Jonathan Cameron

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=202311190944.LgtvolpG-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=anshulusr@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=krzk@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=robh+dt@kernel.org \
    --cc=skhan@linuxfoundation.org \
    /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 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).