summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hfi1
diff options
context:
space:
mode:
authorBart Van Assche2018-07-10 20:32:16 +0200
committerJason Gunthorpe2018-07-11 22:20:45 +0200
commit522628ed1a933a213051228b81bc1a215ea2ab76 (patch)
treec5456847231ede8425342ccde264b13be889af11 /drivers/infiniband/hw/hfi1
parentRDMA/hns: Update the implementation of set_mac (diff)
downloadkernel-qcow2-linux-522628ed1a933a213051228b81bc1a215ea2ab76.tar.gz
kernel-qcow2-linux-522628ed1a933a213051228b81bc1a215ea2ab76.tar.xz
kernel-qcow2-linux-522628ed1a933a213051228b81bc1a215ea2ab76.zip
IB/hfi1: Suppress a compiler warning
Avoid that the following compiler warning is reported when building with gcc 8: drivers/infiniband/hw/hfi1/verbs.c:1896:2: warning: 'strncpy' output may be truncated copying 64 bytes from a string of length 64 [-Wstringop-truncation] Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1')
-rw-r--r--drivers/infiniband/hw/hfi1/verbs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c
index 2b07a5667ec8..13374c727b14 100644
--- a/drivers/infiniband/hw/hfi1/verbs.c
+++ b/drivers/infiniband/hw/hfi1/verbs.c
@@ -1884,7 +1884,7 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
ibdev->process_mad = hfi1_process_mad;
ibdev->get_dev_fw_str = hfi1_get_dev_fw_str;
- strncpy(ibdev->node_desc, init_utsname()->nodename,
+ strlcpy(ibdev->node_desc, init_utsname()->nodename,
sizeof(ibdev->node_desc));
/*