All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Wen Gu <guwen@linux.alibaba.com>,
	Philo Lu <lulie@linux.alibaba.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH net-next v2 5/5] eea: Use 2-argument strscpy()
Date: Fri,  2 Oct 2026 11:59:23 +0200	[thread overview]
Message-ID: <20261002100035.863275-6-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20261002100035.863275-1-andriy.shevchenko@linux.intel.com>

From: Andy Shevchenko <andy.shevchenko@gmail.com>

Use 2-argument strscpy(), which is not only shorter but also provides
an additional check that destination buffer is an array.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/net/ethernet/alibaba/eea/eea_adminq.c  | 4 ++--
 drivers/net/ethernet/alibaba/eea/eea_ethtool.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/alibaba/eea/eea_adminq.c b/drivers/net/ethernet/alibaba/eea/eea_adminq.c
index f493afbcc41b..942f1f1911af 100644
--- a/drivers/net/ethernet/alibaba/eea/eea_adminq.c
+++ b/drivers/net/ethernet/alibaba/eea/eea_adminq.c
@@ -512,8 +512,8 @@ void eea_adminq_config_host_info(struct eea_net *enet)
 	cfg->pci_bdf            = cpu_to_le16(eea_pci_bdf(enet->edev));
 	cfg->pci_domain         = cpu_to_le32(eea_pci_domain_nr(enet->edev));
 
-	strscpy(cfg->os_ver_str, utsname()->release, sizeof(cfg->os_ver_str));
-	strscpy(cfg->isa_str, utsname()->machine, sizeof(cfg->isa_str));
+	strscpy(cfg->os_ver_str, utsname()->release);
+	strscpy(cfg->isa_str, utsname()->machine);
 
 	err = eea_adminq_exec(enet, EEA_AQ_CMD_HOST_INFO,
 			      cfg, sizeof(*cfg), rep, sizeof(*rep), NULL);
diff --git a/drivers/net/ethernet/alibaba/eea/eea_ethtool.c b/drivers/net/ethernet/alibaba/eea/eea_ethtool.c
index 479779aa2dd8..15f4c7b2d898 100644
--- a/drivers/net/ethernet/alibaba/eea/eea_ethtool.c
+++ b/drivers/net/ethernet/alibaba/eea/eea_ethtool.c
@@ -40,8 +40,8 @@ static void eea_get_drvinfo(struct net_device *netdev,
 	struct eea_net *enet = netdev_priv(netdev);
 	struct eea_device *edev = enet->edev;
 
-	strscpy(info->driver,   KBUILD_MODNAME,     sizeof(info->driver));
-	strscpy(info->bus_info, eea_pci_name(edev), sizeof(info->bus_info));
+	strscpy(info->driver, KBUILD_MODNAME);
+	strscpy(info->bus_info, eea_pci_name(edev));
 }
 
 static void eea_get_ringparam(struct net_device *netdev,
-- 
2.50.1


  parent reply	other threads:[~2026-10-02 10:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02  9:59 [PATCH net-next v2 0/5] eea: Improvements in the driver Andy Shevchenko
2026-10-02  9:59 ` [PATCH net-next v2 1/5] eea: Drop temporary buffer by using %*pEhp directly Andy Shevchenko
2026-10-02 20:50   ` Joe Damato
2026-10-03 14:47     ` Andy Shevchenko
2026-10-02  9:59 ` [PATCH net-next v2 2/5] eea: Remove unneeded assignment Andy Shevchenko
2026-10-02 20:33   ` Joe Damato
2026-10-02  9:59 ` [PATCH net-next v2 3/5] eea: Refactor error handling in eea_adminq_config_host_info() Andy Shevchenko
2026-10-02 20:37   ` Joe Damato
2026-10-02  9:59 ` [PATCH net-next v2 4/5] eea: unify return code variable name Andy Shevchenko
2026-10-02 20:40   ` Joe Damato
2026-10-08  0:04   ` Jakub Kicinski
2026-10-02  9:59 ` Andy Shevchenko [this message]
2026-10-02 20:42   ` [PATCH net-next v2 5/5] eea: Use 2-argument strscpy() Joe Damato
2026-10-08  0:10 ` [PATCH net-next v2 0/5] eea: Improvements in the driver patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261002100035.863275-6-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andy.shevchenko@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=guwen@linux.alibaba.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lulie@linux.alibaba.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.