gianfar: correct filer table writing
authorJakub Kicinski <kubakici@wp.pl>
Wed, 12 Aug 2015 00:41:55 +0000 (02:41 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Aug 2015 21:47:05 +0000 (14:47 -0700)
MAX_FILER_IDX is the last usable index.  Using less-than
will already guarantee that one entry for catch-all rule
will be left, no need to subtract 1 here.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/gianfar_ethtool.c

index 3c0a8f825b630148c29b4cda6ca46b9797a668be..4a710f3eb5ebc96318a1f0a2f1c43f8d5a8a2884 100644 (file)
@@ -1583,11 +1583,10 @@ static int gfar_write_filer_table(struct gfar_private *priv,
                return -EBUSY;
 
        /* Fill regular entries */
-       for (; i < MAX_FILER_IDX - 1 && (tab->fe[i].ctrl | tab->fe[i].prop);
-            i++)
+       for (; i < MAX_FILER_IDX && (tab->fe[i].ctrl | tab->fe[i].prop); i++)
                gfar_write_filer(priv, i, tab->fe[i].ctrl, tab->fe[i].prop);
        /* Fill the rest with fall-troughs */
-       for (; i < MAX_FILER_IDX - 1; i++)
+       for (; i < MAX_FILER_IDX; i++)
                gfar_write_filer(priv, i, 0x60, 0xFFFFFFFF);
        /* Last entry must be default accept
         * because that's what people expect