i2c: dln2: Simplify return flow for dln2_i2c_enable
authorOctavian Purdila <octavian.purdila@intel.com>
Tue, 18 Nov 2014 12:57:58 +0000 (14:57 +0200)
committerLee Jones <lee.jones@linaro.org>
Wed, 19 Nov 2014 17:12:37 +0000 (17:12 +0000)
This fixes the following kbuild test robot warning:

>> drivers/i2c/busses/i2c-dln2.c:70:1-4: WARNING: end returns can be simplified if negative or 0 value

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/i2c/busses/i2c-dln2.c

index 010a5fa8c8836f4083c4ef078f2c45407e61c4db..b3fb86af4cbb14d0cf75cfbc90e53b53382eab9b 100644 (file)
@@ -54,7 +54,6 @@ struct dln2_i2c {
 
 static int dln2_i2c_enable(struct dln2_i2c *dln2, bool enable)
 {
-       int ret;
        u16 cmd;
        struct {
                u8 port;
@@ -67,11 +66,7 @@ static int dln2_i2c_enable(struct dln2_i2c *dln2, bool enable)
        else
                cmd = DLN2_I2C_DISABLE;
 
-       ret = dln2_transfer_tx(dln2->pdev, cmd, &tx, sizeof(tx));
-       if (ret < 0)
-               return ret;
-
-       return 0;
+       return dln2_transfer_tx(dln2->pdev, cmd, &tx, sizeof(tx));
 }
 
 static int dln2_i2c_write(struct dln2_i2c *dln2, u8 addr,