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 <rick.jones2@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
34d2d89f2d
commit
68aad78c50
@@ -366,13 +366,16 @@ static void ql_get_drvinfo(struct net_device *ndev,
|
||||
struct ethtool_drvinfo *drvinfo)
|
||||
{
|
||||
struct ql_adapter *qdev = netdev_priv(ndev);
|
||||
strncpy(drvinfo->driver, qlge_driver_name, 32);
|
||||
strncpy(drvinfo->version, qlge_driver_version, 32);
|
||||
snprintf(drvinfo->fw_version, 32, "v%d.%d.%d",
|
||||
strlcpy(drvinfo->driver, qlge_driver_name, sizeof(drvinfo->driver));
|
||||
strlcpy(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));
|
||||
strncpy(drvinfo->bus_info, pci_name(qdev->pdev), 32);
|
||||
strlcpy(drvinfo->bus_info, pci_name(qdev->pdev),
|
||||
sizeof(drvinfo->bus_info));
|
||||
drvinfo->n_stats = 0;
|
||||
drvinfo->testinfo_len = 0;
|
||||
if (!test_bit(QL_FRC_COREDUMP, &qdev->flags))
|
||||
|
Reference in New Issue
Block a user