From: kernel test robot <lkp@intel.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>,
Jonathan Cameron <jic23@kernel.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Michal Simek <monstr@monstr.eu>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Guenter Roeck <linux@roeck-us.net>
Cc: kbuild-all@lists.01.org, linux-iio@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFT] iio: adc: xilinx-xadc: use devm_krealloc()
Date: Fri, 3 Jul 2020 03:46:28 +0800 [thread overview]
Message-ID: <202007030347.YNi7QtlY%lkp@intel.com> (raw)
In-Reply-To: <20200702162509.11254-1-brgl@bgdev.pl>
[-- Attachment #1: Type: text/plain, Size: 5098 bytes --]
Hi Bartosz,
I love your patch! Yet something to improve:
[auto build test ERROR on iio/togreg]
[also build test ERROR on staging/staging-testing v5.8-rc3 next-20200702]
[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 as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Bartosz-Golaszewski/iio-adc-xilinx-xadc-use-devm_krealloc/20200703-002747
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: i386-randconfig-s002-20200702 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-3-gfa153962-dirty
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
drivers/iio/adc/xilinx-xadc-core.c: In function 'xadc_parse_dt':
>> drivers/iio/adc/xilinx-xadc-core.c:1179:24: error: implicit declaration of function 'devm_krealloc'; did you mean 'devm_kcalloc'? [-Werror=implicit-function-declaration]
1179 | indio_dev->channels = devm_krealloc(dev, channels,
| ^~~~~~~~~~~~~
| devm_kcalloc
>> drivers/iio/adc/xilinx-xadc-core.c:1179:22: warning: assignment to 'const struct iio_chan_spec *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1179 | indio_dev->channels = devm_krealloc(dev, channels,
| ^
cc1: some warnings being treated as errors
vim +1179 drivers/iio/adc/xilinx-xadc-core.c
1093
1094 static int xadc_parse_dt(struct iio_dev *indio_dev, struct device_node *np,
1095 unsigned int *conf)
1096 {
1097 struct device *dev = indio_dev->dev.parent;
1098 struct xadc *xadc = iio_priv(indio_dev);
1099 struct iio_chan_spec *channels, *chan;
1100 struct device_node *chan_node, *child;
1101 unsigned int num_channels;
1102 const char *external_mux;
1103 u32 ext_mux_chan;
1104 u32 reg;
1105 int ret;
1106
1107 *conf = 0;
1108
1109 ret = of_property_read_string(np, "xlnx,external-mux", &external_mux);
1110 if (ret < 0 || strcasecmp(external_mux, "none") == 0)
1111 xadc->external_mux_mode = XADC_EXTERNAL_MUX_NONE;
1112 else if (strcasecmp(external_mux, "single") == 0)
1113 xadc->external_mux_mode = XADC_EXTERNAL_MUX_SINGLE;
1114 else if (strcasecmp(external_mux, "dual") == 0)
1115 xadc->external_mux_mode = XADC_EXTERNAL_MUX_DUAL;
1116 else
1117 return -EINVAL;
1118
1119 if (xadc->external_mux_mode != XADC_EXTERNAL_MUX_NONE) {
1120 ret = of_property_read_u32(np, "xlnx,external-mux-channel",
1121 &ext_mux_chan);
1122 if (ret < 0)
1123 return ret;
1124
1125 if (xadc->external_mux_mode == XADC_EXTERNAL_MUX_SINGLE) {
1126 if (ext_mux_chan == 0)
1127 ext_mux_chan = XADC_REG_VPVN;
1128 else if (ext_mux_chan <= 16)
1129 ext_mux_chan = XADC_REG_VAUX(ext_mux_chan - 1);
1130 else
1131 return -EINVAL;
1132 } else {
1133 if (ext_mux_chan > 0 && ext_mux_chan <= 8)
1134 ext_mux_chan = XADC_REG_VAUX(ext_mux_chan - 1);
1135 else
1136 return -EINVAL;
1137 }
1138
1139 *conf |= XADC_CONF0_MUX | XADC_CONF0_CHAN(ext_mux_chan);
1140 }
1141
1142 channels = devm_kmemdup(dev, xadc_channels,
1143 sizeof(xadc_channels), GFP_KERNEL);
1144 if (!channels)
1145 return -ENOMEM;
1146
1147 num_channels = 9;
1148 chan = &channels[9];
1149
1150 chan_node = of_get_child_by_name(np, "xlnx,channels");
1151 if (chan_node) {
1152 for_each_child_of_node(chan_node, child) {
1153 if (num_channels >= ARRAY_SIZE(xadc_channels)) {
1154 of_node_put(child);
1155 break;
1156 }
1157
1158 ret = of_property_read_u32(child, "reg", ®);
1159 if (ret || reg > 16)
1160 continue;
1161
1162 if (of_property_read_bool(child, "xlnx,bipolar"))
1163 chan->scan_type.sign = 's';
1164
1165 if (reg == 0) {
1166 chan->scan_index = 11;
1167 chan->address = XADC_REG_VPVN;
1168 } else {
1169 chan->scan_index = 15 + reg;
1170 chan->address = XADC_REG_VAUX(reg - 1);
1171 }
1172 num_channels++;
1173 chan++;
1174 }
1175 }
1176 of_node_put(chan_node);
1177
1178 indio_dev->num_channels = num_channels;
> 1179 indio_dev->channels = devm_krealloc(dev, channels,
1180 sizeof(*channels) * num_channels,
1181 GFP_KERNEL);
1182 /* If we can't resize the channels array, just use the original */
1183 if (!indio_dev->channels)
1184 indio_dev->channels = channels;
1185
1186 return 0;
1187 }
1188
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34281 bytes --]
next prev parent reply other threads:[~2020-07-02 19:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 16:25 [PATCH RFT] iio: adc: xilinx-xadc: use devm_krealloc() Bartosz Golaszewski
2020-07-02 16:51 ` Robin Murphy
2020-07-02 19:46 ` kernel test robot [this message]
2020-07-03 4:38 ` kernel test robot
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=202007030347.YNi7QtlY%lkp@intel.com \
--to=lkp@intel.com \
--cc=brgl@bgdev.pl \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=monstr@monstr.eu \
--cc=pmeerw@pmeerw.net \
/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