]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: mvpp2: fix hardcoded number of rx queues
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Thu, 12 Jul 2018 11:54:15 +0000 (13:54 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Jul 2018 00:30:48 +0000 (17:30 -0700)
There's a dedicated #define that indicates the number of rx queues per
port per cpu, this commit removes a harcoded use of that value

This doesn't fix any runtime bugs since the harcoded value matches the
expected value.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c

index 75aa0dece8ae2f46855d1684b04e569fe2c14fcc..4bc0b893b02694fb2877866181507cbf8f0dc0da 100644 (file)
@@ -3993,8 +3993,8 @@ static int mvpp2_port_init(struct mvpp2_port *port)
            MVPP2_MAX_PORTS * priv->max_port_rxqs)
                return -EINVAL;
 
-       if (port->nrxqs % 4 || (port->nrxqs > priv->max_port_rxqs) ||
-           (port->ntxqs > MVPP2_MAX_TXQ))
+       if (port->nrxqs % MVPP2_DEFAULT_RXQ ||
+           port->nrxqs > priv->max_port_rxqs || port->ntxqs > MVPP2_MAX_TXQ)
                return -EINVAL;
 
        /* Disable port */