• Bart Van Assche's avatar
    RDMA/usnic: Suppress a compiler warning · 7cfcc71e
    Bart Van Assche authored
    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: default avatarBart Van Assche <bart.vanassche@wdc.com>
    Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
    7cfcc71e
usnic_fwd.h 4.18 KB