From: navin patidar Date: Sun, 22 Jun 2014 08:51:41 +0000 (+0530) Subject: staging: rtl8188eu: Use round_up() instead of _RND4() X-Git-Tag: firefly_0821_release~176^2~3491^2~1398 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=eab5d5438a626b33d1ea6d3ce07303bee0f27f76;p=firefly-linux-kernel-4.4.55.git staging: rtl8188eu: Use round_up() instead of _RND4() Signed-off-by: navin patidar Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index a292c5d1a45c..343a6caeabd5 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -324,7 +324,7 @@ _next: pcmdpriv->cmd_issued_cnt++; - pcmd->cmdsz = _RND4((pcmd->cmdsz));/* _RND4 */ + pcmd->cmdsz = round_up(pcmd->cmdsz, 4); memcpy(pcmdbuf, pcmd->parmbuf, pcmd->cmdsz); diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c index 85438478a345..902bbe0115ce 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c @@ -544,7 +544,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitp len = xmitframe_need_length(pxmitframe) + TXDESC_SIZE + (pxmitframe->pkt_offset*PACKET_OFFSET_SZ); - if (_RND8(pbuf + len) > MAX_XMITBUF_SZ) { + if (round_up(pbuf + len, 8) > MAX_XMITBUF_SZ) { pxmitframe->agg_num = 1; pxmitframe->pkt_offset = 1; break; @@ -567,7 +567,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitp /* handle pointer and stop condition */ pbuf_tail = pbuf + len; - pbuf = _RND8(pbuf_tail); + pbuf = round_up(pbuf_tail, 8); pfirstframe->agg_num++; if (MAX_TX_AGG_PACKET_NUMBER == pfirstframe->agg_num) diff --git a/drivers/staging/rtl8188eu/include/osdep_service.h b/drivers/staging/rtl8188eu/include/osdep_service.h index 927b30bdb848..913cbfeaa289 100644 --- a/drivers/staging/rtl8188eu/include/osdep_service.h +++ b/drivers/staging/rtl8188eu/include/osdep_service.h @@ -181,14 +181,6 @@ static inline void flush_signals_thread(void) #define _RND(sz, r) ((((sz)+((r)-1))/(r))*(r)) #define RND4(x) (((x >> 2) + (((x & 3) == 0) ? 0 : 1)) << 2) -static inline u32 _RND4(u32 sz) -{ - u32 val; - - val = ((sz >> 2) + ((sz & 3) ? 1 : 0)) << 2; - return val; -} - struct rtw_netdev_priv_indicator { void *priv; u32 sizeof_priv; diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c index eddff419f4fd..ba1e178fb510 100644 --- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c @@ -163,7 +163,7 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb) pkt_offset = (u16) round_up(pkt_offset, 128); break; case USB_RX_AGG_USB: - pkt_offset = (u16)_RND4(pkt_offset); + pkt_offset = (u16) round_up(pkt_offset, 4); break; case USB_RX_AGG_DISABLE: default: