From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from viti.kaiser.cx (viti.kaiser.cx [85.214.81.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 879E02FAF for ; Sat, 5 Jun 2021 16:59:29 +0000 (UTC) Received: from dslb-188-096-145-192.188.096.pools.vodafone-ip.de ([188.96.145.192] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1lpZdv-0002hw-MJ; Sat, 05 Jun 2021 18:59:27 +0200 From: Martin Kaiser To: Larry Finger , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 7/9] staging: rtl8188eu: use existing define for ethernet header len Date: Sat, 5 Jun 2021 18:58:56 +0200 Message-Id: <20210605165858.3175-7-martin@kaiser.cx> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210605165858.3175-1-martin@kaiser.cx> References: <20210605165858.3175-1-martin@kaiser.cx> X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Replace the driver's internal define with ETH_HLEN. Signed-off-by: Martin Kaiser --- drivers/staging/rtl8188eu/core/rtw_recv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index c20141638b73..ef37cc6bf51f 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -7,6 +7,7 @@ #define _RTW_RECV_C_ #include +#include #include #include @@ -17,7 +18,6 @@ #include #include -#define ETHERNET_HEADER_SIZE 14 /* Ethernet Header Length */ #define LLC_HEADER_SIZE 6 /* LLC Header Length */ static u8 SNAP_ETH_TYPE_IPX[2] = {0x81, 0x37}; @@ -1503,7 +1503,7 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe) /* Offset 12 denote 2 mac address */ nSubframe_Length = get_unaligned_be16(pdata + 12); - if (a_len < (ETHERNET_HEADER_SIZE + nSubframe_Length)) { + if (a_len < (ETH_HLEN + nSubframe_Length)) { DBG_88E("nRemain_Length is %d and nSubframe_Length is : %d\n", a_len, nSubframe_Length); goto exit; } -- 2.20.1