diff options
| author | Jiri Pirko <jiri@resnulli.us> | 2013-01-05 19:44:26 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2013-01-07 00:06:31 -0500 |
| commit | 7826d43f2db45c9305a6e0ba165650e1a203f517 (patch) | |
| tree | a8659c995a37f58db809da9537aafac178431f31 /drivers/net/ethernet/faraday | |
| parent | 2afb9b533423a9b97f84181e773cf9361d98fed6 (diff) | |
ethtool: fix drvinfo strings set in drivers
Use strlcpy where possible to ensure the string is \0 terminated.
Use always sizeof(string) instead of 32, ETHTOOL_BUSINFO_LEN
and custom defines.
Use snprintf instead of sprint.
Remove unnecessary inits of ->fw_version
Remove unnecessary inits of drvinfo struct.
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/faraday')
| -rw-r--r-- | drivers/net/ethernet/faraday/ftgmac100.c | 6 | ||||
| -rw-r--r-- | drivers/net/ethernet/faraday/ftmac100.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index 74d749e29aab..96454b5fca63 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c | |||
| @@ -955,9 +955,9 @@ static int ftgmac100_mdiobus_reset(struct mii_bus *bus) | |||
| 955 | static void ftgmac100_get_drvinfo(struct net_device *netdev, | 955 | static void ftgmac100_get_drvinfo(struct net_device *netdev, |
| 956 | struct ethtool_drvinfo *info) | 956 | struct ethtool_drvinfo *info) |
| 957 | { | 957 | { |
| 958 | strcpy(info->driver, DRV_NAME); | 958 | strlcpy(info->driver, DRV_NAME, sizeof(info->driver)); |
| 959 | strcpy(info->version, DRV_VERSION); | 959 | strlcpy(info->version, DRV_VERSION, sizeof(info->version)); |
| 960 | strcpy(info->bus_info, dev_name(&netdev->dev)); | 960 | strlcpy(info->bus_info, dev_name(&netdev->dev), sizeof(info->bus_info)); |
| 961 | } | 961 | } |
| 962 | 962 | ||
| 963 | static int ftgmac100_get_settings(struct net_device *netdev, | 963 | static int ftgmac100_get_settings(struct net_device *netdev, |
diff --git a/drivers/net/ethernet/faraday/ftmac100.c b/drivers/net/ethernet/faraday/ftmac100.c index b901a01e3fa5..b5ea8fbd8a76 100644 --- a/drivers/net/ethernet/faraday/ftmac100.c +++ b/drivers/net/ethernet/faraday/ftmac100.c | |||
| @@ -820,9 +820,9 @@ static void ftmac100_mdio_write(struct net_device *netdev, int phy_id, int reg, | |||
| 820 | static void ftmac100_get_drvinfo(struct net_device *netdev, | 820 | static void ftmac100_get_drvinfo(struct net_device *netdev, |
| 821 | struct ethtool_drvinfo *info) | 821 | struct ethtool_drvinfo *info) |
| 822 | { | 822 | { |
| 823 | strcpy(info->driver, DRV_NAME); | 823 | strlcpy(info->driver, DRV_NAME, sizeof(info->driver)); |
| 824 | strcpy(info->version, DRV_VERSION); | 824 | strlcpy(info->version, DRV_VERSION, sizeof(info->version)); |
| 825 | strcpy(info->bus_info, dev_name(&netdev->dev)); | 825 | strlcpy(info->bus_info, dev_name(&netdev->dev), sizeof(info->bus_info)); |
| 826 | } | 826 | } |
| 827 | 827 | ||
| 828 | static int ftmac100_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd) | 828 | static int ftmac100_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd) |
