staging: silicom : remove assignment in if condition
authorHimangi Saraogi <himangi774@gmail.com>
Tue, 4 Mar 2014 21:21:09 +0000 (02:51 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2014 21:23:12 +0000 (13:23 -0800)
This patch removes the assignment in if conditions to do away with the
checkpatch warning :'do not use assignment in if condition'.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/silicom/bpctl_mod.c

index f4aea92133c83190b6909b5264c6847ca57c39b5..6b9365b28e8ac3febbf7605e66f7777d104d4b8f 100644 (file)
@@ -2306,11 +2306,10 @@ static int set_tx(struct bpctl_dev *pbpctl_dev, int tx_state)
                if (PEG5_IF_SERIES(pbpctl_dev->subdevice)) {
                        if (tx_state) {
                                uint16_t mii_reg;
-                               if (!
-                                   (ret =
-                                    bp75_read_phy_reg(pbpctl_dev,
-                                                      BPCTLI_PHY_CONTROL,
-                                                      &mii_reg))) {
+                               ret = bp75_read_phy_reg(pbpctl_dev,
+                                             BPCTLI_PHY_CONTROL,
+                                             &mii_reg);
+                               if (!ret) {
                                        if (mii_reg & BPCTLI_MII_CR_POWER_DOWN) {
                                                ret =
                                                    bp75_write_phy_reg
@@ -2322,17 +2321,15 @@ static int set_tx(struct bpctl_dev *pbpctl_dev, int tx_state)
                                }
                        } else {
                                uint16_t mii_reg;
-                               if (!
-                                   (ret =
-                                    bp75_read_phy_reg(pbpctl_dev,
-                                                      BPCTLI_PHY_CONTROL,
-                                                      &mii_reg))) {
+                               ret = bp75_read_phy_reg(pbpctl_dev,
+                                             BPCTLI_PHY_CONTROL,
+                                             &mii_reg);
+                               if (!ret) {
 
                                        mii_reg |= BPCTLI_MII_CR_POWER_DOWN;
-                                       ret =
-                                           bp75_write_phy_reg(pbpctl_dev,
-                                                              BPCTLI_PHY_CONTROL,
-                                                              mii_reg);
+                                       ret = bp75_write_phy_reg(pbpctl_dev,
+                                                      BPCTLI_PHY_CONTROL,
+                                                      mii_reg);
                                }
                        }