OSDN Git Service

staging: rtl8723bs: core: rtw_efuse.c: Compress two lines into one line
authorPayal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
Sat, 30 Mar 2019 14:31:26 +0000 (20:01 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Mar 2019 18:58:20 +0000 (19:58 +0100)
Challenge suggested by coccinelle.
Return value directly without saving it in a variable and remove that
variable.

Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/core/rtw_efuse.c

index eea3bec..3b88481 100644 (file)
@@ -125,11 +125,8 @@ Efuse_GetCurrentSize(
        u8      efuseType,
        bool            bPseudoTest)
 {
-       u16 ret = 0;
-
-       ret = padapter->HalFunc.EfuseGetCurrentSize(padapter, efuseType, bPseudoTest);
-
-       return ret;
+       return padapter->HalFunc.EfuseGetCurrentSize(padapter, efuseType,
+                                                    bPseudoTest);
 }
 
 /*  11/16/2008 MH Add description. Get current efuse area enabled word!!. */
@@ -221,7 +218,6 @@ EFUSE_Read1Byte(
 struct adapter *Adapter,
 u16    Address)
 {
-       u8 data;
        u8 Bytetemp = {0x00};
        u8 temp = {0x00};
        u32 k = 0;
@@ -253,8 +249,7 @@ u16         Address)
                                break;
                        }
                }
-               data = rtw_read8(Adapter, EFUSE_CTRL);
-               return data;
+               return rtw_read8(Adapter, EFUSE_CTRL);
        } else
                return 0xFF;
 
@@ -378,11 +373,8 @@ Efuse_PgPacketRead(struct adapter *padapter,
                                u8      *data,
                                bool            bPseudoTest)
 {
-       int     ret = 0;
-
-       ret =  padapter->HalFunc.Efuse_PgPacketRead(padapter, offset, data, bPseudoTest);
-
-       return ret;
+       return padapter->HalFunc.Efuse_PgPacketRead(padapter, offset, data,
+                                                   bPseudoTest);
 }
 
 int
@@ -392,11 +384,8 @@ Efuse_PgPacketWrite(struct adapter *padapter,
                                u8      *data,
                                bool            bPseudoTest)
 {
-       int ret;
-
-       ret =  padapter->HalFunc.Efuse_PgPacketWrite(padapter, offset, word_en, data, bPseudoTest);
-
-       return ret;
+       return padapter->HalFunc.Efuse_PgPacketWrite(padapter, offset, word_en,
+                                                    data, bPseudoTest);
 }
 
 /*-----------------------------------------------------------------------------
@@ -447,11 +436,9 @@ Efuse_WordEnableDataWrite(struct adapter *padapter,
                                                u8 *data,
                                                bool            bPseudoTest)
 {
-       u8 ret = 0;
-
-       ret =  padapter->HalFunc.Efuse_WordEnableDataWrite(padapter, efuse_addr, word_en, data, bPseudoTest);
-
-       return ret;
+       return padapter->HalFunc.Efuse_WordEnableDataWrite(padapter, efuse_addr,
+                                                          word_en, data,
+                                                          bPseudoTest);
 }
 
 /*-----------------------------------------------------------------------------