From patchwork Mon Jul 1 12:42:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 13718025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C1179155381 for ; Mon, 1 Jul 2024 12:42:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719837758; cv=none; b=ftje73BiFUFhG12ZNlEaZQf7hexQJXnleDGsJkg5okxxs8G7Y3FgIFe5b+5SadyJNA90lqsPqIcEfSKjOzanxaiWPJpHsowH2PoWplo0CiFc7521sI9NEJqKgZDMuWLrlLTdO3weW58TuxKTsrmuoTzWfWW8/zThSnoy2iBXK5I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719837758; c=relaxed/simple; bh=6UmkcBclHs0MYzrXM3wBbSaid5lteMEaNtTSdMElkYA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=typSy0A8ROalGz75podcoklOSXkIZexYGI9gFF19YU1NwoSM5luxShVk3vqKym/k116MzSyVmL4a4SMIyWN7WlioKc155O2iVhgoJ2wjrUc84lKGgi1EtiTd2EvOI/TXZZW+Z/dchW8sVVKLEqVz3Y1OTBtbFUTZWVo7GsqEOlM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kW3i0dx8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kW3i0dx8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF7C7C116B1; Mon, 1 Jul 2024 12:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719837758; bh=6UmkcBclHs0MYzrXM3wBbSaid5lteMEaNtTSdMElkYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kW3i0dx8eGygLZGxuqSvHQRl6EhS1yNtO7cj4z/WcGSfJO7hJdbHcnQicQJIlzu1U pbJBC3WTeLPgpNviZIKIrcriAm8+M4lJKe3I0s1agY+FhAUogTOk+Kj94Trs3kC5w2 fCuBv6y2CQxT3m/kVyLjeCmVjht2SfekjYRpa9wfHEnl3jt+3eHgcbfekDHJvMpUDt dQ7EfEVd/9rf3xTL8fGVLFcSiY7QZbesZG0P4sNiXhnZxfy7P8USSdt+xX1u3jiTRa VuU3UqvwqmlREi+v2xdVboZtlp9nd41VuT2UXdTJLeBGcvWzgYZ6/uyMlS4N2uDZYH OTHINRSBNQIcw== From: Leon Romanovsky To: Jason Gunthorpe Cc: Leon Romanovsky , Dennis Dalessandro , linux-rdma@vger.kernel.org Subject: [PATCH rdma-next 2/2] RDMA/qib: Fix truncation compilation warnings in qib_verbs.c Date: Mon, 1 Jul 2024 15:42:29 +0300 Message-ID: <1fb6393fa2e0702fef995834c3c7db972bbc4d06.1719837715.git.leon@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Leon Romanovsky Reduce nodename string size to fit IB_DEVICE_NODE_DESC_MAX. drivers/infiniband/hw/qib/qib_verbs.c: In function ‘qib_register_ib_device’: drivers/infiniband/hw/qib/qib_verbs.c:1554:40: error: ‘%s’ directive output may be truncated writing up to 64 bytes into a region of size 43 [-Werror=format-truncation=] 1554 | "Intel Infiniband HCA %s", init_utsname()->nodename); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband/hw/qib/qib_verbs.c:1553:9: note: ‘snprintf’ output between 22 and 86 bytes into a destination of size 64 1553 | snprintf(ibdev->node_desc, sizeof(ibdev->node_desc), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1554 | "Intel Infiniband HCA %s", init_utsname()->nodename); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Leon Romanovsky Acked-by: Dennis Dalessandro --- drivers/infiniband/hw/qib/qib_verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/qib/qib_verbs.c b/drivers/infiniband/hw/qib/qib_verbs.c index 0080f0be72fe..5fcb41970ad9 100644 --- a/drivers/infiniband/hw/qib/qib_verbs.c +++ b/drivers/infiniband/hw/qib/qib_verbs.c @@ -1551,7 +1551,7 @@ int qib_register_ib_device(struct qib_devdata *dd) ibdev->dev.parent = &dd->pcidev->dev; snprintf(ibdev->node_desc, sizeof(ibdev->node_desc), - "Intel Infiniband HCA %s", init_utsname()->nodename); + "Intel Infiniband HCA %.42s", init_utsname()->nodename); /* * Fill in rvt info object.