Commit 49cb9d47 authored by Ivan Safonov's avatar Ivan Safonov Committed by Greg Kroah-Hartman

staging:r8188eu: remove skb data alignment in r8188eu driver code

(__)netdev_alloc_skb align skb data.
Also this function set skb device.
Signed-off-by: default avatarIvan Safonov <insafonov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 72e8072a
...@@ -61,23 +61,15 @@ int rtw_hal_init_recv_priv(struct adapter *padapter) ...@@ -61,23 +61,15 @@ int rtw_hal_init_recv_priv(struct adapter *padapter)
skb_queue_head_init(&precvpriv->rx_skb_queue); skb_queue_head_init(&precvpriv->rx_skb_queue);
{ {
int i; int i;
size_t tmpaddr = 0;
size_t alignm = 0;
struct sk_buff *pskb = NULL; struct sk_buff *pskb = NULL;
skb_queue_head_init(&precvpriv->free_recv_skb_queue); skb_queue_head_init(&precvpriv->free_recv_skb_queue);
for (i = 0; i < NR_PREALLOC_RECV_SKB; i++) { for (i = 0; i < NR_PREALLOC_RECV_SKB; i++) {
pskb = __netdev_alloc_skb(padapter->pnetdev, pskb = __netdev_alloc_skb(padapter->pnetdev,
MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ, MAX_RECVBUF_SZ, GFP_KERNEL);
GFP_KERNEL);
if (pskb) { if (pskb) {
kmemleak_not_leak(pskb); kmemleak_not_leak(pskb);
pskb->dev = padapter->pnetdev;
tmpaddr = (size_t)pskb->data;
alignm = tmpaddr & (RECVBUFF_ALIGN_SZ-1);
skb_reserve(pskb, (RECVBUFF_ALIGN_SZ - alignm));
skb_queue_tail(&precvpriv->free_recv_skb_queue, skb_queue_tail(&precvpriv->free_recv_skb_queue,
pskb); pskb);
} }
......
...@@ -139,8 +139,6 @@ struct rx_pkt_attrib { ...@@ -139,8 +139,6 @@ struct rx_pkt_attrib {
#define SN_EQUAL(a, b) (a == b) #define SN_EQUAL(a, b) (a == b)
#define REORDER_WAIT_TIME (50) /* (ms) */ #define REORDER_WAIT_TIME (50) /* (ms) */
#define RECVBUFF_ALIGN_SZ 8
#define RXDESC_SIZE 24 #define RXDESC_SIZE 24
#define RXDESC_OFFSET RXDESC_SIZE #define RXDESC_OFFSET RXDESC_SIZE
......
...@@ -457,8 +457,6 @@ u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *rmem) ...@@ -457,8 +457,6 @@ u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *rmem)
struct usb_device *pusbd = pdvobj->pusbdev; struct usb_device *pusbd = pdvobj->pusbdev;
int err; int err;
unsigned int pipe; unsigned int pipe;
size_t tmpaddr = 0;
size_t alignment = 0;
u32 ret = _SUCCESS; u32 ret = _SUCCESS;
...@@ -483,16 +481,12 @@ u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *rmem) ...@@ -483,16 +481,12 @@ u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *rmem)
/* re-assign for linux based on skb */ /* re-assign for linux based on skb */
if ((!precvbuf->reuse) || (precvbuf->pskb == NULL)) { if ((!precvbuf->reuse) || (precvbuf->pskb == NULL)) {
precvbuf->pskb = netdev_alloc_skb(adapter->pnetdev, MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ); precvbuf->pskb = netdev_alloc_skb(adapter->pnetdev, MAX_RECVBUF_SZ);
if (precvbuf->pskb == NULL) { if (precvbuf->pskb == NULL) {
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("init_recvbuf(): alloc_skb fail!\n")); RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("init_recvbuf(): alloc_skb fail!\n"));
DBG_88E("#### usb_read_port() alloc_skb fail!#####\n"); DBG_88E("#### usb_read_port() alloc_skb fail!#####\n");
return _FAIL; return _FAIL;
} }
tmpaddr = (size_t)precvbuf->pskb->data;
alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1);
skb_reserve(precvbuf->pskb, (RECVBUFF_ALIGN_SZ - alignment));
} else { /* reuse skb */ } else { /* reuse skb */
precvbuf->reuse = false; precvbuf->reuse = false;
} }
......
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