Commit 42c6cdb3 authored by navin patidar's avatar navin patidar Committed by Greg Kroah-Hartman

staging: rtl8188eu: Use round_up() instead of RND4()

Signed-off-by: default avatarnavin patidar <navin.patidar@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fdc95f5f
...@@ -189,7 +189,7 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe) ...@@ -189,7 +189,7 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe)
arcfour_encrypt(&mycontext, payload+length, crc, 4); arcfour_encrypt(&mycontext, payload+length, crc, 4);
pframe += pxmitpriv->frag_len; pframe += pxmitpriv->frag_len;
pframe = (u8 *)RND4((size_t)(pframe)); pframe = (u8 *) round_up((size_t)(pframe), 4);
} }
} }
} }
...@@ -628,7 +628,7 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe) ...@@ -628,7 +628,7 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
arcfour_encrypt(&mycontext, payload+length, crc, 4); arcfour_encrypt(&mycontext, payload+length, crc, 4);
pframe += pxmitpriv->frag_len; pframe += pxmitpriv->frag_len;
pframe = (u8 *)RND4((size_t)(pframe)); pframe = (u8 *) round_up((size_t)(pframe), 4);
} }
} }
} else { } else {
...@@ -1242,7 +1242,7 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe) ...@@ -1242,7 +1242,7 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe)
aes_cipher(prwskey, pattrib->hdrlen, pframe, length); aes_cipher(prwskey, pattrib->hdrlen, pframe, length);
pframe += pxmitpriv->frag_len; pframe += pxmitpriv->frag_len;
pframe = (u8 *)RND4((size_t)(pframe)); pframe = (u8 *) round_up((size_t)(pframe), 8);
} }
} }
} else{ } else{
......
...@@ -692,7 +692,7 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr ...@@ -692,7 +692,7 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr
payload = pframe; payload = pframe;
for (curfragnum = 0; curfragnum < pattrib->nr_frags; curfragnum++) { for (curfragnum = 0; curfragnum < pattrib->nr_frags; curfragnum++) {
payload = (u8 *)RND4((size_t)(payload)); payload = (u8 *) round_up((size_t)(payload), 4);
RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_,
("=== curfragnum=%d, pframe = 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x,!!!\n", ("=== curfragnum=%d, pframe = 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x,!!!\n",
curfragnum, *payload, *(payload+1), curfragnum, *payload, *(payload+1),
...@@ -1099,7 +1099,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct ...@@ -1099,7 +1099,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
addr = (size_t)(pframe); addr = (size_t)(pframe);
mem_start = (unsigned char *)RND4(addr) + hw_hdr_offset; mem_start = (unsigned char *) round_up(addr, 4) + hw_hdr_offset;
memcpy(mem_start, pbuf_start + hw_hdr_offset, pattrib->hdrlen); memcpy(mem_start, pbuf_start + hw_hdr_offset, pattrib->hdrlen);
} }
......
...@@ -401,7 +401,7 @@ static s32 rtw_dump_xframe(struct adapter *adapt, struct xmit_frame *pxmitframe) ...@@ -401,7 +401,7 @@ static s32 rtw_dump_xframe(struct adapter *adapt, struct xmit_frame *pxmitframe)
mem_addr += w_sz; mem_addr += w_sz;
mem_addr = (u8 *)RND4(((size_t)(mem_addr))); mem_addr = (u8 *) round_up((size_t)mem_addr, 4);
} }
rtw_free_xmitframe(pxmitpriv, pxmitframe); rtw_free_xmitframe(pxmitpriv, pxmitframe);
......
...@@ -175,8 +175,6 @@ static inline void flush_signals_thread(void) ...@@ -175,8 +175,6 @@ static inline void flush_signals_thread(void)
flush_signals(current); flush_signals(current);
} }
#define RND4(x) (((x >> 2) + (((x & 3) == 0) ? 0 : 1)) << 2)
struct rtw_netdev_priv_indicator { struct rtw_netdev_priv_indicator {
void *priv; void *priv;
u32 sizeof_priv; u32 sizeof_priv;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment