diff options
author | Rick Jones <rick.jones2@hp.com> | 2011-11-14 08:13:25 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-14 14:13:31 -0500 |
commit | 612a94d6f24eb2427eabf554392080302da664dd (patch) | |
tree | 00202ffa2c3a59b6f3e59e906e7b6a14375f88b6 /drivers/net/ethernet/intel/e1000e | |
parent | e52fcb2462ac484e6dd6e68869536609f0216938 (diff) | |
download | linux-612a94d6f24eb2427eabf554392080302da664dd.tar.gz linux-612a94d6f24eb2427eabf554392080302da664dd.tar.bz2 linux-612a94d6f24eb2427eabf554392080302da664dd.zip |
Sweep the last of the active .get_drvinfo floors under ethernet/
This round of floor sweeping converts strncpy calls in various .get_drvinfo
routines to the preferred strlcpy. It also does a modicum of other
cleaning in those routines.
Signed-off-by: Rick Jones <rick.jones2@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel/e1000e')
-rw-r--r-- | drivers/net/ethernet/intel/e1000e/ethtool.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c index 69c9d2199140..6d8f0ed33214 100644 --- a/drivers/net/ethernet/intel/e1000e/ethtool.c +++ b/drivers/net/ethernet/intel/e1000e/ethtool.c @@ -579,26 +579,24 @@ static void e1000_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo) { struct e1000_adapter *adapter = netdev_priv(netdev); - char firmware_version[32]; - strncpy(drvinfo->driver, e1000e_driver_name, - sizeof(drvinfo->driver) - 1); + strlcpy(drvinfo->driver, e1000e_driver_name, + sizeof(drvinfo->driver)); strncpy(drvinfo->version, e1000e_driver_version, - sizeof(drvinfo->version) - 1); + sizeof(drvinfo->version)); /* * EEPROM image version # is reported as firmware version # for * PCI-E controllers */ - snprintf(firmware_version, sizeof(firmware_version), "%d.%d-%d", + snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), + "%d.%d-%d", (adapter->eeprom_vers & 0xF000) >> 12, (adapter->eeprom_vers & 0x0FF0) >> 4, (adapter->eeprom_vers & 0x000F)); - strncpy(drvinfo->fw_version, firmware_version, - sizeof(drvinfo->fw_version) - 1); - strncpy(drvinfo->bus_info, pci_name(adapter->pdev), - sizeof(drvinfo->bus_info) - 1); + strlcpy(drvinfo->bus_info, pci_name(adapter->pdev), + sizeof(drvinfo->bus_info)); drvinfo->regdump_len = e1000_get_regs_len(netdev); drvinfo->eedump_len = e1000_get_eeprom_len(netdev); } |