diff options
author | Rick Jones <rick.jones2@hp.com> | 2011-11-14 03:13:25 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-14 14:13:31 -0500 |
commit | 612a94d6f24eb2427eabf554392080302da664dd (patch) | |
tree | 00202ffa2c3a59b6f3e59e906e7b6a14375f88b6 /drivers/net/ethernet/intel/e1000e/ethtool.c | |
parent | e52fcb2462ac484e6dd6e68869536609f0216938 (diff) |
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/ethtool.c')
-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, | |||
579 | struct ethtool_drvinfo *drvinfo) | 579 | struct ethtool_drvinfo *drvinfo) |
580 | { | 580 | { |
581 | struct e1000_adapter *adapter = netdev_priv(netdev); | 581 | struct e1000_adapter *adapter = netdev_priv(netdev); |
582 | char firmware_version[32]; | ||
583 | 582 | ||
584 | strncpy(drvinfo->driver, e1000e_driver_name, | 583 | strlcpy(drvinfo->driver, e1000e_driver_name, |
585 | sizeof(drvinfo->driver) - 1); | 584 | sizeof(drvinfo->driver)); |
586 | strncpy(drvinfo->version, e1000e_driver_version, | 585 | strncpy(drvinfo->version, e1000e_driver_version, |
587 | sizeof(drvinfo->version) - 1); | 586 | sizeof(drvinfo->version)); |
588 | 587 | ||
589 | /* | 588 | /* |
590 | * EEPROM image version # is reported as firmware version # for | 589 | * EEPROM image version # is reported as firmware version # for |
591 | * PCI-E controllers | 590 | * PCI-E controllers |
592 | */ | 591 | */ |
593 | snprintf(firmware_version, sizeof(firmware_version), "%d.%d-%d", | 592 | snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), |
593 | "%d.%d-%d", | ||
594 | (adapter->eeprom_vers & 0xF000) >> 12, | 594 | (adapter->eeprom_vers & 0xF000) >> 12, |
595 | (adapter->eeprom_vers & 0x0FF0) >> 4, | 595 | (adapter->eeprom_vers & 0x0FF0) >> 4, |
596 | (adapter->eeprom_vers & 0x000F)); | 596 | (adapter->eeprom_vers & 0x000F)); |
597 | 597 | ||
598 | strncpy(drvinfo->fw_version, firmware_version, | 598 | strlcpy(drvinfo->bus_info, pci_name(adapter->pdev), |
599 | sizeof(drvinfo->fw_version) - 1); | 599 | sizeof(drvinfo->bus_info)); |
600 | strncpy(drvinfo->bus_info, pci_name(adapter->pdev), | ||
601 | sizeof(drvinfo->bus_info) - 1); | ||
602 | drvinfo->regdump_len = e1000_get_regs_len(netdev); | 600 | drvinfo->regdump_len = e1000_get_regs_len(netdev); |
603 | drvinfo->eedump_len = e1000_get_eeprom_len(netdev); | 601 | drvinfo->eedump_len = e1000_get_eeprom_len(netdev); |
604 | } | 602 | } |