ethernet: clean the coverity errors of eth module
authorqi duan <qi.duan@amlogic.com>
Thu, 23 Aug 2018 10:00:35 +0000 (18:00 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Thu, 23 Aug 2018 12:10:34 +0000 (05:10 -0700)
PD#166793: code defects in eth part

Change-Id: I5e9a4bc9ff3c89a2fff8fa000d2c33dc87f2492c
Signed-off-by: qi duan <qi.duan@amlogic.com>
drivers/amlogic/ethernet/phy/amlogic.c
drivers/amlogic/ethernet/phy/phy_debug.c

index ff88ee7..00f4152 100644 (file)
@@ -178,7 +178,7 @@ static int internal_phy_read_status(struct phy_device *phydev)
                /*read internal phy reg 0x1f*/
                reg31 = phy_read(phydev, 0x1f);
                /*bit 12 auto negotiation done*/
-               if (reg31 | 0x1000) {
+               if (reg31 & 0x1000) {
                        phydev->pause = 0;
                        phydev->asym_pause = 0;
                        phydev->speed = SPEED_10;
index ee7ebba..fa22fc3 100644 (file)
@@ -890,7 +890,7 @@ static ssize_t eth_cali_store(
                pr_err("Sorry ,this cpu is not support cali!\n");
                goto end;
        }
-       for (argc = 0; argc < 6; argc++) {
+       for (argc = 0; argc < 5; argc++) {
                para = strsep(&p, " ");
                if (!para)
                        break;