tree: https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git rdma-next head: 3851deadf6de976fe0d2f72ca1084b47a044c2c7 commit: 1f2b65dfb4d995e74b621e3e21e7c7445d187956 [24/31] RDMA/core: Modify rdma_query_gid() to return accurate error codes config: nios2-allyesconfig (https://download.01.org/0day-ci/archive/20211210/202112100326.X7X2uSiO-lkp@intel.com/config) compiler: nios2-linux-gcc (GCC) 11.2.0 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 # https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/commit/?id=1f2b65dfb4d995e74b621e3e21e7c7445d187956 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 1f2b65dfb4d995e74b621e3e21e7c7445d187956 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=nios2 SHELL=/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): drivers/infiniband/core/cache.c: In function 'rdma_query_gid': >> drivers/infiniband/core/cache.c:968:17: error: expected ';' before 'goto' 968 | goto done; | ^~~~ vim +968 drivers/infiniband/core/cache.c 03db3a2d81e6e8 Matan Barak 2015-07-30 938 6612b4983f7e8d Parav Pandit 2018-03-13 939 /** c3d71b69a75cbb Jason Gunthorpe 2018-06-05 940 * rdma_query_gid - Read the GID content from the GID software cache c3d71b69a75cbb Jason Gunthorpe 2018-06-05 941 * @device: Device to query the GID c3d71b69a75cbb Jason Gunthorpe 2018-06-05 942 * @port_num: Port number of the device c3d71b69a75cbb Jason Gunthorpe 2018-06-05 943 * @index: Index of the GID table entry to read c3d71b69a75cbb Jason Gunthorpe 2018-06-05 944 * @gid: Pointer to GID where to store the entry's GID c3d71b69a75cbb Jason Gunthorpe 2018-06-05 945 * c3d71b69a75cbb Jason Gunthorpe 2018-06-05 946 * rdma_query_gid() only reads the GID entry content for requested device, c3d71b69a75cbb Jason Gunthorpe 2018-06-05 947 * port and index. It reads for IB, RoCE and iWarp link layers. It doesn't c3d71b69a75cbb Jason Gunthorpe 2018-06-05 948 * hold any reference to the GID table entry in the HCA or software cache. c3d71b69a75cbb Jason Gunthorpe 2018-06-05 949 * c3d71b69a75cbb Jason Gunthorpe 2018-06-05 950 * Returns 0 on success or appropriate error code. c3d71b69a75cbb Jason Gunthorpe 2018-06-05 951 * c3d71b69a75cbb Jason Gunthorpe 2018-06-05 952 */ 1fb7f8973f51ca Mark Bloch 2021-03-01 953 int rdma_query_gid(struct ib_device *device, u32 port_num, c3d71b69a75cbb Jason Gunthorpe 2018-06-05 954 int index, union ib_gid *gid) c3d71b69a75cbb Jason Gunthorpe 2018-06-05 955 { c3d71b69a75cbb Jason Gunthorpe 2018-06-05 956 struct ib_gid_table *table; c3d71b69a75cbb Jason Gunthorpe 2018-06-05 957 unsigned long flags; 1f2b65dfb4d995 Avihai Horon 2021-10-25 958 int res; c3d71b69a75cbb Jason Gunthorpe 2018-06-05 959 c3d71b69a75cbb Jason Gunthorpe 2018-06-05 960 if (!rdma_is_port_valid(device, port_num)) c3d71b69a75cbb Jason Gunthorpe 2018-06-05 961 return -EINVAL; c3d71b69a75cbb Jason Gunthorpe 2018-06-05 962 c3d71b69a75cbb Jason Gunthorpe 2018-06-05 963 table = rdma_gid_table(device, port_num); c3d71b69a75cbb Jason Gunthorpe 2018-06-05 964 read_lock_irqsave(&table->rwlock, flags); c3d71b69a75cbb Jason Gunthorpe 2018-06-05 965 1f2b65dfb4d995 Avihai Horon 2021-10-25 966 if (index < 0 || index >= table->sz) { 1f2b65dfb4d995 Avihai Horon 2021-10-25 967 res = -EINVAL c3d71b69a75cbb Jason Gunthorpe 2018-06-05 @968 goto done; 1f2b65dfb4d995 Avihai Horon 2021-10-25 969 } 1f2b65dfb4d995 Avihai Horon 2021-10-25 970 1f2b65dfb4d995 Avihai Horon 2021-10-25 971 if (!is_gid_entry_valid(table->data_vec[index])) { 1f2b65dfb4d995 Avihai Horon 2021-10-25 972 res = -ENOENT; 1f2b65dfb4d995 Avihai Horon 2021-10-25 973 goto done; 1f2b65dfb4d995 Avihai Horon 2021-10-25 974 } c3d71b69a75cbb Jason Gunthorpe 2018-06-05 975 c3d71b69a75cbb Jason Gunthorpe 2018-06-05 976 memcpy(gid, &table->data_vec[index]->attr.gid, sizeof(*gid)); c3d71b69a75cbb Jason Gunthorpe 2018-06-05 977 res = 0; c3d71b69a75cbb Jason Gunthorpe 2018-06-05 978 c3d71b69a75cbb Jason Gunthorpe 2018-06-05 979 done: c3d71b69a75cbb Jason Gunthorpe 2018-06-05 980 read_unlock_irqrestore(&table->rwlock, flags); c3d71b69a75cbb Jason Gunthorpe 2018-06-05 981 return res; c3d71b69a75cbb Jason Gunthorpe 2018-06-05 982 } c3d71b69a75cbb Jason Gunthorpe 2018-06-05 983 EXPORT_SYMBOL(rdma_query_gid); c3d71b69a75cbb Jason Gunthorpe 2018-06-05 984 :::::: The code at line 968 was first introduced by commit :::::: c3d71b69a75cbbc03c8f43571b003ddadd40d056 IB/core: Provide rdma_ versions of the gid cache API :::::: TO: Jason Gunthorpe :::::: CC: Jason Gunthorpe --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org