bnx2x: use the right constant
authorJulia Lawall <Julia.Lawall@lip6.fr>
Wed, 6 Jun 2018 13:03:22 +0000 (15:03 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Jun 2018 18:01:03 +0000 (14:01 -0400)
Nearby code that also tests port suggests that the P0 constant should be
used when port is zero.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e,e1;
@@

* e ? e1 : e1
// </smpl>

Fixes: 6c3218c6f7e5 ("bnx2x: Adjust ETS to 578xx")
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c

index 7dd83d0ef0a0be93e63576d1ba1c5c9f30cdb63f..22243c480a05341238850e71b9bd196bc705a064 100644 (file)
@@ -588,7 +588,7 @@ static void bnx2x_ets_e3b0_nig_disabled(const struct link_params *params,
         * slots for the highest priority.
         */
        REG_WR(bp, (port) ? NIG_REG_P1_TX_ARB_NUM_STRICT_ARB_SLOTS :
-                  NIG_REG_P1_TX_ARB_NUM_STRICT_ARB_SLOTS, 0x100);
+                  NIG_REG_P0_TX_ARB_NUM_STRICT_ARB_SLOTS, 0x100);
        /* Mapping between the CREDIT_WEIGHT registers and actual client
         * numbers
         */