From ecc57880bbb0f2e4df4986dee9934045322b4273 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Fri, 2 Oct 2026 11:59:23 +0200 Subject: [PATCH] eea: Use 2-argument strscpy() 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 Reviewed-by: Joe Damato Link: https://patch.msgid.link/20261002100035.863275-6-andriy.shevchenko@linux.intel.com Signed-off-by: Jakub Kicinski --- 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 92eeff32b00c..8e5f4a740b95 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); rc = 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, -- knotmirror 0.0.1