]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
i2c: designware: Get rid of redundant 'else'
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 25 Sep 2024 12:44:20 +0000 (15:44 +0300)
committerAndi Shyti <andi.shyti@kernel.org>
Wed, 13 Nov 2024 22:29:47 +0000 (23:29 +0100)
In the snippets like the following

if (...)
return / goto / break / continue ...;
else
...

the 'else' is redundant. Get rid of it.

Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Tested-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
drivers/i2c/busses/i2c-designware-common.c

index 9d88b4fa03e4235327d96f8ce4da1588715833d2..f9889861357d5eb1938f98a6d51bdfecb54dbb7e 100644 (file)
@@ -678,10 +678,10 @@ int i2c_dw_handle_tx_abort(struct dw_i2c_dev *dev)
 
        if (abort_source & DW_IC_TX_ARB_LOST)
                return -EAGAIN;
-       else if (abort_source & DW_IC_TX_ABRT_GCALL_READ)
+       if (abort_source & DW_IC_TX_ABRT_GCALL_READ)
                return -EINVAL; /* wrong msgs[] data */
-       else
-               return -EIO;
+
+       return -EIO;
 }
 
 int i2c_dw_set_fifo_size(struct dw_i2c_dev *dev)