Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755282AbcJGTIj (ORCPT ); Fri, 7 Oct 2016 15:08:39 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:34252 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752056AbcJGTIf (ORCPT ); Fri, 7 Oct 2016 15:08:35 -0400 From: Ivan Safonov To: Greg Kroah-Hartman , Kyle Kuffermann , Alexey Khoroshilov , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Ivan Safonov Subject: [PATCH 05/34] staging:r8188eu: remove skb data alignment in r8188eu driver code Date: Sat, 8 Oct 2016 01:01:04 +0700 Message-Id: <1475863293-27587-5-git-send-email-insafonov@gmail.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1475863293-27587-1-git-send-email-insafonov@gmail.com> References: <1475863293-27587-1-git-send-email-insafonov@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3105 Lines: 85 (__)netdev_alloc_skb align skb data. Also this function set skb device. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c | 10 +--------- drivers/staging/rtl8188eu/include/rtw_recv.h | 2 -- drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 8 +------- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c index 67a765a..1c7a9a0 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c @@ -61,23 +61,15 @@ int rtw_hal_init_recv_priv(struct adapter *padapter) skb_queue_head_init(&precvpriv->rx_skb_queue); { int i; - size_t tmpaddr = 0; - size_t alignm = 0; struct sk_buff *pskb = NULL; skb_queue_head_init(&precvpriv->free_recv_skb_queue); for (i = 0; i < NR_PREALLOC_RECV_SKB; i++) { pskb = __netdev_alloc_skb(padapter->pnetdev, - MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ, - GFP_KERNEL); + MAX_RECVBUF_SZ, GFP_KERNEL); if (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, pskb); } diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index a8874a2..c868863 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -139,8 +139,6 @@ struct rx_pkt_attrib { #define SN_EQUAL(a, b) (a == b) #define REORDER_WAIT_TIME (50) /* (ms) */ -#define RECVBUFF_ALIGN_SZ 8 - #define RXDESC_SIZE 24 #define RXDESC_OFFSET RXDESC_SIZE diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c index d0d5915..b820482 100644 --- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c @@ -457,8 +457,6 @@ u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *rmem) struct usb_device *pusbd = pdvobj->pusbdev; int err; unsigned int pipe; - size_t tmpaddr = 0; - size_t alignment = 0; u32 ret = _SUCCESS; @@ -483,16 +481,12 @@ u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *rmem) /* re-assign for linux based on skb */ 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) { RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("init_recvbuf(): alloc_skb fail!\n")); DBG_88E("#### usb_read_port() alloc_skb fail!#####\n"); 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 */ precvbuf->reuse = false; } -- 2.7.3