staging: rtl8723au: Eliminate RTW_STATUS_CODE23a()
authorJes Sorensen <Jes.Sorensen@redhat.com>
Fri, 9 May 2014 13:04:00 +0000 (15:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 May 2014 20:12:00 +0000 (13:12 -0700)
Inline the parsing of status codes. Long term we should pass back the
proper status codes and get rid of the ugly _FAIL/_SUCCESS mess. This
is one small step in that direction.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_io.c
drivers/staging/rtl8723au/include/osdep_service.h
drivers/staging/rtl8723au/os_dep/osdep_service.c

index 20680e0..cf6d30f 100644 (file)
@@ -72,7 +72,10 @@ int _rtw_write823a(struct rtw_adapter *adapter, u32 addr, u8 val)
 
        ret = io_ops->_write8(adapter, addr, val);
 
-       return RTW_STATUS_CODE23a(ret);
+       if (ret < 0)
+               return _FAIL;
+       else
+               return _SUCCESS;
 }
 
 int _rtw_write1623a(struct rtw_adapter *adapter, u32 addr, u16 val)
@@ -82,7 +85,10 @@ int _rtw_write1623a(struct rtw_adapter *adapter, u32 addr, u16 val)
 
        ret = io_ops->_write16(adapter, addr, val);
 
-       return RTW_STATUS_CODE23a(ret);
+       if (ret < 0)
+               return _FAIL;
+       else
+               return _SUCCESS;
 }
 
 int _rtw_write3223a(struct rtw_adapter *adapter, u32 addr, u32 val)
@@ -92,7 +98,10 @@ int _rtw_write3223a(struct rtw_adapter *adapter, u32 addr, u32 val)
 
        ret = io_ops->_write32(adapter, addr, val);
 
-       return RTW_STATUS_CODE23a(ret);
+       if (ret < 0)
+               return _FAIL;
+       else
+               return _SUCCESS;
 }
 
 int _rtw_writeN23a(struct rtw_adapter *adapter, u32 addr , u32 length , u8 *pdata)
@@ -102,7 +111,10 @@ int _rtw_writeN23a(struct rtw_adapter *adapter, u32 addr , u32 length , u8 *pdat
 
        ret = io_ops->_writeN(adapter, addr, length, pdata);
 
-       return RTW_STATUS_CODE23a(ret);
+       if (ret < 0)
+               return _FAIL;
+       else
+               return _SUCCESS;
 }
 void _rtw_read_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
 {
index 6992797..c4711a6 100644 (file)
@@ -126,8 +126,6 @@ static inline u32 CHKBIT(u32 x)
 #define BIT35  0x0800000000
 #define BIT36  0x1000000000
 
-int RTW_STATUS_CODE23a(int error_code);
-
 extern unsigned char REALTEK_96B_IE23A[];
 extern unsigned char MCS_rate_2R23A[16];
 extern unsigned char WPA_TKIP_CIPHER23A[4];
index 57c7bf8..f5f385b 100644 (file)
 #include <drv_types.h>
 #include <recv_osdep.h>
 
-/*
-* Translate the OS dependent @param error_code to OS independent RTW_STATUS_CODE23a
-* @return: one of RTW_STATUS_CODE23a
-*/
-inline int RTW_STATUS_CODE23a(int error_code)
-{
-       if (error_code >= 0)
-               return _SUCCESS;
-       return _FAIL;
-}
-
 void _rtw_init_queue23a(struct rtw_queue *pqueue)
 {
        INIT_LIST_HEAD(&pqueue->queue);