diff options
author | Jiri Pirko <jiri@resnulli.us> | 2013-01-06 00:44:26 (GMT) |
---|---|---|
committer | Emil Medve <Emilian.Medve@Freescale.com> | 2013-03-21 07:02:37 (GMT) |
commit | c01e0e4a6ecc3bcda21c3073e78237b95dacf3bc (patch) | |
tree | 19f0b3fcbca9042790ef65492b29eaec7ea590f3 /drivers/staging/ccg | |
parent | 10824b419e25a715b7b6787dab5a46b3035dfaf5 (diff) | |
download | linux-fsl-qoriq-c01e0e4a6ecc3bcda21c3073e78237b95dacf3bc.tar.xz |
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/staging/ccg')
-rw-r--r-- | drivers/staging/ccg/u_ether.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/ccg/u_ether.c b/drivers/staging/ccg/u_ether.c index d0dabcf..fed7886 100644 --- a/drivers/staging/ccg/u_ether.c +++ b/drivers/staging/ccg/u_ether.c @@ -157,12 +157,12 @@ static int ueth_change_mtu(struct net_device *net, int new_mtu) static void eth_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *p) { - struct eth_dev *dev = netdev_priv(net); + struct eth_dev *dev = netdev_priv(net); - strlcpy(p->driver, "g_ether", sizeof p->driver); - strlcpy(p->version, UETH__VERSION, sizeof p->version); - strlcpy(p->fw_version, dev->gadget->name, sizeof p->fw_version); - strlcpy(p->bus_info, dev_name(&dev->gadget->dev), sizeof p->bus_info); + strlcpy(p->driver, "g_ether", sizeof(p->driver)); + strlcpy(p->version, UETH__VERSION, sizeof(p->version)); + strlcpy(p->fw_version, dev->gadget->name, sizeof(p->fw_version)); + strlcpy(p->bus_info, dev_name(&dev->gadget->dev), sizeof(p->bus_info)); } /* REVISIT can also support: |