aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRick Jones <rick.jones2@hp.com>2011-11-07 08:29:27 -0500
committerDavid S. Miller <davem@davemloft.net>2011-11-08 15:11:57 -0500
commit68aad78c5023b8aa82da99b47f9d8cf40e8ca453 (patch)
treec9f90903bd2e7831ea6fc5231affa3b9fc908b73 /drivers
parent34d2d89f2d7da3b72b3157e778bbf709047ded97 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/3com/3c589_cs.c7
-rw-r--r--drivers/net/ethernet/3com/3c59x.c12
-rw-r--r--drivers/net/ethernet/3com/typhoon.c16
-rw-r--r--drivers/net/ethernet/8390/ne2k-pci.c6
-rw-r--r--drivers/net/ethernet/adaptec/starfire.c6
-rw-r--r--drivers/net/ethernet/atheros/atl1e/atl1e_ethtool.c10
-rw-r--r--drivers/net/ethernet/atheros/atlx/atl2.c10
-rw-r--r--drivers/net/ethernet/broadcom/bnx2.c8
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c8
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c8
-rw-r--r--drivers/net/ethernet/brocade/bna/bnad_ethtool.c11
-rw-r--r--drivers/net/ethernet/dec/tulip/de2104x.c6
-rw-r--r--drivers/net/ethernet/dec/tulip/dmfe.c7
-rw-r--r--drivers/net/ethernet/dec/tulip/tulip_core.c6
-rw-r--r--drivers/net/ethernet/dec/tulip/uli526x.c7
-rw-r--r--drivers/net/ethernet/dec/tulip/winbond-840.c6
-rw-r--r--drivers/net/ethernet/dlink/sundance.c6
-rw-r--r--drivers/net/ethernet/dnet.c6
-rw-r--r--drivers/net/ethernet/emulex/benet/be_ethtool.c7
-rw-r--r--drivers/net/ethernet/fealnx.c6
-rw-r--r--drivers/net/ethernet/i825xx/eepro.c7
-rw-r--r--drivers/net/ethernet/marvell/mv643xx_eth.c9
-rw-r--r--drivers/net/ethernet/marvell/skge.c9
-rw-r--r--drivers/net/ethernet/marvell/sky2.c9
-rw-r--r--drivers/net/ethernet/natsemi/natsemi.c6
-rw-r--r--drivers/net/ethernet/natsemi/ns83820.c6
-rw-r--r--drivers/net/ethernet/neterion/s2io.c8
-rw-r--r--drivers/net/ethernet/nvidia/forcedeth.c6
-rw-r--r--drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c12
-rw-r--r--drivers/net/ethernet/qlogic/qla3xxx.c10
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c13
-rw-r--r--drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c11
-rw-r--r--drivers/net/ethernet/realtek/8139cp.c6
-rw-r--r--drivers/net/ethernet/realtek/8139too.c6
-rw-r--r--drivers/net/ethernet/realtek/r8169.c10
-rw-r--r--drivers/net/ethernet/smsc/epic100.c6
-rw-r--r--drivers/net/ethernet/smsc/smsc9420.c7
-rw-r--r--drivers/net/ethernet/xircom/xirc2ps_cs.c2
38 files changed, 166 insertions, 136 deletions
diff --git a/drivers/net/ethernet/3com/3c589_cs.c b/drivers/net/ethernet/3com/3c589_cs.c
index 972f80ecc510..da410f036869 100644
--- a/drivers/net/ethernet/3com/3c589_cs.c
+++ b/drivers/net/ethernet/3com/3c589_cs.c
@@ -468,9 +468,10 @@ static void tc589_reset(struct net_device *dev)
468static void netdev_get_drvinfo(struct net_device *dev, 468static void netdev_get_drvinfo(struct net_device *dev,
469 struct ethtool_drvinfo *info) 469 struct ethtool_drvinfo *info)
470{ 470{
471 strcpy(info->driver, DRV_NAME); 471 strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
472 strcpy(info->version, DRV_VERSION); 472 strlcpy(info->version, DRV_VERSION, sizeof(info->version));
473 sprintf(info->bus_info, "PCMCIA 0x%lx", dev->base_addr); 473 snprintf(info->bus_info, sizeof(info->bus_info),
474 "PCMCIA 0x%lx", dev->base_addr);
474} 475}
475 476
476static const struct ethtool_ops netdev_ethtool_ops = { 477static const struct ethtool_ops netdev_ethtool_ops = {
diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c
index b42c06baba89..8153a3e0a1a4 100644
--- a/drivers/net/ethernet/3com/3c59x.c
+++ b/drivers/net/ethernet/3com/3c59x.c
@@ -2929,15 +2929,17 @@ static void vortex_get_drvinfo(struct net_device *dev,
2929{ 2929{
2930 struct vortex_private *vp = netdev_priv(dev); 2930 struct vortex_private *vp = netdev_priv(dev);
2931 2931
2932 strcpy(info->driver, DRV_NAME); 2932 strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
2933 if (VORTEX_PCI(vp)) { 2933 if (VORTEX_PCI(vp)) {
2934 strcpy(info->bus_info, pci_name(VORTEX_PCI(vp))); 2934 strlcpy(info->bus_info, pci_name(VORTEX_PCI(vp)),
2935 sizeof(info->bus_info));
2935 } else { 2936 } else {
2936 if (VORTEX_EISA(vp)) 2937 if (VORTEX_EISA(vp))
2937 strcpy(info->bus_info, dev_name(vp->gendev)); 2938 strlcpy(info->bus_info, dev_name(vp->gendev),
2939 sizeof(info->bus_info));
2938 else 2940 else
2939 sprintf(info->bus_info, "EISA 0x%lx %d", 2941 snprintf(info->bus_info, sizeof(info->bus_info),
2940 dev->base_addr, dev->irq); 2942 "EISA 0x%lx %d", dev->base_addr, dev->irq);
2941 } 2943 }
2942} 2944}
2943 2945
diff --git a/drivers/net/ethernet/3com/typhoon.c b/drivers/net/ethernet/3com/typhoon.c
index 20ea07508ac7..6d6bc754b1a8 100644
--- a/drivers/net/ethernet/3com/typhoon.c
+++ b/drivers/net/ethernet/3com/typhoon.c
@@ -988,21 +988,23 @@ typhoon_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
988 988
989 smp_rmb(); 989 smp_rmb();
990 if(tp->card_state == Sleeping) { 990 if(tp->card_state == Sleeping) {
991 strcpy(info->fw_version, "Sleep image"); 991 strlcpy(info->fw_version, "Sleep image",
992 sizeof(info->fw_version));
992 } else { 993 } else {
993 INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_VERSIONS); 994 INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_VERSIONS);
994 if(typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp) < 0) { 995 if(typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp) < 0) {
995 strcpy(info->fw_version, "Unknown runtime"); 996 strlcpy(info->fw_version, "Unknown runtime",
997 sizeof(info->fw_version));
996 } else { 998 } else {
997 u32 sleep_ver = le32_to_cpu(xp_resp[0].parm2); 999 u32 sleep_ver = le32_to_cpu(xp_resp[0].parm2);
998 snprintf(info->fw_version, 32, "%02x.%03x.%03x", 1000 snprintf(info->fw_version, sizeof(info->fw_version),
999 sleep_ver >> 24, (sleep_ver >> 12) & 0xfff, 1001 "%02x.%03x.%03x", sleep_ver >> 24,
1000 sleep_ver & 0xfff); 1002 (sleep_ver >> 12) & 0xfff, sleep_ver & 0xfff);
1001 } 1003 }
1002 } 1004 }
1003 1005
1004 strcpy(info->driver, KBUILD_MODNAME); 1006 strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
1005 strcpy(info->bus_info, pci_name(pci_dev)); 1007 strlcpy(info->bus_info, pci_name(pci_dev), sizeof(info->bus_info));
1006} 1008}
1007 1009
1008static int 1010static int
diff --git a/drivers/net/ethernet/8390/ne2k-pci.c b/drivers/net/ethernet/8390/ne2k-pci.c
index 39923425ba25..3fab04a0034a 100644
--- a/drivers/net/ethernet/8390/ne2k-pci.c
+++ b/drivers/net/ethernet/8390/ne2k-pci.c
@@ -639,9 +639,9 @@ static void ne2k_pci_get_drvinfo(struct net_device *dev,
639 struct ei_device *ei = netdev_priv(dev); 639 struct ei_device *ei = netdev_priv(dev);
640 struct pci_dev *pci_dev = (struct pci_dev *) ei->priv; 640 struct pci_dev *pci_dev = (struct pci_dev *) ei->priv;
641 641
642 strcpy(info->driver, DRV_NAME); 642 strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
643 strcpy(info->version, DRV_VERSION); 643 strlcpy(info->version, DRV_VERSION, sizeof(info->version));
644 strcpy(info->bus_info, pci_name(pci_dev)); 644 strlcpy(info->bus_info, pci_name(pci_dev), sizeof(info->bus_info));
645} 645}
646 646
647static const struct ethtool_ops ne2k_pci_ethtool_ops = { 647static const struct ethtool_ops ne2k_pci_ethtool_ops = {
diff --git a/drivers/net/ethernet/adaptec/starfire.c b/drivers/net/ethernet/adaptec/starfire.c
index 6d9f6911000f..a446e251908b 100644
--- a/drivers/net/ethernet/adaptec/starfire.c
+++ b/drivers/net/ethernet/adaptec/starfire.c
@@ -1842,9 +1842,9 @@ static int check_if_running(struct net_device *dev)
1842static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) 1842static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
1843{ 1843{
1844 struct netdev_private *np = netdev_priv(dev); 1844 struct netdev_private *np = netdev_priv(dev);
1845 strcpy(info->driver, DRV_NAME); 1845 strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
1846 strcpy(info->version, DRV_VERSION); 1846 strlcpy(info->version, DRV_VERSION, sizeof(info->version));
1847 strcpy(info->bus_info, pci_name(np->pci_dev)); 1847 strlcpy(info->bus_info, pci_name(np->pci_dev), sizeof(info->bus_info));
1848} 1848}
1849 1849
1850static int get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) 1850static int get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_ethtool.c b/drivers