Re: [PATCH 2/3] RDMA/hfi1, rdmavt: open-code rvt_set_ibdev_name()

From: kernel test robot

Date: Sun Mar 22 2026 - 14:30:24 EST


Hi Arnd,

kernel test robot noticed the following build errors:

[auto build test ERROR on rdma/for-next]
[also build test ERROR on soc/for-next linus/master v7.0-rc4 next-20260320]
[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#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Arnd-Bergmann/RDMA-hfi1-rdmavt-open-code-rvt_set_ibdev_name/20260322-190924
base: https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
patch link: https://lore.kernel.org/r/20260320151511.3420818-2-arnd%40kernel.org
patch subject: [PATCH 2/3] RDMA/hfi1, rdmavt: open-code rvt_set_ibdev_name()
config: x86_64-rhel-9.4-ltp (https://download.01.org/0day-ci/archive/20260322/202603221954.LIO9WBor-lkp@xxxxxxxxx/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260322/202603221954.LIO9WBor-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603221954.LIO9WBor-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

In file included from include/linux/uuid.h:11,
from include/linux/mod_devicetable.h:14,
from include/linux/pci.h:27,
from drivers/infiniband/hw/hfi1/init.c:7:
drivers/infiniband/hw/hfi1/init.c: In function 'hfi1_alloc_devdata':
>> drivers/infiniband/hw/hfi1/init.c:1240:17: error: passing argument 1 of 'sized_strscpy' from incompatible pointer type [-Wincompatible-pointer-types]
1240 | strscpy(&ibdev->name, dev_name(&ibdev->dev), IB_DEVICE_NAME_MAX);
| ^~~~~~~~~~~~
| |
| char (*)[64]
include/linux/string.h:83:23: note: in definition of macro '__strscpy1'
83 | sized_strscpy(dst, src, size + __must_be_cstr(dst) + __must_be_cstr(src))
| ^~~
drivers/infiniband/hw/hfi1/init.c:1240:9: note: in expansion of macro 'strscpy'
1240 | strscpy(&ibdev->name, dev_name(&ibdev->dev), IB_DEVICE_NAME_MAX);
| ^~~~~~~
In file included from include/linux/string.h:386:
include/linux/fortify-string.h:275:57: note: expected 'char *' but argument is of type 'char (*)[64]'
275 | __FORTIFY_INLINE ssize_t sized_strscpy(char * const POS p, const char * const POS q, size_t size)
| ~~~~~~~~~~~~~~~~~^


vim +/sized_strscpy +1240 drivers/infiniband/hw/hfi1/init.c

1195
1196 /**
1197 * hfi1_alloc_devdata - Allocate our primary per-unit data structure.
1198 * @pdev: Valid PCI device
1199 * @extra: How many bytes to alloc past the default
1200 *
1201 * Must be done via verbs allocator, because the verbs cleanup process
1202 * both does cleanup and free of the data structure.
1203 * "extra" is for chip-specific data.
1204 */
1205 static struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev,
1206 size_t extra)
1207 {
1208 struct hfi1_devdata *dd;
1209 struct ib_device *ibdev;
1210 int ret, nports;
1211
1212 /* extra is * number of ports */
1213 nports = extra / sizeof(struct hfi1_pportdata);
1214
1215 dd = (struct hfi1_devdata *)rvt_alloc_device(sizeof(*dd) + extra,
1216 nports);
1217 if (!dd)
1218 return ERR_PTR(-ENOMEM);
1219 dd->num_pports = nports;
1220 dd->pport = (struct hfi1_pportdata *)(dd + 1);
1221 dd->pcidev = pdev;
1222 pci_set_drvdata(pdev, dd);
1223
1224 ret = xa_alloc_irq(&hfi1_dev_table, &dd->unit, dd, xa_limit_32b,
1225 GFP_KERNEL);
1226 if (ret < 0) {
1227 dev_err(&pdev->dev,
1228 "Could not allocate unit ID: error %d\n", -ret);
1229 goto bail;
1230 }
1231
1232 /*
1233 * FIXME: rvt and its users want to touch the ibdev before
1234 * registration and have things like the name work. We don't have the
1235 * infrastructure in the core to support this directly today, hack it
1236 * to work by setting the name manually here.
1237 */
1238 ibdev = &dd->verbs_dev.rdi.ibdev;
1239 dev_set_name(&ibdev->dev, "%s_%d", class_name(), dd->unit);
> 1240 strscpy(&ibdev->name, dev_name(&ibdev->dev), IB_DEVICE_NAME_MAX);
1241
1242 /*
1243 * If the BIOS does not have the NUMA node information set, select
1244 * NUMA 0 so we get consistent performance.
1245 */
1246 dd->node = pcibus_to_node(pdev->bus);
1247 if (dd->node == NUMA_NO_NODE) {
1248 dd_dev_err(dd, "Invalid PCI NUMA node. Performance may be affected\n");
1249 dd->node = 0;
1250 }
1251
1252 /*
1253 * Initialize all locks for the device. This needs to be as early as
1254 * possible so locks are usable.
1255 */
1256 spin_lock_init(&dd->sc_lock);
1257 spin_lock_init(&dd->sendctrl_lock);
1258 spin_lock_init(&dd->rcvctrl_lock);
1259 spin_lock_init(&dd->uctxt_lock);
1260 spin_lock_init(&dd->hfi1_diag_trans_lock);
1261 spin_lock_init(&dd->sc_init_lock);
1262 spin_lock_init(&dd->dc8051_memlock);
1263 seqlock_init(&dd->sc2vl_lock);
1264 spin_lock_init(&dd->sde_map_lock);
1265 spin_lock_init(&dd->pio_map_lock);
1266 mutex_init(&dd->dc8051_lock);
1267 init_waitqueue_head(&dd->event_queue);
1268 spin_lock_init(&dd->irq_src_lock);
1269
1270 dd->int_counter = alloc_percpu(u64);
1271 if (!dd->int_counter) {
1272 ret = -ENOMEM;
1273 goto bail;
1274 }
1275
1276 dd->rcv_limit = alloc_percpu(u64);
1277 if (!dd->rcv_limit) {
1278 ret = -ENOMEM;
1279 goto bail;
1280 }
1281
1282 dd->send_schedule = alloc_percpu(u64);
1283 if (!dd->send_schedule) {
1284 ret = -ENOMEM;
1285 goto bail;
1286 }
1287
1288 dd->tx_opstats = alloc_percpu(struct hfi1_opcode_stats_perctx);
1289 if (!dd->tx_opstats) {
1290 ret = -ENOMEM;
1291 goto bail;
1292 }
1293
1294 dd->comp_vect = kzalloc_obj(*dd->comp_vect);
1295 if (!dd->comp_vect) {
1296 ret = -ENOMEM;
1297 goto bail;
1298 }
1299
1300 /* allocate dummy tail memory for all receive contexts */
1301 dd->rcvhdrtail_dummy_kvaddr =
1302 dma_alloc_coherent(&dd->pcidev->dev, sizeof(u64),
1303 &dd->rcvhdrtail_dummy_dma, GFP_KERNEL);
1304 if (!dd->rcvhdrtail_dummy_kvaddr) {
1305 ret = -ENOMEM;
1306 goto bail;
1307 }
1308
1309 atomic_set(&dd->ipoib_rsm_usr_num, 0);
1310 return dd;
1311
1312 bail:
1313 hfi1_free_devdata(dd);
1314 return ERR_PTR(ret);
1315 }
1316

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki