tree:
https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git rdma-next
head: 4c0870255a8dbe1caa2cdbccdd1632680e6a2201
commit: 244ea138ab718042f382e8083dd19752b1fd591e [68/81] RDMA/core: Introduce new GID
table query API
config: powerpc-randconfig-r032-20200913 (attached as .config)
compiler: clang version 12.0.0 (
https://github.com/llvm/llvm-project
3ed89b51da38f081fedb57727076262abb81d149)
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 powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
git checkout 244ea138ab718042f382e8083dd19752b1fd591e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
> drivers/infiniband/core/cache.c:1295:9: warning: variable
'ret' is used uninitialized whenever 'if' condition is true
[-Wsometimes-uninitialized]
if (IS_ERR(ndev)) {
^~~~~~~~~~~~
drivers/infiniband/core/cache.c:1314:9: note: uninitialized use occurs here
return ret;
^~~
drivers/infiniband/core/cache.c:1295:5: note: remove the 'if' if its condition
is always false
if (IS_ERR(ndev)) {
^~~~~~~~~~~~~~~~~~~
drivers/infiniband/core/cache.c:1265:30: note: initialize the variable 'ret' to
silence this warning
ssize_t num_entries = 0, ret;
^
= 0
1 warning generated.
#
https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/commi...
git remote add leon-rdma
https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git
git fetch --no-tags leon-rdma rdma-next
git checkout 244ea138ab718042f382e8083dd19752b1fd591e
vim +1295 drivers/infiniband/core/cache.c
1249
1250 /**
1251 * rdma_query_gid_table - Reads GID table entries of all the ports of a device up
to max_entries.
1252 * @device: The device to query.
1253 * @entries: Entries where GID entries are returned.
1254 * @max_entries: Maximum number of entries that can be returned.
1255 * Entries array must be allocated to hold max_entries number of entries.
1256 * @num_entries: Updated to the number of entries that were successfully read.
1257 *
1258 * Returns number of entries on success or appropriate error code.
1259 */
1260 ssize_t rdma_query_gid_table(struct ib_device *device,
1261 struct ib_uverbs_gid_entry *entries,
1262 size_t max_entries)
1263 {
1264 const struct ib_gid_attr *gid_attr;
1265 ssize_t num_entries = 0, ret;
1266 struct ib_gid_table *table;
1267 unsigned int port_num, i;
1268 struct net_device *ndev;
1269 unsigned long flags;
1270
1271 rdma_for_each_port(device, port_num) {
1272 if (!rdma_ib_or_roce(device, port_num))
1273 continue;
1274
1275 table = rdma_gid_table(device, port_num);
1276 read_lock_irqsave(&table->rwlock, flags);
1277 for (i = 0; i < table->sz; i++) {
1278 if (!is_gid_entry_valid(table->data_vec[i]))
1279 continue;
1280 if (num_entries >= max_entries) {
1281 ret = -EINVAL;
1282 goto err;
1283 }
1284
1285 gid_attr = &table->data_vec[i]->attr;
1286
1287 memcpy(&entries->gid, &gid_attr->gid,
1288 sizeof(gid_attr->gid));
1289 entries->gid_index = gid_attr->index;
1290 entries->port_num = gid_attr->port_num;
1291 entries->gid_type = gid_attr->gid_type;
1292 if (rdma_protocol_roce(device, port_num)) {
1293 rcu_read_lock();
1294 ndev = rdma_read_gid_attr_ndev_rcu(gid_attr);
1295 if (IS_ERR(ndev)) {
1296 rcu_read_unlock();
1297 goto err;
1298 }
1299 entries->netdev_ifindex = ndev->ifindex;
1300 rcu_read_unlock();
1301 } else {
1302 entries->netdev_ifindex = 0;
1303 }
1304
1305 num_entries++;
1306 entries++;
1307 }
1308 read_unlock_irqrestore(&table->rwlock, flags);
1309 }
1310
1311 return num_entries;
1312 err:
1313 read_unlock_irqrestore(&table->rwlock, flags);
1314 return ret;
1315 }
1316 EXPORT_SYMBOL(rdma_query_gid_table);
1317
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org