OSDN Git Service

fsl/fman_port: remove redundant check on port->rev_info.major
authorColin Ian King <colin.king@canonical.com>
Tue, 24 Apr 2018 11:39:45 +0000 (12:39 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Apr 2018 20:00:37 +0000 (16:00 -0400)
The check port->rev_info.major >= 6 is being performed twice, thus
the inner second check is always true and is redundant, hence it
can be removed. Detected by cppcheck.

drivers/net/ethernet/freescale/fman/fman_port.c:1394]: (warning)
Identical inner 'if' condition is always true.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fman/fman_port.c

index 6552d68..ce6e24c 100644 (file)
@@ -1391,12 +1391,10 @@ int fman_port_config(struct fman_port *port, struct fman_port_params *params)
                /* FM_WRONG_RESET_VALUES_ERRATA_FMAN_A005127 Errata
                 * workaround
                 */
-               if (port->rev_info.major >= 6) {
-                       u32 reg;
+               u32 reg;
 
-                       reg = 0x00001013;
-                       iowrite32be(reg, &port->bmi_regs->tx.fmbm_tfp);
-               }
+               reg = 0x00001013;
+               iowrite32be(reg, &port->bmi_regs->tx.fmbm_tfp);
        }
 
        return 0;