Re: [PATCH v6 2/4] iio: adc: Add Xilinx AMS driver

From: kernel test robot
Date: Fri Jun 25 2021 - 06:50:59 EST


Hi Anand,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on iio/togreg]
[also build test WARNING on linus/master v5.13-rc7 next-20210624]
[cannot apply to 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/20210625-023047
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: x86_64-randconfig-r015-20210625 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9ca0171a9ffdef5fdb1511d197a3fd72490362de)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/fa0ea7aaf7a9bff3781f19596b07fe33c6ef531d
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Anand-Ashok-Dumbre/Add-Xilinx-AMS-Driver/20210625-023047
git checkout fa0ea7aaf7a9bff3781f19596b07fe33c6ef531d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

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

All warnings (new ones prefixed by >>):

>> drivers/iio/adc/xilinx-ams.c:1126:35: warning: variable 'chan_node' is uninitialized when used here [-Wuninitialized]
num_channels = ams_get_ext_chan(chan_node, channels,
^~~~~~~~~
drivers/iio/adc/xilinx-ams.c:1104:31: note: initialize the variable 'chan_node' to silence this warning
struct device_node *chan_node;
^
= NULL
1 warning generated.


vim +/chan_node +1126 drivers/iio/adc/xilinx-ams.c

1099
1100 static int ams_init_module(struct iio_dev *indio_dev, struct device_node *np,
1101 struct iio_chan_spec *channels)
1102 {
1103 struct ams *ams = iio_priv(indio_dev);
1104 struct device_node *chan_node;
1105 int num_channels = 0;
1106
1107 if (of_device_is_compatible(np, "xlnx,zynqmp-ams-ps")) {
1108 ams->ps_base = of_iomap(np, 0);
1109 if (!ams->ps_base)
1110 return -ENXIO;
1111
1112 /* add PS channels to iio device channels */
1113 memcpy(channels + num_channels, ams_ps_channels,
1114 sizeof(ams_ps_channels));
1115 num_channels += ARRAY_SIZE(ams_ps_channels);
1116 } else if (of_device_is_compatible(np, "xlnx,zynqmp-ams-pl")) {
1117 ams->pl_base = of_iomap(np, 0);
1118 if (!ams->pl_base)
1119 return -ENXIO;
1120
1121 /* Copy only first 10 fix channels */
1122 memcpy(channels + num_channels, ams_pl_channels,
1123 AMS_PL_MAX_FIXED_CHANNEL * sizeof(*channels));
1124 num_channels += AMS_PL_MAX_FIXED_CHANNEL;
1125
> 1126 num_channels = ams_get_ext_chan(chan_node, channels,
1127 num_channels);
1128
1129 } else if (of_device_is_compatible(np, "xlnx,zynqmp-ams")) {
1130 /* add AMS channels to iio device channels */
1131 memcpy(channels + num_channels, ams_ctrl_channels,
1132 sizeof(ams_ctrl_channels));
1133 num_channels += ARRAY_SIZE(ams_ctrl_channels);
1134 } else {
1135 return -EINVAL;
1136 }
1137
1138 return num_channels;
1139 }
1140

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

Attachment: .config.gz
Description: application/gzip