From nobody Fri May 9 23:23:02 2025 Delivered-To: importer2@patchew.org Received-SPF: pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; envelope-from=linux-kernel-owner@vger.kernel.org; helo=vger.kernel.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1611997614; cv=none; d=zohomail.com; s=zohoarc; b=Jj3AfwCuw0s0Mu5HGdEN1C2kkE7GHPGq0t/MMMgMLn426jF8ppbn8wrwvUztkEY7rcLkVuiOKkJ1OYhtWhTFE4u9Gk+KvGm2EmO859itTvGk7hQn6Ncf85JZLeAqSmR2Jp0zm97PsPH4vBthK+k3C897jZ8lKCdEiMXxluFiUqc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611997614; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:MIME-Version:Message-ID:Subject:To; bh=W4ElXu2pfKkjYu5Tw1aWk15MrTDF5YFDL7qh1XByBdU=; b=Ckq/dRs2ZPpys5HAfcZ2WgDv3NT51uiVyDtTZRZTS0dmqs+32Jkv7tQjSThQJVqdC6e/606/+Vt9k1zYR0FlO+N75pYk54ZUZCnr10rK/jmPWHGkMJiha6s0XNQ0ThSGxrL5LnFymbMTD8XV2PTUXL0r+oUDqqN8T7WrF4K+w0U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mx.zohomail.com with SMTP id 1611997614634370.12579798962406; Sat, 30 Jan 2021 01:06:54 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233757AbhA3JGK (ORCPT ); Sat, 30 Jan 2021 04:06:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233785AbhA3Evg (ORCPT ); Fri, 29 Jan 2021 23:51:36 -0500 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6328EC0613D6; Fri, 29 Jan 2021 20:49:43 -0800 (PST) Received: by mail-pj1-x1044.google.com with SMTP id md11so6839677pjb.0; Fri, 29 Jan 2021 20:49:43 -0800 (PST) Received: from localhost ([2402:3a80:11ea:a43c:a2a4:c5ff:fe20:7222]) by smtp.gmail.com with ESMTPSA id z201sm5385249pfc.157.2021.01.29.20.49.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jan 2021 20:49:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=W4ElXu2pfKkjYu5Tw1aWk15MrTDF5YFDL7qh1XByBdU=; b=ulPePdt06VqbRP2Ujk8YwZYWD5dPcMsw0esI2Kr6hHl3kPuXd0V04B5AbW06/iUh2y 3X14k0FOC0gg9t8YTtoKOSq2e6ThnCsNEJ70mbaVC4gCQiUVYwsN7L+r29r0PVtPylXX o5JmE2gfJEG/K7qIyZesI2m/3vTR2RfJgCEkwyrCPgL2Yqi7W89kuV/BYkTWMQqESrRp MwADubfTtYYyqt0V7GOQLATuKMkGmP2nWnCHnKfqFaMH3WHwj8GhPuoIx0V54p1tIZcj 5VGSqtyEqOd1GtazFyUH/Q9B7UVd7sWkoSfMrMHqxW8KG3XazWx/2vabz7LtN4o144mc bhNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=W4ElXu2pfKkjYu5Tw1aWk15MrTDF5YFDL7qh1XByBdU=; b=Eh+jvgKrGwpeLrGcHp6gU9kkTPw6wLshjjgoUqH70PkgLmU84MLj3ipRzS/pY7QRZ1 ROhAZvFE7KnPLQT5rtY8kcpf9PCq3XzpqYVmiOCtlylwmw3xNDyQlcJLELxHlP8XRVty +WwKMCp7rqxoKQ/YmSzY8M9OMCsJWO/GsaYSL2CFQyRMARyavpIFl74ylt7i+1he5Ltu 2i1GU8aFgZgYynvQR0n6Ip0AjDcOtl8/4yXm5NhgB5N28plni9zC5xBdvNFkJzTr73zp Hm9ntsdHn/JD3/q3AcI6FzIMjmp2nZLL9O29Ri79irLdjFtYyDeAypAYa9GK8a7Ir8Bi SopA== X-Gm-Message-State: AOAM530k7bII9NQrtrMo842jK47BRQq9MV8Gv2VOvXNZN5+J6CGqoIZM 7uNjrIZ2z8rjZQe2rUckE+M= X-Google-Smtp-Source: ABdhPJz9rqRji737ivUghrqzFXycVYcDmyKV5BXhRQHvkmQmsOZi5IkJYmQS7gIvAzb9hG43ivNAbw== X-Received: by 2002:a17:902:854b:b029:e1:1d90:f299 with SMTP id d11-20020a170902854bb02900e11d90f299mr7130144plo.15.1611982182581; Fri, 29 Jan 2021 20:49:42 -0800 (PST) From: Kumar Kartikeya Dwivedi Cc: memxor@gmail.com, Manish Chopra , GR-Linux-NIC-Dev@marvell.com, Greg Kroah-Hartman , netdev@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] staging: qlge/qlge_ethtool.c: Switch from strlcpy to strscpy Date: Sat, 30 Jan 2021 10:18:28 +0530 Message-Id: <20210130044828.121248-1-memxor@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" strlcpy is marked as deprecated in Documentation/process/deprecated.rst, and there is no functional difference when the caller expects truncation (when not checking the return value). strscpy is relatively better as it also avoids scanning the whole source string. This silences the related checkpatch warnings from: 5dbdb2d87c29 ("checkpatch: prefer strscpy to strlcpy") Signed-off-by: Kumar Kartikeya Dwivedi --- drivers/staging/qlge/qlge_ethtool.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/qlge/qlge_ethtool.c b/drivers/staging/qlge/qlg= e_ethtool.c index a28f0254c..635d3338f 100644 --- a/drivers/staging/qlge/qlge_ethtool.c +++ b/drivers/staging/qlge/qlge_ethtool.c @@ -417,15 +417,15 @@ static void ql_get_drvinfo(struct net_device *ndev, { struct ql_adapter *qdev =3D netdev_priv(ndev); =20 - strlcpy(drvinfo->driver, qlge_driver_name, sizeof(drvinfo->driver)); - strlcpy(drvinfo->version, qlge_driver_version, + strscpy(drvinfo->driver, qlge_driver_name, sizeof(drvinfo->driver)); + strscpy(drvinfo->version, qlge_driver_version, sizeof(drvinfo->version)); snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), "v%d.%d.%d", (qdev->fw_rev_id & 0x00ff0000) >> 16, (qdev->fw_rev_id & 0x0000ff00) >> 8, (qdev->fw_rev_id & 0x000000ff)); - strlcpy(drvinfo->bus_info, pci_name(qdev->pdev), + strscpy(drvinfo->bus_info, pci_name(qdev->pdev), sizeof(drvinfo->bus_info)); } =20 --=20 2.29.2