Skip to contentSkip to conversation

staging: r8188eu: remove unneeded header files

PATCH New Michael Straube 1 participant 4 messages Aug 24, 2021 Staging

lore
Share & tools
lore
#0 lore raw

v2 cover staging: r8188eu: remove unneeded header files

This series removes the header files if_ether.h and ip.h as both just duplicate in-kernel definitions.

v1 -> v2
Added a patch that removes the header file ethernet.h.

Michael Straube (3):
staging: r8188eu: remove if_ether.h header file
staging: r8188eu: remove ip.h header file
staging: r8188eu: remove ethernet.h header file

 drivers/staging/r8188eu/core/rtw_recv.c      |   5 +-
 drivers/staging/r8188eu/core/rtw_xmit.c      |   1 -
 drivers/staging/r8188eu/hal/rtl8188eu_recv.c |   3 -
 drivers/staging/r8188eu/include/ethernet.h   |  24 ----
 drivers/staging/r8188eu/include/if_ether.h   |  94 ----------------
 drivers/staging/r8188eu/include/ip.h         | 109 -------------------
 drivers/staging/r8188eu/include/rtw_recv.h   |   2 +
 drivers/staging/r8188eu/os_dep/recv_linux.c  |   1 -
 drivers/staging/r8188eu/os_dep/xmit_linux.c  |   2 -
 9 files changed, 3 insertions(+), 238 deletions(-)
 delete mode 100644 drivers/staging/r8188eu/include/ethernet.h
 delete mode 100644 drivers/staging/r8188eu/include/if_ether.h
 delete mode 100644 drivers/staging/r8188eu/include/ip.h
Signature · 1 line
2.32.0
#1 lore raw

PATCH v2 1/3 staging: r8188eu: remove if_ether.h header file

All constants, declarations and macros in if_ether.h are either duplicated from <uapi/linux/if_ether.h> or unused. Remove the file if_ether.h and its includes.

---
 drivers/staging/r8188eu/core/rtw_recv.c      |  1 -
 drivers/staging/r8188eu/hal/rtl8188eu_recv.c |  1 -
 drivers/staging/r8188eu/include/if_ether.h   | 94 --------------------
 drivers/staging/r8188eu/os_dep/xmit_linux.c  |  1 -
 4 files changed, 97 deletions(-)
 delete mode 100644 drivers/staging/r8188eu/include/if_ether.h
drivers/staging/r8188eu/core/rtw_recv.c +0 -1
index 52236bae8693..08066c9587f9 100644
@@ -8,7 +8,6 @@
 #include "../include/recv_osdep.h"
 #include "../include/mlme_osdep.h"
 #include "../include/ip.h"
-#include "../include/if_ether.h"
 #include "../include/ethernet.h"
 #include "../include/usb_ops.h"
 #include "../include/wifi.h"
drivers/staging/r8188eu/hal/rtl8188eu_recv.c +0 -1
index a44c9598186c..3a2c7090cd7b 100644
@@ -7,7 +7,6 @@
 #include "../include/recv_osdep.h"
 #include "../include/mlme_osdep.h"
 #include "../include/ip.h"
-#include "../include/if_ether.h"
 #include "../include/ethernet.h"
 
 #include "../include/usb_ops.h"
drivers/staging/r8188eu/include/if_ether.h deleted +0 -94

94 lines not on this page · raw message

drivers/staging/r8188eu/os_dep/xmit_linux.c +0 -1
index 60e0eea7ad84..d35e92c17a5e 100644
@@ -5,7 +5,6 @@
 
 #include "../include/osdep_service.h"
 #include "../include/drv_types.h"
-#include "../include/if_ether.h"
 #include "../include/ip.h"
 #include "../include/wifi.h"
 #include "../include/mlme_osdep.h"
Signature · 1 line
2.32.0
#2 lore raw

PATCH v2 2/3 staging: r8188eu: remove ip.h header file

In reply to Michael Straube

The struct ip_options declared in ip.h is only unsed in the optlength macro which is also defined in ip.h and not used in the driver code. All other definitions/declarations in ip.h are duplicated from <include/uapi/linux/ip.h>. Remove the ip.h header file and its includes.

---
 drivers/staging/r8188eu/core/rtw_recv.c      |   1 -
 drivers/staging/r8188eu/core/rtw_xmit.c      |   1 -
 drivers/staging/r8188eu/hal/rtl8188eu_recv.c |   1 -
 drivers/staging/r8188eu/include/ip.h         | 109 -------------------
 drivers/staging/r8188eu/os_dep/xmit_linux.c  |   1 -
 5 files changed, 113 deletions(-)
 delete mode 100644 drivers/staging/r8188eu/include/ip.h
drivers/staging/r8188eu/core/rtw_recv.c +0 -1
index 08066c9587f9..ea42b4954067 100644
@@ -7,7 +7,6 @@
 #include "../include/drv_types.h"
 #include "../include/recv_osdep.h"
 #include "../include/mlme_osdep.h"
-#include "../include/ip.h"
 #include "../include/ethernet.h"
 #include "../include/usb_ops.h"
 #include "../include/wifi.h"
drivers/staging/r8188eu/core/rtw_xmit.c +0 -1
index f242f3ffca70..38183fd37b93 100644
@@ -7,7 +7,6 @@
 #include "../include/drv_types.h"
 #include "../include/wifi.h"
 #include "../include/osdep_intf.h"
-#include "../include/ip.h"
 #include "../include/usb_ops.h"
 #include "../include/usb_osintf.h"
 
drivers/staging/r8188eu/hal/rtl8188eu_recv.c +0 -1
index 3a2c7090cd7b..666afa69fce6 100644
@@ -6,7 +6,6 @@
 #include "../include/drv_types.h"
 #include "../include/recv_osdep.h"
 #include "../include/mlme_osdep.h"
-#include "../include/ip.h"
 #include "../include/ethernet.h"
 
 #include "../include/usb_ops.h"
drivers/staging/r8188eu/include/ip.h deleted +0 -109

109 lines not on this page · raw message

drivers/staging/r8188eu/os_dep/xmit_linux.c +0 -1
index d35e92c17a5e..565ac5be7db3 100644
@@ -5,7 +5,6 @@
 
 #include "../include/osdep_service.h"
 #include "../include/drv_types.h"
-#include "../include/ip.h"
 #include "../include/wifi.h"
 #include "../include/mlme_osdep.h"
 #include "../include/xmit_osdep.h"
Signature · 1 line
2.32.0
#3 lore raw

PATCH v2 3/3 staging: r8188eu: remove ethernet.h header file

In reply to Michael Straube

There are only two definitions from ethernet.h used in the driver. Namely:

#define ETHERNET_HEADER_SIZE           14      /*  Ethernet Header Length */
#define LLC_HEADER_SIZE                6       /*  LLC Header Length */

Both are only used in the file core/rtw_recv.c. Replace the usage of ETHERNET_HEADER_SIZE with ETH_HLEN, move the definition of LLC_HEADER_SIZE into rtw_recv.h and remove the now unused ethernet.h header file.

---
 drivers/staging/r8188eu/core/rtw_recv.c      |  3 +--
 drivers/staging/r8188eu/hal/rtl8188eu_recv.c |  1 -
 drivers/staging/r8188eu/include/ethernet.h   | 24 --------------------
 drivers/staging/r8188eu/include/rtw_recv.h   |  2 ++
 drivers/staging/r8188eu/os_dep/recv_linux.c  |  1 -
 5 files changed, 3 insertions(+), 28 deletions(-)
 delete mode 100644 drivers/staging/r8188eu/include/ethernet.h
drivers/staging/r8188eu/core/rtw_recv.c +1 -2
index ea42b4954067..5ff306ef1c5a 100644
@@ -7,7 +7,6 @@
 #include "../include/drv_types.h"
 #include "../include/recv_osdep.h"
 #include "../include/mlme_osdep.h"
-#include "../include/ethernet.h"
 #include "../include/usb_ops.h"
 #include "../include/wifi.h"
 
@@ -1519,7 +1518,7 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe)
 		/* Offset 12 denote 2 mac address */
 		nSubframe_Length = RTW_GET_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;
 		}
drivers/staging/r8188eu/hal/rtl8188eu_recv.c +0 -1
index 666afa69fce6..2da7bde80cc0 100644
@@ -6,7 +6,6 @@
 #include "../include/drv_types.h"
 #include "../include/recv_osdep.h"
 #include "../include/mlme_osdep.h"
-#include "../include/ethernet.h"
 
 #include "../include/usb_ops.h"
 #include "../include/wifi.h"
drivers/staging/r8188eu/include/ethernet.h deleted +0 -24
deleted file mode 100644
index 898eb296013c..000000000000
@@ -1,24 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
-/* Copyright(c) 2007 - 2011 Realtek Corporation. */
-
-#ifndef __INC_ETHERNET_H
-#define __INC_ETHERNET_H
-
-#define ETHERNET_ADDRESS_LENGTH		6	/*  Ethernet Address Length */
-#define ETHERNET_HEADER_SIZE		14	/*  Ethernet Header Length */
-#define LLC_HEADER_SIZE			6	/*  LLC Header Length */
-#define TYPE_LENGTH_FIELD_SIZE		2	/*  Type/Length Size */
-#define MINIMUM_ETHERNET_PACKET_SIZE	60	/*  Min Ethernet Packet Size */
-#define MAXIMUM_ETHERNET_PACKET_SIZE	1514	/*  Max Ethernet Packet Size */
-
-/*  Is Multicast Address? */
-#define RT_ETH_IS_MULTICAST(_addr)	((((u8 *)(_addr))[0]&0x01) != 0)
-#define RT_ETH_IS_BROADCAST(_addr)	(			\
-		((u8 *)(_addr))[0] == 0xff &&		\
-		((u8 *)(_addr))[1] == 0xff &&		\
-		((u8 *)(_addr))[2] == 0xff &&		\
-		((u8 *)(_addr))[3] == 0xff &&		\
-		((u8 *)(_addr))[4] == 0xff &&		\
-		((u8 *)(_addr))[5] == 0xff)	/*  Is Broadcast Address? */
-
-#endif /*  #ifndef __INC_ETHERNET_H */
drivers/staging/r8188eu/include/rtw_recv.h +2 -0
index 81594e7aed51..2ce7ba99344c 100644
@@ -20,6 +20,8 @@
 
 #define MAX_SUBFRAME_COUNT	64
 
+#define LLC_HEADER_SIZE 6
+
 /* for Rx reordering buffer control */
 struct recv_reorder_ctrl {
 	struct adapter	*padapter;
drivers/staging/r8188eu/os_dep/recv_linux.c +0 -1
index b4c5333bfff0..31fbc0d5d925 100644
@@ -10,7 +10,6 @@
 #include "../include/recv_osdep.h"
 
 #include "../include/osdep_intf.h"
-#include "../include/ethernet.h"
 #include "../include/usb_ops.h"
 
 /* init os related resource in struct recv_priv */
Signature · 1 line
2.32.0