From 68aad78c5023b8aa82da99b47f9d8cf40e8ca453 Mon Sep 17 00:00:00 2001 From: Rick Jones Date: Mon, 7 Nov 2011 13:29:27 +0000 Subject: sweep the floors and convert some .get_drvinfo routines to strlcpy Per the mention made by Ben Hutchings that strlcpy is now the preferred string copy routine for a .get_drvinfo routine, do a bit of floor sweeping and convert some of the as-yet unconverted ethernet drivers to it. Signed-off-by: Rick Jones Signed-off-by: David S. Miller --- drivers/net/ethernet/atheros/atlx/atl2.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/net/ethernet/atheros/atlx/atl2.c') diff --git a/drivers/net/ethernet/atheros/atlx/atl2.c b/drivers/net/ethernet/atheros/atlx/atl2.c index 1feae5928a4b..db3f43046d32 100644 --- a/drivers/net/ethernet/atheros/atlx/atl2.c +++ b/drivers/net/ethernet/atheros/atlx/atl2.c @@ -2049,10 +2049,12 @@ static void atl2_get_drvinfo(struct net_device *netdev, { struct atl2_adapter *adapter = netdev_priv(netdev); - strncpy(drvinfo->driver, atl2_driver_name, 32); - strncpy(drvinfo->version, atl2_driver_version, 32); - strncpy(drvinfo->fw_version, "L2", 32); - strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32); + strlcpy(drvinfo->driver, atl2_driver_name, sizeof(drvinfo->driver)); + strlcpy(drvinfo->version, atl2_driver_version, + sizeof(drvinfo->version)); + strlcpy(drvinfo->fw_version, "L2", sizeof(drvinfo->fw_version)); + strlcpy(drvinfo->bus_info, pci_name(adapter->pdev), + sizeof(drvinfo->bus_info)); drvinfo->n_stats = 0; drvinfo->testinfo_len = 0; drvinfo->regdump_len = atl2_get_regs_len(netdev); -- cgit v1.2.3