From patchwork Tue Jul 10 18:32:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10517693 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4CDC66054E for ; Tue, 10 Jul 2018 18:32:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4216628E46 for ; Tue, 10 Jul 2018 18:32:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3685128EA2; Tue, 10 Jul 2018 18:32:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C713728EA3 for ; Tue, 10 Jul 2018 18:32:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387709AbeGJSc2 (ORCPT ); Tue, 10 Jul 2018 14:32:28 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:24103 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388630AbeGJSc2 (ORCPT ); Tue, 10 Jul 2018 14:32:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1531247537; x=1562783537; h=from:to:cc:subject:date:message-id; bh=f7Xl2ng2dWJla64bS5j7PIyv+ZFL9pMrGYl1zoyspmk=; b=Dczn33VVEZFceR9OjlwjWO0u3R4S9d1FxC06o+eU7VkqZfYlQEJOjfLr BUf/Z8Cg08gIH7ddN5/XTvhTZB9TnQ3J8nSYP5e65ebew6SYY3ROzKWvn 1QIezhLvLFyAfO6g6Z2TAxmxTg8VLRgA3Fnl6K+aJ0bKF8XR1/9jZtAs/ j+EoS2SvKy/Uoi6P2qMVsWTvhb83tgfMOcOtvR5XL3ZQCj+pxHQiruzN+ dKtDud0Igwc2tZLoYUKEC9pFCTcRsLUKTym6WDU5mk+iRpA3gP4coHoYt +OzVD+IJZmPCLYie9JmDCGHyuNfYZX87kRGdUaExV42ZoKAs7KQW8kdqS Q==; X-IronPort-AV: E=Sophos;i="5.51,335,1526313600"; d="scan'208";a="84354573" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 11 Jul 2018 02:32:16 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 10 Jul 2018 11:21:06 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip02.wdc.com with ESMTP; 10 Jul 2018 11:32:16 -0700 From: Bart Van Assche To: Jason Gunthorpe Cc: Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche Subject: [PATCH] IB/hfi1: Suppress a compiler warning Date: Tue, 10 Jul 2018 11:32:16 -0700 Message-Id: <20180710183216.25450-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.18.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c index 5cef1224fa9c..47aade71acbb 100644 --- a/drivers/infiniband/hw/hfi1/verbs.c +++ b/drivers/infiniband/hw/hfi1/verbs.c @@ -1893,7 +1893,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)); /*