Commit 0916c65a authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'intel-wired-lan-driver-updates-2023-10-17'

Jacob Keller says:

====================
Intel Wired LAN Driver Updates 2023-10-17

This series contains cleanups for all the Intel drivers relating to their
use of format specifiers and the use of strncpy.

Jesse fixes various -Wformat warnings across all the Intel networking,
including various cases where a "%s" string format specifier is preferred,
and using kasprintf instead of snprintf.

Justin replaces all of the uses of the now deprecated strncpy with a more
modern string function, primarily strscpy.
====================

Link: https://lore.kernel.org/r/20231017190411.2199743-1-jacob.e.keller@intel.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 50ee052b d10d64ad
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2841,7 +2841,7 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	netdev->netdev_ops = &e100_netdev_ops;
	netdev->ethtool_ops = &e100_ethtool_ops;
	netdev->watchdog_timeo = E100_WATCHDOG_PERIOD;
	strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);
	strscpy(netdev->name, pci_name(pdev), sizeof(netdev->name));

	nic = netdev_priv(netdev);
	netif_napi_add_weight(netdev, &nic->napi, e100_poll, E100_NAPI_WEIGHT);
+1 −1
Original line number Diff line number Diff line
@@ -1014,7 +1014,7 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	netdev->watchdog_timeo = 5 * HZ;
	netif_napi_add(netdev, &adapter->napi, e1000_clean);

	strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);
	strscpy(netdev->name, pci_name(pdev), sizeof(netdev->name));

	adapter->bd_number = cards_found;

+4 −4
Original line number Diff line number Diff line
@@ -448,10 +448,10 @@ static void fm10k_get_drvinfo(struct net_device *dev,
{
	struct fm10k_intfc *interface = netdev_priv(dev);

	strncpy(info->driver, fm10k_driver_name,
		sizeof(info->driver) - 1);
	strncpy(info->bus_info, pci_name(interface->pdev),
		sizeof(info->bus_info) - 1);
	strscpy(info->driver, fm10k_driver_name,
		sizeof(info->driver));
	strscpy(info->bus_info, pci_name(interface->pdev),
		sizeof(info->bus_info));
}

static void fm10k_get_pauseparam(struct net_device *dev,
+3 −4
Original line number Diff line number Diff line
@@ -456,10 +456,9 @@ int i40e_ddp_flash(struct net_device *netdev, struct ethtool_flash *flash)
		char profile_name[sizeof(I40E_DDP_PROFILE_PATH)
				  + I40E_DDP_PROFILE_NAME_MAX];

		profile_name[sizeof(profile_name) - 1] = 0;
		strncpy(profile_name, I40E_DDP_PROFILE_PATH,
			sizeof(profile_name) - 1);
		strncat(profile_name, flash->data, I40E_DDP_PROFILE_NAME_MAX);
		scnprintf(profile_name, sizeof(profile_name), "%s%s",
			  I40E_DDP_PROFILE_PATH, flash->data);

		/* Load DDP recipe. */
		status = request_firmware(&ddp_config, profile_name,
					  &netdev->dev);
+4 −2
Original line number Diff line number Diff line
@@ -2514,11 +2514,13 @@ static void i40e_get_priv_flag_strings(struct net_device *netdev, u8 *data)
	u8 *p = data;

	for (i = 0; i < I40E_PRIV_FLAGS_STR_LEN; i++)
		ethtool_sprintf(&p, i40e_gstrings_priv_flags[i].flag_string);
		ethtool_sprintf(&p, "%s",
				i40e_gstrings_priv_flags[i].flag_string);
	if (pf->hw.pf_id != 0)
		return;
	for (i = 0; i < I40E_GL_PRIV_FLAGS_STR_LEN; i++)
		ethtool_sprintf(&p, i40e_gl_gstrings_priv_flags[i].flag_string);
		ethtool_sprintf(&p, "%s",
				i40e_gl_gstrings_priv_flags[i].flag_string);
}

static void i40e_get_strings(struct net_device *netdev, u32 stringset,
Loading