]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/tehuti.c
[MTD] [MAPS] fix platform driver hotplug/coldplug
[linux-2.6-omap-h63xx.git] / drivers / net / tehuti.c
index 4e1b84e6d66ab308330184a034ba7f52d82fb91a..17585e5eed5379c2299f85f92a3956768850161e 100644 (file)
@@ -621,7 +621,7 @@ err:
 static void __init bdx_firmware_endianess(void)
 {
        int i;
-       for (i = 0; i < sizeof(s_firmLoad) / sizeof(u32); i++)
+       for (i = 0; i < ARRAY_SIZE(s_firmLoad); i++)
                s_firmLoad[i] = CPU_CHIP_SWAP32(s_firmLoad[i]);
 }
 
@@ -2168,14 +2168,13 @@ bdx_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
 {
        struct bdx_priv *priv = netdev->priv;
 
-       strncat(drvinfo->driver, BDX_DRV_NAME, sizeof(drvinfo->driver));
-       strncat(drvinfo->version, BDX_DRV_VERSION, sizeof(drvinfo->version));
-       strncat(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version));
-       strncat(drvinfo->bus_info, pci_name(priv->pdev),
+       strlcat(drvinfo->driver, BDX_DRV_NAME, sizeof(drvinfo->driver));
+       strlcat(drvinfo->version, BDX_DRV_VERSION, sizeof(drvinfo->version));
+       strlcat(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version));
+       strlcat(drvinfo->bus_info, pci_name(priv->pdev),
                sizeof(drvinfo->bus_info));
 
-       drvinfo->n_stats = ((priv->stats_flag) ?
-                           (sizeof(bdx_stat_names) / ETH_GSTRING_LEN) : 0);
+       drvinfo->n_stats = ((priv->stats_flag) ? ARRAY_SIZE(bdx_stat_names) : 0);
        drvinfo->testinfo_len = 0;
        drvinfo->regdump_len = 0;
        drvinfo->eedump_len = 0;
@@ -2375,10 +2374,9 @@ static void bdx_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
 static int bdx_get_stats_count(struct net_device *netdev)
 {
        struct bdx_priv *priv = netdev->priv;
-       BDX_ASSERT(sizeof(bdx_stat_names) / ETH_GSTRING_LEN
+       BDX_ASSERT(ARRAY_SIZE(bdx_stat_names)
                   != sizeof(struct bdx_stats) / sizeof(u64));
-       return ((priv->stats_flag) ? (sizeof(bdx_stat_names) / ETH_GSTRING_LEN)
-               : 0);
+       return ((priv->stats_flag) ? ARRAY_SIZE(bdx_stat_names) : 0);
 }
 
 /*