aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorRick Jones <rick.jones2@hp.com>2011-11-15 13:40:49 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-11-17 15:44:50 -0500
commit1f80c230a7d291a10045a3cdc2efd18a4185674d (patch)
treedcf356277b35b0584196675f084ca330a9392123 /drivers/net/wireless
parent6048d76384ed531123588277fe1fd95b24067cbc (diff)
wireless: use strlcpy routine in .get_drvinfo
Convert various seemingly still compiled wireless drivers' .get_drvinfo routines to use the preferred strlcpy() routine. Signed-off-by: Rick Jones <rick.jones2@hp.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/hostap/hostap_ioctl.c4
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2100.c7
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2200.c7
-rw-r--r--drivers/net/wireless/libertas/ethtool.c7
-rw-r--r--drivers/net/wireless/prism54/islpci_dev.c4
5 files changed, 16 insertions, 13 deletions
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
index 12de46407c71..46a8c291c08a 100644
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -3871,8 +3871,8 @@ static void prism2_get_drvinfo(struct net_device *dev,
3871 iface = netdev_priv(dev); 3871 iface = netdev_priv(dev);
3872 local = iface->local; 3872 local = iface->local;
3873 3873
3874 strncpy(info->driver, "hostap", sizeof(info->driver) - 1); 3874 strlcpy(info->driver, "hostap", sizeof(info->driver));
3875 snprintf(info->fw_version, sizeof(info->fw_version) - 1, 3875 snprintf(info->fw_version, sizeof(info->fw_version),
3876 "%d.%d.%d", (local->sta_fw_ver >> 16) & 0xff, 3876 "%d.%d.%d", (local->sta_fw_ver >> 16) & 0xff,
3877 (local->sta_fw_ver >> 8) & 0xff, 3877 (local->sta_fw_ver >> 8) & 0xff,
3878 local->sta_fw_ver & 0xff); 3878 local->sta_fw_ver & 0xff);
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 127e9c63beaf..a0e5c21d3657 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -5981,8 +5981,8 @@ static void ipw_ethtool_get_drvinfo(struct net_device *dev,
5981 struct ipw2100_priv *priv = libipw_priv(dev); 5981 struct ipw2100_priv *priv = libipw_priv(dev);
5982 char fw_ver[64], ucode_ver[64]; 5982 char fw_ver[64], ucode_ver[64];
5983 5983
5984 strcpy(info->driver, DRV_NAME); 5984 strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
5985 strcpy(info->version, DRV_VERSION); 5985 strlcpy(info->version, DRV_VERSION, sizeof(info->version));
5986 5986
5987 ipw2100_get_fwversion(priv, fw_ver, sizeof(fw_ver)); 5987 ipw2100_get_fwversion(priv, fw_ver, sizeof(fw_ver));
5988 ipw2100_get_ucodeversion(priv, ucode_ver, sizeof(ucode_ver)); 5988 ipw2100_get_ucodeversion(priv, ucode_ver, sizeof(ucode_ver));
@@ -5990,7 +5990,8 @@ static void ipw_ethtool_get_drvinfo(struct net_device *dev,
5990 snprintf(info->fw_version, sizeof(info->fw_version), "%s:%d:%s", 5990 snprintf(info->fw_version, sizeof(info->fw_version), "%s:%d:%s",
5991 fw_ver, priv->eeprom_version, ucode_ver); 5991 fw_ver, priv->eeprom_version, ucode_ver);
5992 5992
5993 strcpy(info->bus_info, pci_name(priv->pci_dev)); 5993 strlcpy(info->bus_info, pci_name(priv->pci_dev),
5994 sizeof(info->bus_info));
5994} 5995}
5995 5996
5996static u32 ipw2100_ethtool_get_link(struct net_device *dev) 5997static u32 ipw2100_ethtool_get_link(struct net_device *dev)
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 99575884ff52..018a8deb88a8 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -10548,8 +10548,8 @@ static void ipw_ethtool_get_drvinfo(struct net_device *dev,
10548 char date[32]; 10548 char date[32];
10549 u32 len; 10549 u32 len;
10550 10550
10551 strcpy(info->driver, DRV_NAME); 10551 strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
10552 strcpy(info->version, DRV_VERSION); 10552 strlcpy(info->version, DRV_VERSION, sizeof(info->version));
10553 10553
10554 len = sizeof(vers); 10554 len = sizeof(vers);
10555 ipw_get_ordinal(p, IPW_ORD_STAT_FW_VERSION, vers, &len); 10555 ipw_get_ordinal(p, IPW_ORD_STAT_FW_VERSION, vers, &len);
@@ -10558,7 +10558,8 @@ static void ipw_ethtool_get_drvinfo(struct net_device *dev,
10558 10558
10559 snprintf(info->fw_version, sizeof(info->fw_version), "%s (%s)", 10559 snprintf(info->fw_version, sizeof(info->fw_version), "%s (%s)",
10560 vers, date); 10560 vers, date);
10561 strcpy(info->bus_info, pci_name(p->pci_dev)); 10561 strlcpy(info->bus_info, pci_name(p->pci_dev),
10562 sizeof(info->bus_info));
10562 info->eedump_len = IPW_EEPROM_IMAGE_SIZE; 10563 info->eedump_len = IPW_EEPROM_IMAGE_SIZE;
10563} 10564}
10564 10565
diff --git a/drivers/net/wireless/libertas/ethtool.c b/drivers/net/wireless/libertas/ethtool.c
index 885ddc1c4fed..f955b2d66ed6 100644
--- a/drivers/net/wireless/libertas/ethtool.c
+++ b/drivers/net/wireless/libertas/ethtool.c
@@ -13,13 +13,14 @@ static void lbs_ethtool_get_drvinfo(struct net_device *dev,
13{ 13{
14 struct lbs_private *priv = dev->ml_priv; 14 struct lbs_private *priv = dev->ml_priv;
15 15
16 snprintf(info->fw_version, 32, "%u.%u.%u.p%u", 16 snprintf(info->fw_version, sizeof(info->fw_version),
17 "%u.%u.%u.p%u",
17 priv->fwrelease >> 24 & 0xff, 18 priv->fwrelease >> 24 & 0xff,
18 priv->fwrelease >> 16 & 0xff, 19 priv->fwrelease >> 16 & 0xff,
19 priv->fwrelease >> 8 & 0xff, 20 priv->fwrelease >> 8 & 0xff,
20 priv->fwrelease & 0xff); 21 priv->fwrelease & 0xff);
21 strcpy(info->driver, "libertas"); 22 strlcpy(info->driver, "libertas", sizeof(info->driver));
22 strcpy(info->version, lbs_driver_version); 23 strlcpy(info->version, lbs_driver_version, sizeof(info->version));
23} 24}
24 25
25/* 26/*
diff --git a/drivers/net/wireless/prism54/islpci_dev.c b/drivers/net/wireless/prism54/islpci_dev.c
index 5d0f61508a2e..8a3cf4fe376f 100644
--- a/drivers/net/wireless/prism54/islpci_dev.c
+++ b/drivers/net/wireless/prism54/islpci_dev.c
@@ -793,8 +793,8 @@ islpci_set_multicast_list(struct net_device *dev)
793static void islpci_ethtool_get_drvinfo(struct net_device *dev, 793static void islpci_ethtool_get_drvinfo(struct net_device *dev,
794 struct ethtool_drvinfo *info) 794 struct ethtool_drvinfo *info)
795{ 795{
796 strcpy(info->driver, DRV_NAME); 796 strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
797 strcpy(info->version, DRV_VERSION); 797 strlcpy(info->version, DRV_VERSION, sizeof(info->version));
798} 798}
799 799
800static const struct ethtool_ops islpci_ethtool_ops = { 800static const struct ethtool_ops islpci_ethtool_ops = {