aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorIvan Safonov <insafonov@gmail.com>2016-09-18 13:25:40 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-20 07:33:49 -0400
commitfb1134087568dad2b974669ebcee09718b7fdc80 (patch)
tree32b574e44dadde9f5f0df0d88abbbff1b4bacde2 /drivers/staging
parent8fc01db37dfe00f748eb548d304640fc3148b2ab (diff)
staging: r8188eu: replace N_BYTE_ALIGMENT macro with PTR_ALIGN
PTR_ALIGN is a bit shorter than N_BYTE_ALIGMENT. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/rtl8188eu/core/rtw_recv.c2
-rw-r--r--drivers/staging/rtl8188eu/core/rtw_xmit.c6
-rw-r--r--drivers/staging/rtl8188eu/include/basic_types.h4
-rw-r--r--drivers/staging/rtl8188eu/os_dep/xmit_linux.c2
4 files changed, 5 insertions, 9 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 1063617b0ce4..b87cbbbee054 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -73,7 +73,7 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)
73 if (!precvpriv->pallocated_frame_buf) 73 if (!precvpriv->pallocated_frame_buf)
74 return _FAIL; 74 return _FAIL;
75 75
76 precvpriv->precv_frame_buf = (u8 *)N_BYTE_ALIGMENT((size_t)(precvpriv->pallocated_frame_buf), RXFRAME_ALIGN_SZ); 76 precvpriv->precv_frame_buf = PTR_ALIGN(precvpriv->pallocated_frame_buf, RXFRAME_ALIGN_SZ);
77 77
78 precvframe = (struct recv_frame *)precvpriv->precv_frame_buf; 78 precvframe = (struct recv_frame *)precvpriv->precv_frame_buf;
79 79
diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c
index e028ff4a52ef..56c6604401d4 100644
--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
+++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
@@ -86,7 +86,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
86 res = _FAIL; 86 res = _FAIL;
87 goto exit; 87 goto exit;
88 } 88 }
89 pxmitpriv->pxmit_frame_buf = (u8 *)N_BYTE_ALIGMENT((size_t)(pxmitpriv->pallocated_frame_buf), 4); 89 pxmitpriv->pxmit_frame_buf = PTR_ALIGN(pxmitpriv->pallocated_frame_buf, 4);
90 /* pxmitpriv->pxmit_frame_buf = pxmitpriv->pallocated_frame_buf + 4 - */ 90 /* pxmitpriv->pxmit_frame_buf = pxmitpriv->pallocated_frame_buf + 4 - */
91 /* ((size_t) (pxmitpriv->pallocated_frame_buf) &3); */ 91 /* ((size_t) (pxmitpriv->pallocated_frame_buf) &3); */
92 92
@@ -124,7 +124,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
124 goto exit; 124 goto exit;
125 } 125 }
126 126
127 pxmitpriv->pxmitbuf = (u8 *)N_BYTE_ALIGMENT((size_t)(pxmitpriv->pallocated_xmitbuf), 4); 127 pxmitpriv->pxmitbuf = PTR_ALIGN(pxmitpriv->pallocated_xmitbuf, 4);
128 /* pxmitpriv->pxmitbuf = pxmitpriv->pallocated_xmitbuf + 4 - */ 128 /* pxmitpriv->pxmitbuf = pxmitpriv->pallocated_xmitbuf + 4 - */
129 /* ((size_t) (pxmitpriv->pallocated_xmitbuf) &3); */ 129 /* ((size_t) (pxmitpriv->pallocated_xmitbuf) &3); */
130 130
@@ -166,7 +166,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
166 goto exit; 166 goto exit;
167 } 167 }
168 168
169 pxmitpriv->pxmit_extbuf = (u8 *)N_BYTE_ALIGMENT((size_t)(pxmitpriv->pallocated_xmit_extbuf), 4); 169 pxmitpriv->pxmit_extbuf = PTR_ALIGN(pxmitpriv->pallocated_xmit_extbuf, 4);
170 170
171 pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf; 171 pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf;
172 172
diff --git a/drivers/staging/rtl8188eu/include/basic_types.h b/drivers/staging/rtl8188eu/include/basic_types.h
index 2c1676d2ac6e..69c4d49f43ab 100644
--- a/drivers/staging/rtl8188eu/include/basic_types.h
+++ b/drivers/staging/rtl8188eu/include/basic_types.h
@@ -137,8 +137,4 @@ value to host byte ordering.*/
137 ((((u8)__val) & BIT_LEN_MASK_8(__bitlen)) << (__bitoffset)) \ 137 ((((u8)__val) & BIT_LEN_MASK_8(__bitlen)) << (__bitoffset)) \
138 ) 138 )
139 139
140/* Get the N-bytes aligment offset from the current length */
141#define N_BYTE_ALIGMENT(__value, __aligment) ((__aligment == 1) ? \
142 (__value) : (((__value + __aligment - 1) / __aligment) * __aligment))
143
144#endif /* __BASIC_TYPES_H__ */ 140#endif /* __BASIC_TYPES_H__ */
diff --git a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c
index 221e2750652e..4b1b04e00715 100644
--- a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c
@@ -72,7 +72,7 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitb
72 if (pxmitbuf->pallocated_buf == NULL) 72 if (pxmitbuf->pallocated_buf == NULL)
73 return _FAIL; 73 return _FAIL;
74 74
75 pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((size_t)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ); 75 pxmitbuf->pbuf = PTR_ALIGN(pxmitbuf->pallocated_buf, XMITBUF_ALIGN_SZ);
76 pxmitbuf->dma_transfer_addr = 0; 76 pxmitbuf->dma_transfer_addr = 0;
77 77
78 for (i = 0; i < 8; i++) { 78 for (i = 0; i < 8; i++) {