From nobody Fri Apr 10 21:56:15 2026 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 AFCE8C00140 for ; Thu, 18 Aug 2022 21:13:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346688AbiHRVNB (ORCPT ); Thu, 18 Aug 2022 17:13:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346772AbiHRVKa (ORCPT ); Thu, 18 Aug 2022 17:10:30 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93DECD8B3A for ; Thu, 18 Aug 2022 14:05:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=k1; bh=1zoS+HdMyQ16wpQJw1DKjTu/ldk Tj95NtlBc4h7r3Uc=; b=ZN+FLhABkphLx9t3M5ZIdA1cRjX16ejjRrl8lA60qku wAvpEUa1HaV82nopqz9ptegvxVeGTZ0dDzhQiCZeCenyDzyPgNVQfle5S7jSxD/7 NG3FkE8oPs6+3YRxdva4CgEnBlj+wfK7Tu3s88RyqMljXAzKxQu+7hjPtTSpVi2w = Received: (qmail 3962862 invoked from network); 18 Aug 2022 23:02:05 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 18 Aug 2022 23:02:05 +0200 X-UD-Smtp-Session: l3s3148p1@ixUxS4rm434ucref From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Subject: [PATCH] vlan: move from strlcpy with unused retval to strscpy Date: Thu, 18 Aug 2022 23:02:04 +0200 Message-Id: <20220818210204.8275-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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-=3DwgfRnXz0W3D37d01q3JFkr_i_uTL=3DV6A6= G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang --- net/8021q/vlan_dev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 035812b0461c..e1bb41a443c4 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c @@ -674,9 +674,9 @@ static int vlan_ethtool_get_link_ksettings(struct net_d= evice *dev, static void vlan_ethtool_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) { - strlcpy(info->driver, vlan_fullname, sizeof(info->driver)); - strlcpy(info->version, vlan_version, sizeof(info->version)); - strlcpy(info->fw_version, "N/A", sizeof(info->fw_version)); + strscpy(info->driver, vlan_fullname, sizeof(info->driver)); + strscpy(info->version, vlan_version, sizeof(info->version)); + strscpy(info->fw_version, "N/A", sizeof(info->fw_version)); } =20 static int vlan_ethtool_get_ts_info(struct net_device *dev, --=20 2.35.1