All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: kernel test robot <lkp@intel.com>
Cc: Anand Ashok Dumbre <anand.ashok.dumbre@xilinx.com>,
	linux-kernel@vger.kernel.org, lars@metafoo.de,
	linux-iio@vger.kernel.org, git@xilinx.com,
	michal.simek@xilinx.com, gregkh@linuxfoundation.org,
	rafael@kernel.org, linux-acpi@vger.kernel.org,
	andriy.shevchenko@linux.intel.com, kbuild-all@lists.01.org
Subject: Re: [PATCH v11 3/5] iio: adc: Add Xilinx AMS driver
Date: Sat, 27 Nov 2021 17:50:31 +0000	[thread overview]
Message-ID: <20211127175031.6471b43b@jic23-huawei> (raw)
In-Reply-To: <202111271041.Cdu0In2E-lkp@intel.com>

On Sat, 27 Nov 2021 10:43:11 +0800
kernel test robot <lkp@intel.com> wrote:

> Hi Anand,
> 
> Thank you for the patch! Perhaps something to improve:
> 
> [auto build test WARNING on jic23-iio/togreg]
> [also build test WARNING on linux/master linus/master v5.16-rc2 next-20211126]
> [cannot apply to xilinx-xlnx/master]
> [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]
> 
> url:    https://github.com/0day-ci/linux/commits/Anand-Ashok-Dumbre/Add-Xilinx-AMS-Driver/20211125-065614
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
> config: powerpc64-randconfig-s032-20211126 (https://download.01.org/0day-ci/archive/20211127/202111271041.Cdu0In2E-lkp@intel.com/config)
> compiler: powerpc64-linux-gcc (GCC) 11.2.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # apt-get install sparse
>         # sparse version: v0.6.4-dirty
>         # https://github.com/0day-ci/linux/commit/9b07fe52c07c2e9f6eccd2f2050f69558904ed64
>         git remote add linux-review https://github.com/0day-ci/linux
>         git fetch --no-tags linux-review Anand-Ashok-Dumbre/Add-Xilinx-AMS-Driver/20211125-065614
>         git checkout 9b07fe52c07c2e9f6eccd2f2050f69558904ed64
>         # save the config file to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=powerpc SHELL=/bin/bash drivers/clk/ drivers/iio/adc/ drivers/pci/controller/
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> 
> sparse warnings: (new ones prefixed by >>)
> >> drivers/iio/adc/xilinx-ams.c:1175:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void *data @@  
>    drivers/iio/adc/xilinx-ams.c:1175:17: sparse:     expected void volatile [noderef] __iomem *addr
>    drivers/iio/adc/xilinx-ams.c:1175:17: sparse:     got void *data
> >> drivers/iio/adc/xilinx-ams.c:1192:69: sparse: sparse: incorrect type in argument 3 (different address spaces) @@     expected void *data @@     got void [noderef] __iomem *ps_base @@  
>    drivers/iio/adc/xilinx-ams.c:1192:69: sparse:     expected void *data
>    drivers/iio/adc/xilinx-ams.c:1192:69: sparse:     got void [noderef] __iomem *ps_base
> >> drivers/iio/adc/xilinx-ams.c:1206:69: sparse: sparse: incorrect type in argument 3 (different address spaces) @@     expected void *data @@     got void [noderef] __iomem *pl_base @@  
>    drivers/iio/adc/xilinx-ams.c:1206:69: sparse:     expected void *data
>    drivers/iio/adc/xilinx-ams.c:1206:69: sparse:     got void [noderef] __iomem *pl_base
> 
> vim +1175 drivers/iio/adc/xilinx-ams.c
> 
>   1172	
>   1173	static void ams_iounmap(void *data)
>   1174	{
> > 1175		iounmap(data);  
I guess you probably already fixed this, but I'd do it by passing the
containing structure in as the *data and then use
ams->pl_base to access it here.

It's a bit more code than we'd normally need but cleaner than force
changes to and from iomem via forcing the pointer conversions.

>   1176	}
>   1177	
>   1178	static int ams_init_module(struct iio_dev *indio_dev,
>   1179				   struct fwnode_handle *fwnode,
>   1180				   struct iio_chan_spec *channels)
>   1181	{
>   1182		struct device *dev = indio_dev->dev.parent;
>   1183		struct ams *ams = iio_priv(indio_dev);
>   1184		int num_channels = 0;
>   1185		int ret;
>   1186	
>   1187		if (fwnode_property_match_string(fwnode, "compatible",
>   1188						 "xlnx,zynqmp-ams-ps") == 0) {
>   1189			ams->ps_base = fwnode_iomap(fwnode, 0);
>   1190			if (!ams->ps_base)
>   1191				return -ENXIO;
> > 1192			ret = devm_add_action_or_reset(dev, ams_iounmap, ams->ps_base);  
>   1193			if (ret < 0)
>   1194				return ret;
>   1195	
>   1196			/* add PS channels to iio device channels */
>   1197			memcpy(channels, ams_ps_channels,
>   1198			       sizeof(ams_ps_channels));
>   1199			num_channels += ARRAY_SIZE(ams_ps_channels);
>   1200		} else if (fwnode_property_match_string(fwnode, "compatible",
>   1201							"xlnx,zynqmp-ams-pl") == 0) {
>   1202			ams->pl_base = fwnode_iomap(fwnode, 0);
>   1203			if (!ams->pl_base)
>   1204				return -ENXIO;
>   1205	
> > 1206			ret = devm_add_action_or_reset(dev, ams_iounmap, ams->pl_base);  
>   1207			if (ret < 0)
>   1208				return ret;
>   1209	
>   1210			/* Copy only first 10 fix channels */
>   1211			memcpy(channels, ams_pl_channels,
>   1212			       AMS_PL_MAX_FIXED_CHANNEL * sizeof(*channels));
>   1213			num_channels += AMS_PL_MAX_FIXED_CHANNEL;
>   1214	
>   1215			num_channels = ams_get_ext_chan(fwnode, channels,
>   1216							num_channels);
>   1217		} else if (fwnode_property_match_string(fwnode, "compatible",
>   1218							"xlnx,zynqmp-ams") == 0) {
>   1219			/* add AMS channels to iio device channels */
>   1220			memcpy(channels, ams_ctrl_channels,
>   1221			       sizeof(ams_ctrl_channels));
>   1222			num_channels += ARRAY_SIZE(ams_ctrl_channels);
>   1223		} else {
>   1224			return -EINVAL;
>   1225		}
>   1226	
>   1227		return num_channels;
>   1228	}
>   1229	
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23@kernel.org>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v11 3/5] iio: adc: Add Xilinx AMS driver
Date: Sat, 27 Nov 2021 17:50:31 +0000	[thread overview]
Message-ID: <20211127175031.6471b43b@jic23-huawei> (raw)
In-Reply-To: <202111271041.Cdu0In2E-lkp@intel.com>

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

On Sat, 27 Nov 2021 10:43:11 +0800
kernel test robot <lkp@intel.com> wrote:

> Hi Anand,
> 
> Thank you for the patch! Perhaps something to improve:
> 
> [auto build test WARNING on jic23-iio/togreg]
> [also build test WARNING on linux/master linus/master v5.16-rc2 next-20211126]
> [cannot apply to xilinx-xlnx/master]
> [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]
> 
> url:    https://github.com/0day-ci/linux/commits/Anand-Ashok-Dumbre/Add-Xilinx-AMS-Driver/20211125-065614
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
> config: powerpc64-randconfig-s032-20211126 (https://download.01.org/0day-ci/archive/20211127/202111271041.Cdu0In2E-lkp(a)intel.com/config)
> compiler: powerpc64-linux-gcc (GCC) 11.2.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # apt-get install sparse
>         # sparse version: v0.6.4-dirty
>         # https://github.com/0day-ci/linux/commit/9b07fe52c07c2e9f6eccd2f2050f69558904ed64
>         git remote add linux-review https://github.com/0day-ci/linux
>         git fetch --no-tags linux-review Anand-Ashok-Dumbre/Add-Xilinx-AMS-Driver/20211125-065614
>         git checkout 9b07fe52c07c2e9f6eccd2f2050f69558904ed64
>         # save the config file to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=powerpc SHELL=/bin/bash drivers/clk/ drivers/iio/adc/ drivers/pci/controller/
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> 
> sparse warnings: (new ones prefixed by >>)
> >> drivers/iio/adc/xilinx-ams.c:1175:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void *data @@  
>    drivers/iio/adc/xilinx-ams.c:1175:17: sparse:     expected void volatile [noderef] __iomem *addr
>    drivers/iio/adc/xilinx-ams.c:1175:17: sparse:     got void *data
> >> drivers/iio/adc/xilinx-ams.c:1192:69: sparse: sparse: incorrect type in argument 3 (different address spaces) @@     expected void *data @@     got void [noderef] __iomem *ps_base @@  
>    drivers/iio/adc/xilinx-ams.c:1192:69: sparse:     expected void *data
>    drivers/iio/adc/xilinx-ams.c:1192:69: sparse:     got void [noderef] __iomem *ps_base
> >> drivers/iio/adc/xilinx-ams.c:1206:69: sparse: sparse: incorrect type in argument 3 (different address spaces) @@     expected void *data @@     got void [noderef] __iomem *pl_base @@  
>    drivers/iio/adc/xilinx-ams.c:1206:69: sparse:     expected void *data
>    drivers/iio/adc/xilinx-ams.c:1206:69: sparse:     got void [noderef] __iomem *pl_base
> 
> vim +1175 drivers/iio/adc/xilinx-ams.c
> 
>   1172	
>   1173	static void ams_iounmap(void *data)
>   1174	{
> > 1175		iounmap(data);  
I guess you probably already fixed this, but I'd do it by passing the
containing structure in as the *data and then use
ams->pl_base to access it here.

It's a bit more code than we'd normally need but cleaner than force
changes to and from iomem via forcing the pointer conversions.

>   1176	}
>   1177	
>   1178	static int ams_init_module(struct iio_dev *indio_dev,
>   1179				   struct fwnode_handle *fwnode,
>   1180				   struct iio_chan_spec *channels)
>   1181	{
>   1182		struct device *dev = indio_dev->dev.parent;
>   1183		struct ams *ams = iio_priv(indio_dev);
>   1184		int num_channels = 0;
>   1185		int ret;
>   1186	
>   1187		if (fwnode_property_match_string(fwnode, "compatible",
>   1188						 "xlnx,zynqmp-ams-ps") == 0) {
>   1189			ams->ps_base = fwnode_iomap(fwnode, 0);
>   1190			if (!ams->ps_base)
>   1191				return -ENXIO;
> > 1192			ret = devm_add_action_or_reset(dev, ams_iounmap, ams->ps_base);  
>   1193			if (ret < 0)
>   1194				return ret;
>   1195	
>   1196			/* add PS channels to iio device channels */
>   1197			memcpy(channels, ams_ps_channels,
>   1198			       sizeof(ams_ps_channels));
>   1199			num_channels += ARRAY_SIZE(ams_ps_channels);
>   1200		} else if (fwnode_property_match_string(fwnode, "compatible",
>   1201							"xlnx,zynqmp-ams-pl") == 0) {
>   1202			ams->pl_base = fwnode_iomap(fwnode, 0);
>   1203			if (!ams->pl_base)
>   1204				return -ENXIO;
>   1205	
> > 1206			ret = devm_add_action_or_reset(dev, ams_iounmap, ams->pl_base);  
>   1207			if (ret < 0)
>   1208				return ret;
>   1209	
>   1210			/* Copy only first 10 fix channels */
>   1211			memcpy(channels, ams_pl_channels,
>   1212			       AMS_PL_MAX_FIXED_CHANNEL * sizeof(*channels));
>   1213			num_channels += AMS_PL_MAX_FIXED_CHANNEL;
>   1214	
>   1215			num_channels = ams_get_ext_chan(fwnode, channels,
>   1216							num_channels);
>   1217		} else if (fwnode_property_match_string(fwnode, "compatible",
>   1218							"xlnx,zynqmp-ams") == 0) {
>   1219			/* add AMS channels to iio device channels */
>   1220			memcpy(channels, ams_ctrl_channels,
>   1221			       sizeof(ams_ctrl_channels));
>   1222			num_channels += ARRAY_SIZE(ams_ctrl_channels);
>   1223		} else {
>   1224			return -EINVAL;
>   1225		}
>   1226	
>   1227		return num_channels;
>   1228	}
>   1229	
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

  reply	other threads:[~2021-11-27 17:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24 22:54 [PATCH v11 0/5] Add Xilinx AMS Driver Anand Ashok Dumbre
2021-11-24 22:54 ` [PATCH v11 1/5] device property: Add fwnode_iomap() Anand Ashok Dumbre
2021-11-25 11:42   ` Andy Shevchenko
2021-11-30 21:58     ` Anand Ashok Dumbre
2021-12-02  9:10       ` Anand Ashok Dumbre
2021-12-02  9:37         ` Andy Shevchenko
2021-12-02 11:46           ` Anand Ashok Dumbre
2021-12-02 12:34             ` Anand Ashok Dumbre
2021-11-27 11:54   ` kernel test robot
2021-11-27 11:54     ` kernel test robot
2021-11-24 22:54 ` [PATCH v11 2/5] arm64: zynqmp: DT: Add Xilinx AMS node Anand Ashok Dumbre
2021-11-24 22:54 ` [PATCH v11 3/5] iio: adc: Add Xilinx AMS driver Anand Ashok Dumbre
2021-11-25 12:14   ` Andy Shevchenko
2021-12-02 16:32     ` Anand Ashok Dumbre
2021-12-02 16:51       ` Andy Shevchenko
2021-11-27  2:43   ` kernel test robot
2021-11-27  2:43     ` kernel test robot
2021-11-27 17:50     ` Jonathan Cameron [this message]
2021-11-27 17:50       ` Jonathan Cameron
2021-11-27  5:16   ` kernel test robot
2021-11-27  5:16     ` kernel test robot
2021-11-24 22:54 ` [PATCH v11 4/5] dt-bindings: iio: adc: Add Xilinx AMS binding documentation Anand Ashok Dumbre
2021-11-24 22:54 ` [PATCH v11 5/5] MAINTAINERS: Add maintainer for xilinx-ams Anand Ashok Dumbre

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=20211127175031.6471b43b@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=anand.ashok.dumbre@xilinx.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=git@xilinx.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=lars@metafoo.de \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=michal.simek@xilinx.com \
    --cc=rafael@kernel.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 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.