RDMA/usnic: Suppress a compiler warning
authorBart Van Assche <bart.vanassche@wdc.com>
Mon, 23 Jul 2018 22:37:01 +0000 (15:37 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 26 Jul 2018 17:39:06 +0000 (11:39 -0600)
commit7cfcc71eb0e50f191983d714223c169c47437021
tree4595b4b96c1fa09a04910152bf1682cb442ac5db
parent5d85a822fae2b484f26ddb09815063a88962a0cb
RDMA/usnic: Suppress a compiler warning

This patch avoids that the following compiler warning is reported when
building with gcc 8 and W=1:

drivers/infiniband/hw/usnic/usnic_fwd.c:95:2: warning: 'strncpy' output may be truncated copying 16 bytes from a string of length 20 [-Wstringop-truncation]
  strncpy(ufdev->name, netdev_name(ufdev->netdev),
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    sizeof(ufdev->name) - 1);
    ~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/usnic/usnic_fwd.c
drivers/infiniband/hw/usnic/usnic_fwd.h