net: dsa: mv88e6xxx: Fix unused variable warning by using variable
authorAndrew Lunn <andrew@lunn.ch>
Mon, 21 Nov 2016 22:26:56 +0000 (23:26 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 22 Nov 2016 14:55:30 +0000 (09:55 -0500)
_mv88e6xxx_stats_wait() did not check the return value from
 mv88e6xxx_g1_read(), so the compiler complained about set but unused
 err.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/chip.c

index 062b9128a58d772ecc1b72daeaca2a73e89af570..c0152125680f05bee59628a1a1bffd1d763b8bbe 100644 (file)
@@ -787,6 +787,9 @@ static int _mv88e6xxx_stats_wait(struct mv88e6xxx_chip *chip)
 
        for (i = 0; i < 10; i++) {
                err = mv88e6xxx_g1_read(chip, GLOBAL_STATS_OP, &val);
+               if (err)
+                       return err;
+
                if ((val & GLOBAL_STATS_OP_BUSY) == 0)
                        return 0;
        }