staging: rtl8723au: Move data byte-swap closer to register access
authorLarry Finger <Larry.Finger@lwfinger.net>
Fri, 9 May 2014 13:03:17 +0000 (15:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 May 2014 20:11:56 +0000 (13:11 -0700)
This makes sparse happy

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
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/hal/usb_ops_linux.c

index 01022113950af9081d9341c8220b6e085dd7f330..20680e0ce9e0a0b8e75c8d5726f0d5ff0a4e5c3b 100644 (file)
@@ -53,22 +53,16 @@ u8 _rtw_read823a(struct rtw_adapter *adapter, u32 addr)
 
 u16 _rtw_read1623a(struct rtw_adapter *adapter, u32 addr)
 {
-       u16 r_val;
        struct _io_ops *io_ops = &adapter->io_ops;
 
-       r_val = io_ops->_read16(adapter, addr);
-
-       return le16_to_cpu(r_val);
+       return io_ops->_read16(adapter, addr);
 }
 
 u32 _rtw_read3223a(struct rtw_adapter *adapter, u32 addr)
 {
-       u32 r_val;
        struct _io_ops *io_ops = &adapter->io_ops;
 
-       r_val = io_ops->_read32(adapter, addr);
-
-       return le32_to_cpu(r_val);
+       return io_ops->_read32(adapter, addr);
 }
 
 int _rtw_write823a(struct rtw_adapter *adapter, u32 addr, u8 val)
@@ -86,7 +80,6 @@ int _rtw_write1623a(struct rtw_adapter *adapter, u32 addr, u16 val)
        struct _io_ops *io_ops = &adapter->io_ops;
        int ret;
 
-       val = cpu_to_le16(val);
        ret = io_ops->_write16(adapter, addr, val);
 
        return RTW_STATUS_CODE23a(ret);
@@ -97,7 +90,6 @@ int _rtw_write3223a(struct rtw_adapter *adapter, u32 addr, u32 val)
        struct _io_ops *io_ops = &adapter->io_ops;
        int ret;
 
-       val = cpu_to_le32(val);
        ret = io_ops->_write32(adapter, addr, val);
 
        return RTW_STATUS_CODE23a(ret);
index da0ef6b7e2a1719b012d78d79a8e09f687083461..870fe5dabce4bc3eec790679e0418fb4360c1392 100644 (file)
@@ -154,7 +154,7 @@ static u16 usb_read16(struct rtw_adapter *padapter, u32 addr)
        u16 wvalue;
        u16 index;
        u16 len;
-       u16 data = 0;
+       __le16 data;
 
        request = 0x05;
        requesttype = 0x01;/* read_in */
@@ -166,7 +166,7 @@ static u16 usb_read16(struct rtw_adapter *padapter, u32 addr)
        usbctrl_vendorreq(padapter, request, wvalue, index, &data,
                          len, requesttype);
 
-       return data;
+       return le16_to_cpu(data);
 }
 
 static u32 usb_read32(struct rtw_adapter *padapter, u32 addr)
@@ -176,7 +176,7 @@ static u32 usb_read32(struct rtw_adapter *padapter, u32 addr)
        u16 wvalue;
        u16 index;
        u16 len;
-       u32 data = 0;
+       __le32 data;
 
        request = 0x05;
        requesttype = 0x01;/* read_in */
@@ -188,7 +188,7 @@ static u32 usb_read32(struct rtw_adapter *padapter, u32 addr)
        usbctrl_vendorreq(padapter, request, wvalue, index, &data,
                          len, requesttype);
 
-       return data;
+       return le32_to_cpu(data);
 }
 
 static int usb_write8(struct rtw_adapter *padapter, u32 addr, u8 val)
@@ -223,7 +223,7 @@ static int usb_write16(struct rtw_adapter *padapter, u32 addr, u16 val)
        u16 wvalue;
        u16 index;
        u16 len;
-       u16 data;
+       __le16 data;
        int ret;
 
        request = 0x05;
@@ -233,7 +233,7 @@ static int usb_write16(struct rtw_adapter *padapter, u32 addr, u16 val)
        wvalue = (u16)(addr&0x0000ffff);
        len = 2;
 
-       data = val;
+       data = cpu_to_le16(val);
 
        ret = usbctrl_vendorreq(padapter, request, wvalue, index, &data,
                                len, requesttype);
@@ -247,7 +247,7 @@ static int usb_write32(struct rtw_adapter *padapter, u32 addr, u32 val)
        u16 wvalue;
        u16 index;
        u16 len;
-       u32 data;
+       __le32 data;
        int ret;
 
        request = 0x05;
@@ -256,7 +256,7 @@ static int usb_write32(struct rtw_adapter *padapter, u32 addr, u32 val)
 
        wvalue = (u16)(addr&0x0000ffff);
        len = 4;
-       data = val;
+       data = cpu_to_le32(val);
 
        ret = usbctrl_vendorreq(padapter, request, wvalue, index, &data,
                                len, requesttype);