From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47A69C3F6B0 for ; Thu, 18 Aug 2022 21:11:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346805AbiHRVKd (ORCPT ); Thu, 18 Aug 2022 17:10:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346664AbiHRVJt (ORCPT ); Thu, 18 Aug 2022 17:09:49 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F5B3DB7C5 for ; Thu, 18 Aug 2022 14:04:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=zNGcWev70U81Af Nj3MHIhMt6tSn8ybmmrIoMJ2Wbglw=; b=YxJn167xGLzWIBJRsXVGAh+uX4LzKf 99CZYq55acXPpVZpxe2LSdMP6VEKOLYKkzvGw+fPCsdfDDel5wasrWdLN75VQA1F dGc45vXZ/MzMK+B2M2rkvzNrm94ummrTJNylME6wudGZjDCSGFrrgDEqxsBU+TDy 3DTjrI5FOqHyo= Received: (qmail 3962050 invoked from network); 18 Aug 2022 23:01:31 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 18 Aug 2022 23:01:31 +0200 X-UD-Smtp-Session: l3s3148p1@LLQmSYrme/Yucref From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , linux-nfs@vger.kernel.org Subject: [PATCH 07/14] lockd: move from strlcpy with unused retval to strscpy Date: Thu, 18 Aug 2022 23:01:16 +0200 Message-Id: <20220818210123.7637-7-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220818210123.7637-1-wsa+renesas@sang-engineering.com> References: <20220818210123.7637-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang --- fs/lockd/host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/lockd/host.c b/fs/lockd/host.c index f802223e71ab..cdc8e12cdac4 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c @@ -164,7 +164,7 @@ static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni, host->h_addrbuf = nsm->sm_addrbuf; host->net = ni->net; host->h_cred = get_cred(ni->cred); - strlcpy(host->nodename, utsname()->nodename, sizeof(host->nodename)); + strscpy(host->nodename, utsname()->nodename, sizeof(host->nodename)); out: return host; -- 2.35.1