linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] Do more cleanup of the new rtl8188eu driver
@ 2021-07-29 17:09 Larry Finger
  2021-07-29 17:09 ` [PATCH 1/6] staging: r8188eu: Remove empty header file Larry Finger
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Larry Finger @ 2021-07-29 17:09 UTC (permalink / raw)
  To: gregkh; +Cc: phil, linux-staging, linux-kernel, Larry Finger

This set of patches eliminates several of the small header file by
moving their content into longer headers. One patch also removes the
code used to build the driver on kernels older than mainline.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


Larry Finger (6):
  staging: r8188eu: Remove empty header file
  staging: r8188eu: Remove tests of kernel version
  staging: r8188eu: Remove include/rtw_qos.h
  staging: r8188eu: Remove header file include/usb_hal.h
  staging: r8188eu: Remove header file include/rtw_version.h
  staging: r8188eu: Add "fallthrough" statement to quiet compiler

 drivers/staging/r8188eu/core/rtw_debug.c      |  2 +-
 drivers/staging/r8188eu/core/rtw_led.c        | 12 ----
 drivers/staging/r8188eu/core/rtw_mlme_ext.c   |  2 +-
 drivers/staging/r8188eu/core/rtw_p2p.c        | 53 ----------------
 drivers/staging/r8188eu/core/rtw_pwrctrl.c    | 12 ----
 drivers/staging/r8188eu/core/rtw_recv.c       | 16 -----
 drivers/staging/r8188eu/core/rtw_xmit.c       |  8 ---
 drivers/staging/r8188eu/hal/hal_intf.c        |  1 -
 drivers/staging/r8188eu/hal/odm.c             |  9 ---
 drivers/staging/r8188eu/hal/odm_interface.c   | 10 ---
 drivers/staging/r8188eu/hal/usb_halinit.c     |  1 -
 drivers/staging/r8188eu/include/drv_types.h   |  4 +-
 .../staging/r8188eu/include/drv_types_linux.h |  7 ---
 drivers/staging/r8188eu/include/hal_intf.h    |  1 +
 drivers/staging/r8188eu/include/odm_precomp.h |  4 --
 .../staging/r8188eu/include/osdep_service.h   | 12 ----
 drivers/staging/r8188eu/include/rtw_led.h     |  4 --
 drivers/staging/r8188eu/include/rtw_mlme.h    | 11 ++--
 drivers/staging/r8188eu/include/rtw_qos.h     | 14 -----
 .../staging/r8188eu/include/rtw_security.h    |  8 ---
 drivers/staging/r8188eu/include/rtw_version.h |  2 -
 drivers/staging/r8188eu/include/usb_hal.h     | 10 ---
 drivers/staging/r8188eu/include/usb_ops.h     | 16 -----
 drivers/staging/r8188eu/include/wifi.h        |  3 -
 drivers/staging/r8188eu/os_dep/ioctl_linux.c  |  1 -
 drivers/staging/r8188eu/os_dep/mlme_linux.c   | 63 -------------------
 drivers/staging/r8188eu/os_dep/os_intfs.c     |  3 -
 drivers/staging/r8188eu/os_dep/recv_linux.c   | 16 -----
 drivers/staging/r8188eu/os_dep/usb_intf.c     |  4 +-
 29 files changed, 12 insertions(+), 297 deletions(-)
 delete mode 100644 drivers/staging/r8188eu/include/drv_types_linux.h
 delete mode 100644 drivers/staging/r8188eu/include/rtw_qos.h
 delete mode 100644 drivers/staging/r8188eu/include/rtw_version.h
 delete mode 100644 drivers/staging/r8188eu/include/usb_hal.h

-- 
2.32.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/6] staging: r8188eu: Remove empty header file
  2021-07-29 17:09 [PATCH 0/6] Do more cleanup of the new rtl8188eu driver Larry Finger
@ 2021-07-29 17:09 ` Larry Finger
  2021-07-29 17:09 ` [PATCH 2/6] staging: r8188eu: Remove tests of kernel version Larry Finger
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Larry Finger @ 2021-07-29 17:09 UTC (permalink / raw)
  To: gregkh; +Cc: phil, linux-staging, linux-kernel, Larry Finger

File include/drv_types_linux.h is empty. Remove it.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/staging/r8188eu/include/drv_types.h       | 1 -
 drivers/staging/r8188eu/include/drv_types_linux.h | 7 -------
 2 files changed, 8 deletions(-)
 delete mode 100644 drivers/staging/r8188eu/include/drv_types_linux.h

diff --git a/drivers/staging/r8188eu/include/drv_types.h b/drivers/staging/r8188eu/include/drv_types.h
index dce4c602ffe6..eed807d5dbc2 100644
--- a/drivers/staging/r8188eu/include/drv_types.h
+++ b/drivers/staging/r8188eu/include/drv_types.h
@@ -16,7 +16,6 @@
 
 #include <osdep_service.h>
 #include <wlan_bssdef.h>
-#include <drv_types_linux.h>
 #include <rtw_ht.h>
 #include <rtw_cmd.h>
 #include <rtw_xmit.h>
diff --git a/drivers/staging/r8188eu/include/drv_types_linux.h b/drivers/staging/r8188eu/include/drv_types_linux.h
deleted file mode 100644
index 068a7bcee82f..000000000000
--- a/drivers/staging/r8188eu/include/drv_types_linux.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
-/* Copyright(c) 2007 - 2011 Realtek Corporation. */
-
-#ifndef __DRV_TYPES_LINUX_H__
-#define __DRV_TYPES_LINUX_H__
-
-#endif
-- 
2.32.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/6] staging: r8188eu: Remove tests of kernel version
  2021-07-29 17:09 [PATCH 0/6] Do more cleanup of the new rtl8188eu driver Larry Finger
  2021-07-29 17:09 ` [PATCH 1/6] staging: r8188eu: Remove empty header file Larry Finger
@ 2021-07-29 17:09 ` Larry Finger
  2021-07-29 17:09 ` [PATCH 3/6] staging: r8188eu: Remove include/rtw_qos.h Larry Finger
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Larry Finger @ 2021-07-29 17:09 UTC (permalink / raw)
  To: gregkh; +Cc: phil, linux-staging, linux-kernel, Larry Finger

In the GitHub repository from which this driver was derived, old kernels
had to be supported. Now that the driver is included in the kernel,
this code can be removed as well as all mention of version.h.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/staging/r8188eu/core/rtw_led.c        | 12 ----
 drivers/staging/r8188eu/core/rtw_p2p.c        | 53 ----------------
 drivers/staging/r8188eu/core/rtw_pwrctrl.c    | 12 ----
 drivers/staging/r8188eu/core/rtw_recv.c       | 16 -----
 drivers/staging/r8188eu/core/rtw_xmit.c       |  8 ---
 drivers/staging/r8188eu/hal/odm.c             |  9 ---
 drivers/staging/r8188eu/hal/odm_interface.c   | 10 ---
 drivers/staging/r8188eu/include/odm_precomp.h |  4 --
 .../staging/r8188eu/include/osdep_service.h   | 12 ----
 drivers/staging/r8188eu/include/rtw_led.h     |  4 --
 drivers/staging/r8188eu/include/rtw_mlme.h    |  5 --
 .../staging/r8188eu/include/rtw_security.h    |  8 ---
 drivers/staging/r8188eu/include/usb_ops.h     | 16 -----
 drivers/staging/r8188eu/include/wifi.h        |  3 -
 drivers/staging/r8188eu/os_dep/mlme_linux.c   | 63 -------------------
 drivers/staging/r8188eu/os_dep/os_intfs.c     |  1 -
 drivers/staging/r8188eu/os_dep/recv_linux.c   | 16 -----
 17 files changed, 252 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c
index 37c9766b4c64..ee90e52adc90 100644
--- a/drivers/staging/r8188eu/core/rtw_led.c
+++ b/drivers/staging/r8188eu/core/rtw_led.c
@@ -9,17 +9,9 @@
 /*		Callback function of LED BlinkTimer, */
 /*		it just schedules to corresponding BlinkWorkItem/led_blink_hdl */
 /*  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 void BlinkTimerCallback(struct timer_list *t)
-#else
-void BlinkTimerCallback(void *data)
-#endif
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 	struct LED_871x *pLed = from_timer(pLed, t, BlinkTimer);
-#else
-	struct LED_871x *pLed = (struct LED_871x *)data;
-#endif
 	struct adapter *padapter = pLed->padapter;
 
 	if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped))
@@ -69,11 +61,7 @@ void InitLed871x(struct adapter *padapter, struct LED_871x *pLed, enum LED_PIN_8
 
 	ResetLedStatus(pLed);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 	timer_setup(&pLed->BlinkTimer, BlinkTimerCallback, 0);
-#else
-	_init_timer(&(pLed->BlinkTimer), padapter->pnetdev, BlinkTimerCallback, pLed);
-#endif
 	_init_workitem(&(pLed->BlinkWorkItem), BlinkWorkItemCallback, pLed);
 }
 
diff --git a/drivers/staging/r8188eu/core/rtw_p2p.c b/drivers/staging/r8188eu/core/rtw_p2p.c
index 0c97c42eb420..3ec988fad6ea 100644
--- a/drivers/staging/r8188eu/core/rtw_p2p.c
+++ b/drivers/staging/r8188eu/core/rtw_p2p.c
@@ -1728,17 +1728,9 @@ u8 p2p_ps_wk_cmd(struct adapter *padapter, u8 p2p_ps_state, u8 enqueue)
 	return res;
 }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 static void reset_ch_sitesurvey_timer_process(struct timer_list *t)
-#else
-static void reset_ch_sitesurvey_timer_process (void *FunctionContext)
-#endif
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 	struct adapter *adapter = from_timer(adapter, t, pwrctrlpriv.pwr_state_check_timer);
-#else
-	struct adapter *adapter = (struct adapter *)FunctionContext;
-#endif
 	struct	wifidirect_info		*pwdinfo = &adapter->wdinfo;
 
 	if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@@ -1750,17 +1742,9 @@ static void reset_ch_sitesurvey_timer_process (void *FunctionContext)
 	pwdinfo->rx_invitereq_info.scan_op_ch_only = 0;
 }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 static void reset_ch_sitesurvey_timer_process2 (struct timer_list *t)
-#else
-static void reset_ch_sitesurvey_timer_process2 (void *FunctionContext)
-#endif
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 	struct adapter *adapter = from_timer(adapter, t, pwrctrlpriv.pwr_state_check_timer);
-#else
-	struct adapter *adapter = (struct adapter *)FunctionContext;
-#endif
 	struct	wifidirect_info		*pwdinfo = &adapter->wdinfo;
 
 	if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@@ -1772,17 +1756,9 @@ static void reset_ch_sitesurvey_timer_process2 (void *FunctionContext)
 	pwdinfo->p2p_info.scan_op_ch_only = 0;
 }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 static void restore_p2p_state_timer_process(struct timer_list *t)
-#else
-static void restore_p2p_state_timer_process (void *FunctionContext)
-#endif
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 	struct adapter *adapter = from_timer(adapter, t, wdinfo.restore_p2p_state_timer);
-#else
-	struct adapter *adapter = (struct adapter *)FunctionContext;
-#endif
 	struct	wifidirect_info		*pwdinfo = &adapter->wdinfo;
 
 	if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@@ -1791,17 +1767,9 @@ static void restore_p2p_state_timer_process (void *FunctionContext)
 	p2p_protocol_wk_cmd(adapter, P2P_RESTORE_STATE_WK);
 }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 static void pre_tx_scan_timer_process(struct timer_list *t)
-#else
-static void pre_tx_scan_timer_process(void *FunctionContext)
-#endif
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 	struct adapter *adapter = from_timer(adapter, t, wdinfo.pre_tx_scan_timer);
-#else
-	struct adapter *adapter = (struct adapter *)FunctionContext;
-#endif
 	struct	wifidirect_info *pwdinfo = &adapter->wdinfo;
 	struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
 
@@ -1829,17 +1797,9 @@ static void pre_tx_scan_timer_process(void *FunctionContext)
 	spin_unlock_bh(&pmlmepriv->lock);
 }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 static void find_phase_timer_process(struct timer_list *t)
-#else
-static void find_phase_timer_process(void *FunctionContext)
-#endif
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 	struct adapter *adapter = from_timer(adapter, t, wdinfo.find_phase_timer);
-#else
-	struct adapter *adapter = (struct adapter *)FunctionContext;
-#endif
 	struct	wifidirect_info		*pwdinfo = &adapter->wdinfo;
 
 	if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@@ -1865,19 +1825,11 @@ void rtw_init_wifidirect_timers(struct adapter *padapter)
 {
 	struct wifidirect_info *pwdinfo = &padapter->wdinfo;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 	timer_setup(&pwdinfo->find_phase_timer, find_phase_timer_process, 0);
 	timer_setup(&pwdinfo->restore_p2p_state_timer, restore_p2p_state_timer_process, 0);
 	timer_setup(&pwdinfo->pre_tx_scan_timer, pre_tx_scan_timer_process, 0);
 	timer_setup(&pwdinfo->reset_ch_sitesurvey, reset_ch_sitesurvey_timer_process, 0);
 	timer_setup(&pwdinfo->reset_ch_sitesurvey2, reset_ch_sitesurvey_timer_process2, 0);
-#else
-	_init_timer(&pwdinfo->find_phase_timer, padapter->pnetdev, find_phase_timer_process, padapter);
-	_init_timer(&pwdinfo->restore_p2p_state_timer, padapter->pnetdev, restore_p2p_state_timer_process, padapter);
-	_init_timer(&pwdinfo->pre_tx_scan_timer, padapter->pnetdev, pre_tx_scan_timer_process, padapter);
-	_init_timer(&pwdinfo->reset_ch_sitesurvey, padapter->pnetdev, reset_ch_sitesurvey_timer_process, padapter);
-	_init_timer(&pwdinfo->reset_ch_sitesurvey2, padapter->pnetdev, reset_ch_sitesurvey_timer_process2, padapter);
-#endif
 }
 
 void rtw_init_wifidirect_addrs(struct adapter *padapter, u8 *dev_addr, u8 *iface_addr)
@@ -2019,11 +1971,6 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role)
 			_cancel_timer_ex(&pwdinfo->pre_tx_scan_timer);
 			_cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey);
 			_cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey2);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
-#else
-			reset_ch_sitesurvey_timer_process(padapter);
-			reset_ch_sitesurvey_timer_process2(padapter);
-#endif
 			rtw_p2p_set_state(pwdinfo, P2P_STATE_NONE);
 			rtw_p2p_set_role(pwdinfo, P2P_ROLE_DISABLE);
 			memset(&pwdinfo->rx_prov_disc_info, 0x00, sizeof(struct rx_provdisc_req_info));
diff --git a/drivers/staging/r8188eu/core/rtw_pwrctrl.c b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
index 56980998e094..a7b63413000b 100644
--- a/drivers/staging/r8188eu/core/rtw_pwrctrl.c
+++ b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
@@ -192,19 +192,11 @@ void rtw_ps_processor(struct adapter *padapter)
 	return;
 }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 static void pwr_state_check_handler(struct timer_list *t)
-#else
-static void pwr_state_check_handler(void *FunctionContext)
-#endif
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 	struct adapter *padapter =
 		from_timer(padapter, t,
 			   pwrctrlpriv.pwr_state_check_timer);
-#else
-	struct adapter *padapter = (struct adapter *)FunctionContext;
-#endif
 	rtw_ps_cmd(padapter);
 }
 
@@ -492,11 +484,7 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter)
 
 	pwrctrlpriv->btcoex_rfon = false;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 	timer_setup(&pwrctrlpriv->pwr_state_check_timer, pwr_state_check_handler, 0);
-#else
-	_init_timer(&(pwrctrlpriv->pwr_state_check_timer), padapter->pnetdev, pwr_state_check_handler, (u8 *)padapter);
-#endif
 }
 
 void rtw_free_pwrctrl_priv(struct adapter *adapter)
diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
index f3cbf71a3a4a..3872aa5cb982 100644
--- a/drivers/staging/r8188eu/core/rtw_recv.c
+++ b/drivers/staging/r8188eu/core/rtw_recv.c
@@ -25,11 +25,7 @@ static u8 rtw_rfc1042_header[] = {
        0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00
 };
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 void rtw_signal_stat_timer_hdl(struct timer_list *);
-#else
-void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS);
-#endif
 
 void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv)
 {
@@ -91,11 +87,7 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)
 
 	res = rtw_hal_init_recv_priv(padapter);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 	timer_setup(&precvpriv->signal_stat_timer, rtw_signal_stat_timer_hdl, 0);
-#else
-	_init_timer(&precvpriv->signal_stat_timer, padapter->pnetdev, RTW_TIMER_HDL_NAME(signal_stat), padapter);
-#endif
 	precvpriv->signal_stat_sampling_interval = 1000; /* ms */
 
 	rtw_set_signal_stat_timer(precvpriv);
@@ -2174,17 +2166,9 @@ s32 rtw_recv_entry(struct recv_frame *precvframe)
 	return ret;
 }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 void rtw_signal_stat_timer_hdl(struct timer_list *t)
-#else
-void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS)
-#endif
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 	struct adapter *adapter = from_timer(adapter, t, recvpriv.signal_stat_timer);
-#else
-	struct adapter *adapter = (struct adapter *)FunctionContext;
-#endif
 	struct recv_priv *recvpriv = &adapter->recvpriv;
 
 	u32 tmp_s, tmp_q;
diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index 27d82f91c8a7..c2a3d62facd1 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -1671,11 +1671,7 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
 	void *br_port = NULL;
 
 	rcu_read_lock();
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
 	br_port = rcu_dereference(padapter->pnetdev->rx_handler_data);
-#else
-	br_port = rcu_dereference(padapter->pnetdev->br_port);
-#endif
 	rcu_read_unlock();
 	spin_lock_bh(&padapter->br_ext_lock);
 	if (!(skb->data[0] & 1) && br_port &&
@@ -1859,11 +1855,7 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)
 	}
 
 	rcu_read_lock();
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
 	br_port = rcu_dereference(padapter->pnetdev->rx_handler_data);
-#else
-	br_port = rcu_dereference(padapter->pnetdev->br_port);
-#endif
 	rcu_read_unlock();
 
 	if (br_port && check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE)) {
diff --git a/drivers/staging/r8188eu/hal/odm.c b/drivers/staging/r8188eu/hal/odm.c
index 81fe727115d9..a26b2ae35b73 100644
--- a/drivers/staging/r8188eu/hal/odm.c
+++ b/drivers/staging/r8188eu/hal/odm.c
@@ -1563,12 +1563,7 @@ void odm_RSSIMonitorCheckAP(struct odm_dm_struct *pDM_Odm)
 
 void ODM_InitAllTimers(struct odm_dm_struct *pDM_Odm)
 {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-	ODM_InitializeTimer(pDM_Odm, &pDM_Odm->DM_SWAT_Table.SwAntennaSwitchTimer,
-			    (void *)odm_SwAntDivChkAntSwitchCallback, NULL, "SwAntennaSwitchTimer");
-#else
 	timer_setup(&pDM_Odm->DM_SWAT_Table.SwAntennaSwitchTimer, odm_SwAntDivChkAntSwitchCallback, 0);
-#endif
 }
 
 void ODM_CancelAllTimers(struct odm_dm_struct *pDM_Odm)
@@ -1677,11 +1672,7 @@ void ODM_SwAntDivRestAfterLink(struct odm_dm_struct *pDM_Odm)
 {
 }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-void odm_SwAntDivChkAntSwitchCallback(void *FunctionContext)
-#else
 void odm_SwAntDivChkAntSwitchCallback(struct timer_list *t)
-#endif
 {
 }
 
diff --git a/drivers/staging/r8188eu/hal/odm_interface.c b/drivers/staging/r8188eu/hal/odm_interface.c
index 8875a9954981..e26a6461e70b 100644
--- a/drivers/staging/r8188eu/hal/odm_interface.c
+++ b/drivers/staging/r8188eu/hal/odm_interface.c
@@ -160,16 +160,6 @@ void ODM_SetTimer(struct odm_dm_struct *pDM_Odm, struct timer_list *pTimer, u32
 	_set_timer(pTimer, msDelay); /* ms */
 }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-void ODM_InitializeTimer(struct odm_dm_struct *pDM_Odm, struct timer_list *pTimer,
-			 void *CallBackFunc, void *pContext,
-			 const char *szID)
-{
-	struct adapter *Adapter = pDM_Odm->Adapter;
-	_init_timer(pTimer, Adapter->pnetdev, CallBackFunc, pDM_Odm);
-}
-#endif
-
 void ODM_CancelTimer(struct odm_dm_struct *pDM_Odm, struct timer_list *pTimer)
 {
 	_cancel_timer_ex(pTimer);
diff --git a/drivers/staging/r8188eu/include/odm_precomp.h b/drivers/staging/r8188eu/include/odm_precomp.h
index ff2dae597d5b..cec1035e4fe0 100644
--- a/drivers/staging/r8188eu/include/odm_precomp.h
+++ b/drivers/staging/r8188eu/include/odm_precomp.h
@@ -75,11 +75,7 @@ void odm_EdcaTurboCheckCE(struct odm_dm_struct *pDM_Odm);
 void odm_TXPowerTrackingCheckCE(struct odm_dm_struct *pDM_Odm);
 void odm_TXPowerTrackingCheckMP(struct odm_dm_struct *pDM_Odm);
 void odm_TXPowerTrackingCheckAP(struct odm_dm_struct *pDM_Odm);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-void odm_SwAntDivChkAntSwitchCallback(void *FunctionContext);
-#else
 void odm_SwAntDivChkAntSwitchCallback(struct timer_list *t);
-#endif
 void odm_InitHybridAntDiv(struct odm_dm_struct *pDM_Odm);
 void odm_HwAntDiv(struct odm_dm_struct *pDM_Odm);
 
diff --git a/drivers/staging/r8188eu/include/osdep_service.h b/drivers/staging/r8188eu/include/osdep_service.h
index 5b08e985257a..e61113c2608c 100644
--- a/drivers/staging/r8188eu/include/osdep_service.h
+++ b/drivers/staging/r8188eu/include/osdep_service.h
@@ -4,10 +4,7 @@
 #ifndef __OSDEP_SERVICE_H_
 #define __OSDEP_SERVICE_H_
 
-#include <linux/version.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
 #include <linux/sched/signal.h>
-#endif
 #include <basic_types.h>
 
 #define _FAIL		0
@@ -76,15 +73,6 @@ static inline void rtw_list_delete(struct list_head *plist)
 	list_del_init(plist);
 }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-static inline void _init_timer(struct timer_list *ptimer,struct  net_device *nic_hdl,void *pfunc,void* cntx)
-{
-	ptimer->function = pfunc;
-	ptimer->data = (unsigned long)cntx;
-	init_timer(ptimer);
-}
-#endif
-
 static inline void _set_timer(struct timer_list *ptimer,u32 delay_time)
 {
 	mod_timer(ptimer , (jiffies+(delay_time*HZ/1000)));
diff --git a/drivers/staging/r8188eu/include/rtw_led.h b/drivers/staging/r8188eu/include/rtw_led.h
index 128cdc10b9b5..def9d04a20ce 100644
--- a/drivers/staging/r8188eu/include/rtw_led.h
+++ b/drivers/staging/r8188eu/include/rtw_led.h
@@ -163,11 +163,7 @@ struct led_priv{
 			(adapt)->ledpriv.LedControlHandler((adapt), (action)); \
 	} while (0)
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 void BlinkTimerCallback(struct timer_list *t);
-#else
-void BlinkTimerCallback(void *data);
-#endif
 void BlinkWorkItemCallback(struct work_struct *work);
 
 void ResetLedStatus(struct LED_871x * pLed);
diff --git a/drivers/staging/r8188eu/include/rtw_mlme.h b/drivers/staging/r8188eu/include/rtw_mlme.h
index 7cab18047cef..3ef1a008c602 100644
--- a/drivers/staging/r8188eu/include/rtw_mlme.h
+++ b/drivers/staging/r8188eu/include/rtw_mlme.h
@@ -453,13 +453,8 @@ void indicate_wx_scan_complete_event(struct adapter *padapter);
 void rtw_indicate_wx_assoc_event(struct adapter *padapter);
 void rtw_indicate_wx_disassoc_event(struct adapter *padapter);
 int event_thread(void *context);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-void rtw_join_timeout_handler (void *FunctionContext);
-void _rtw_scan_timeout_handler(void *FunctionContext);
-#else
 void rtw_join_timeout_handler (struct timer_list *t);
 void _rtw_scan_timeout_handler (struct timer_list *t);
-#endif
 void rtw_free_network_queue(struct adapter *adapter, u8 isfreeall);
 int rtw_init_mlme_priv(struct adapter *adapter);
 void rtw_free_mlme_priv (struct mlme_priv *pmlmepriv);
diff --git a/drivers/staging/r8188eu/include/rtw_security.h b/drivers/staging/r8188eu/include/rtw_security.h
index 6e039e87b04d..2d8522c01027 100644
--- a/drivers/staging/r8188eu/include/rtw_security.h
+++ b/drivers/staging/r8188eu/include/rtw_security.h
@@ -152,14 +152,6 @@ struct security_priv {
 	u8 bWepDefaultKeyIdxSet;
 };
 
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 8, 0)
-struct sha256_state {
-	u64 length;
-	u32 state[8], curlen;
-	u8 buf[64];
-};
-#endif
-
 #define GET_ENCRY_ALGO(psecuritypriv, psta, encry_algo, bmcst)		\
 do {									\
 	switch (psecuritypriv->dot11AuthAlgrthm) {			\
diff --git a/drivers/staging/r8188eu/include/usb_ops.h b/drivers/staging/r8188eu/include/usb_ops.h
index 40e834390a10..9e60b3a9a02a 100644
--- a/drivers/staging/r8188eu/include/usb_ops.h
+++ b/drivers/staging/r8188eu/include/usb_ops.h
@@ -4,7 +4,6 @@
 #ifndef __USB_OPS_H_
 #define __USB_OPS_H_
 
-#include <linux/version.h>
 #include <osdep_service.h>
 #include <drv_types.h>
 #include <osdep_intf.h>
@@ -22,7 +21,6 @@ enum {
 #define MAX_VENDOR_REQ_CMD_SIZE	254	/* 8188cu SIE Support */
 #define MAX_USB_IO_CTL_SIZE	(MAX_VENDOR_REQ_CMD_SIZE + ALIGNMENT_UNIT)
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12))
 #define rtw_usb_control_msg(dev, pipe, request, requesttype,		\
 			    value, index, data, size, timeout_ms)	\
 	usb_control_msg((dev), (pipe), (request), (requesttype), (value),\
@@ -30,20 +28,6 @@ enum {
 #define rtw_usb_bulk_msg(usb_dev, pipe, data, len, actual_length, timeout_ms) \
 	usb_bulk_msg((usb_dev), (pipe), (data), (len),			\
 		     (actual_length), (timeout_ms))
-#else
-#define rtw_usb_control_msg(dev, pipe, request, requesttype,		\
-			    value, index, data, size, timeout_ms)	\
-	usb_control_msg((dev), (pipe), (request), (requesttype),	\
-			(value), (index), (data), (size),		\
-			((timeout_ms) == 0) ||				\
-			((timeout_ms)*HZ/1000 > 0) ?			\
-			((timeout_ms)*HZ/1000) : 1)
-#define rtw_usb_bulk_msg(usb_dev, pipe, data, len,			\
-			 actual_length, timeout_ms) \
-	usb_bulk_msg((usb_dev), (pipe), (data), (len), (actual_length), \
-		     ((timeout_ms) == 0) || ((timeout_ms)*HZ/1000 > 0) ?\
-		     ((timeout_ms)*HZ/1000) : 1)
-#endif
 #include <usb_ops_linux.h>
 
 void rtl8188eu_set_hw_type(struct adapter *padapter);
diff --git a/drivers/staging/r8188eu/include/wifi.h b/drivers/staging/r8188eu/include/wifi.h
index 9760989ffc4c..2c56d1d70d03 100644
--- a/drivers/staging/r8188eu/include/wifi.h
+++ b/drivers/staging/r8188eu/include/wifi.h
@@ -714,9 +714,6 @@ enum ht_cap_ampdu_factor {
  * According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2)
  */
 #define IEEE80211_MIN_AMPDU_BUF 0x8
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,19,0))
-#define IEEE80211_MAX_AMPDU_BUF 0x40
-#endif
 
 /* Spatial Multiplexing Power Save Modes */
 #define WLAN_HT_CAP_SM_PS_STATIC	0
diff --git a/drivers/staging/r8188eu/os_dep/mlme_linux.c b/drivers/staging/r8188eu/os_dep/mlme_linux.c
index 22d37e994101..8d78b8697016 100644
--- a/drivers/staging/r8188eu/os_dep/mlme_linux.c
+++ b/drivers/staging/r8188eu/os_dep/mlme_linux.c
@@ -7,47 +7,23 @@
 #include <drv_types.h>
 #include <mlme_osdep.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-void rtw_join_timeout_handler (void *FunctionContext)
-#else
 void rtw_join_timeout_handler (struct timer_list *t)
-#endif
 {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-	struct adapter *adapter = (struct adapter *)FunctionContext;
-#else
 	struct adapter *adapter = from_timer(adapter, t, mlmepriv.assoc_timer);
-#endif
 
 	_rtw_join_timeout_handler(adapter);
 }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-void _rtw_scan_timeout_handler (void *FunctionContext)
-#else
 void _rtw_scan_timeout_handler (struct timer_list *t)
-#endif
 {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-	struct adapter *adapter = (struct adapter *)FunctionContext;
-#else
 	struct adapter *adapter = from_timer(adapter, t, mlmepriv.scan_to_timer);
-#endif
 
 	rtw_scan_timeout_handler(adapter);
 }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-static void _dynamic_check_timer_handlder(void *FunctionContext)
-#else
 static void _dynamic_check_timer_handlder(struct timer_list *t)
-#endif
 {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-	struct adapter *adapter = (struct adapter *)FunctionContext;
-#else
 	struct adapter *adapter = from_timer(adapter, t, mlmepriv.dynamic_chk_timer);
-#endif
 
 	if (adapter->registrypriv.mp_mode == 1)
 		return;
@@ -59,15 +35,9 @@ void rtw_init_mlme_timer(struct adapter *padapter)
 {
 	struct	mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-	_init_timer(&(pmlmepriv->assoc_timer), padapter->pnetdev, rtw_join_timeout_handler, padapter);
-	_init_timer(&(pmlmepriv->scan_to_timer), padapter->pnetdev, _rtw_scan_timeout_handler, padapter);
-	_init_timer(&(pmlmepriv->dynamic_chk_timer), padapter->pnetdev, _dynamic_check_timer_handlder, padapter);
-#else
 	timer_setup(&pmlmepriv->assoc_timer, rtw_join_timeout_handler, 0);
 	timer_setup(&pmlmepriv->scan_to_timer, _rtw_scan_timeout_handler, 0);
 	timer_setup(&pmlmepriv->dynamic_chk_timer, _dynamic_check_timer_handlder, 0);
-#endif
 }
 
 void rtw_os_indicate_connect(struct adapter *adapter)
@@ -169,69 +139,36 @@ void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
 	}
 }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-static void _survey_timer_hdl(void *FunctionContext)
-#else
 static void _survey_timer_hdl(struct timer_list *t)
-#endif
 {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-	struct adapter *padapter = (struct adapter *)FunctionContext;
-#else
 	struct adapter *padapter = from_timer(padapter, t, mlmeextpriv.survey_timer);
-#endif
 
 	survey_timer_hdl(padapter);
 }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-static void _link_timer_hdl(void *FunctionContext)
-#else
 static void _link_timer_hdl(struct timer_list *t)
-#endif
 {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-	struct adapter *padapter = (struct adapter *)FunctionContext;
-#else
 	struct adapter *padapter = from_timer(padapter, t, mlmeextpriv.link_timer);
-#endif
 	link_timer_hdl(padapter);
 }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-static void _addba_timer_hdl(void *FunctionContext)
-#else
 static void _addba_timer_hdl(struct timer_list *t)
-#endif
 {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-	struct sta_info *psta = (struct sta_info *)FunctionContext;
-#else
 	struct sta_info *psta = from_timer(psta, t, addba_retry_timer);
-#endif
 	addba_timer_hdl(psta);
 }
 
 void init_addba_retry_timer(struct adapter *padapter, struct sta_info *psta)
 {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-	_init_timer(&psta->addba_retry_timer, padapter->pnetdev, _addba_timer_hdl, psta);
-#else
 	timer_setup(&psta->addba_retry_timer, _addba_timer_hdl, 0);
-#endif
 }
 
 void init_mlme_ext_timer(struct adapter *padapter)
 {
 	struct	mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-	_init_timer(&pmlmeext->survey_timer, padapter->pnetdev, _survey_timer_hdl, padapter);
-	_init_timer(&pmlmeext->link_timer, padapter->pnetdev, _link_timer_hdl, padapter);
-#else
 	timer_setup(&pmlmeext->survey_timer, _survey_timer_hdl, 0);
 	timer_setup(&pmlmeext->link_timer, _link_timer_hdl, 0);
-#endif
 }
 
 #ifdef CONFIG_88EU_AP_MODE
diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
index 2cf91516d739..454b94b037f3 100644
--- a/drivers/staging/r8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
@@ -3,7 +3,6 @@
 
 #define _OS_INTFS_C_
 
-#include <linux/version.h>
 #include <osdep_service.h>
 #include <drv_types.h>
 #include <xmit_osdep.h>
diff --git a/drivers/staging/r8188eu/os_dep/recv_linux.c b/drivers/staging/r8188eu/os_dep/recv_linux.c
index 558050c62bb1..5af8ffac870b 100644
--- a/drivers/staging/r8188eu/os_dep/recv_linux.c
+++ b/drivers/staging/r8188eu/os_dep/recv_linux.c
@@ -179,11 +179,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter,
 	}
 
 	rcu_read_lock();
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
 	rcu_dereference(padapter->pnetdev->rx_handler_data);
-#else
-	rcu_dereference(padapter->pnetdev->br_port);
-#endif
 	rcu_read_unlock();
 
 	skb->ip_summed = CHECKSUM_NONE;
@@ -226,19 +222,11 @@ void rtw_os_read_port(struct adapter *padapter, struct recv_buf *precvbuf)
 			      (unsigned char *)precvbuf);
 }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-static void _rtw_reordering_ctrl_timeout_handler(void *func_context)
-#else
 static void _rtw_reordering_ctrl_timeout_handler(struct timer_list *t)
-#endif
 {
 	struct recv_reorder_ctrl *preorder_ctrl;
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-	preorder_ctrl = (struct recv_reorder_ctrl *)func_context;
-#else
 	preorder_ctrl = from_timer(preorder_ctrl, t, reordering_ctrl_timer);
-#endif
 	rtw_reordering_ctrl_timeout_handler(preorder_ctrl);
 }
 
@@ -246,9 +234,5 @@ void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl)
 {
 	struct adapter *padapter = preorder_ctrl->padapter;
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-	_init_timer(&(preorder_ctrl->reordering_ctrl_timer), padapter->pnetdev, _rtw_reordering_ctrl_timeout_handler, preorder_ctrl);
-#else
 	timer_setup(&preorder_ctrl->reordering_ctrl_timer, _rtw_reordering_ctrl_timeout_handler, 0);
-#endif
 }
-- 
2.32.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3/6] staging: r8188eu: Remove include/rtw_qos.h
  2021-07-29 17:09 [PATCH 0/6] Do more cleanup of the new rtl8188eu driver Larry Finger
  2021-07-29 17:09 ` [PATCH 1/6] staging: r8188eu: Remove empty header file Larry Finger
  2021-07-29 17:09 ` [PATCH 2/6] staging: r8188eu: Remove tests of kernel version Larry Finger
@ 2021-07-29 17:09 ` Larry Finger
  2021-07-29 17:09 ` [PATCH 4/6] staging: r8188eu: Remove header file include/usb_hal.h Larry Finger
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Larry Finger @ 2021-07-29 17:09 UTC (permalink / raw)
  To: gregkh; +Cc: phil, linux-staging, linux-kernel, Larry Finger

This header file merely defines a single struct. Move that definition
to the header file that uses it, and delete rtw_qos.h.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/staging/r8188eu/include/drv_types.h |  1 -
 drivers/staging/r8188eu/include/rtw_mlme.h  |  6 ++++++
 drivers/staging/r8188eu/include/rtw_qos.h   | 14 --------------
 3 files changed, 6 insertions(+), 15 deletions(-)
 delete mode 100644 drivers/staging/r8188eu/include/rtw_qos.h

diff --git a/drivers/staging/r8188eu/include/drv_types.h b/drivers/staging/r8188eu/include/drv_types.h
index eed807d5dbc2..0acc5847a602 100644
--- a/drivers/staging/r8188eu/include/drv_types.h
+++ b/drivers/staging/r8188eu/include/drv_types.h
@@ -22,7 +22,6 @@
 #include <rtw_recv.h>
 #include <hal_intf.h>
 #include <hal_com.h>
-#include <rtw_qos.h>
 #include <rtw_security.h>
 #include <rtw_pwrctrl.h>
 #include <rtw_io.h>
diff --git a/drivers/staging/r8188eu/include/rtw_mlme.h b/drivers/staging/r8188eu/include/rtw_mlme.h
index 3ef1a008c602..d5b479ae7799 100644
--- a/drivers/staging/r8188eu/include/rtw_mlme.h
+++ b/drivers/staging/r8188eu/include/rtw_mlme.h
@@ -313,6 +313,12 @@ struct tdls_info {
 	u8 enable;
 };
 
+struct qos_priv {
+	/* bit mask option: u-apsd,
+	 * s-apsd, ts, block ack... */
+	unsigned int qos_option;
+};
+
 struct mlme_priv {
 	spinlock_t lock;
 	int fw_state;	/* shall we protect this variable? maybe not necessarily... */
diff --git a/drivers/staging/r8188eu/include/rtw_qos.h b/drivers/staging/r8188eu/include/rtw_qos.h
deleted file mode 100644
index 3150e00b8d3a..000000000000
--- a/drivers/staging/r8188eu/include/rtw_qos.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
-/* Copyright(c) 2007 - 2011 Realtek Corporation. */
-
-#ifndef _RTW_QOS_H_
-#define _RTW_QOS_H_
-
-#include <osdep_service.h>
-
-struct	qos_priv	{
-	unsigned int	  qos_option;	/* bit mask option: u-apsd,
-					 * s-apsd, ts, block ack... */
-};
-
-#endif	/* _RTL871X_QOS_H_ */
-- 
2.32.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 4/6] staging: r8188eu: Remove header file include/usb_hal.h
  2021-07-29 17:09 [PATCH 0/6] Do more cleanup of the new rtl8188eu driver Larry Finger
                   ` (2 preceding siblings ...)
  2021-07-29 17:09 ` [PATCH 3/6] staging: r8188eu: Remove include/rtw_qos.h Larry Finger
@ 2021-07-29 17:09 ` Larry Finger
  2021-07-29 17:09 ` [PATCH 5/6] staging: r8188eu: Remove header file include/rtw_version.h Larry Finger
  2021-07-29 17:09 ` [PATCH 6/6] staging: r8188eu: Add "fallthrough" statement to quiet compiler Larry Finger
  5 siblings, 0 replies; 8+ messages in thread
From: Larry Finger @ 2021-07-29 17:09 UTC (permalink / raw)
  To: gregkh; +Cc: phil, linux-staging, linux-kernel, Larry Finger

This header only includes one prototype and one define statement. The
new definition is used once, thus it can be removed. The prototype is
moved to a header that is already called by the supplier and the user
of that routine, thus the small header is removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/staging/r8188eu/hal/hal_intf.c     |  1 -
 drivers/staging/r8188eu/hal/usb_halinit.c  |  1 -
 drivers/staging/r8188eu/include/hal_intf.h |  1 +
 drivers/staging/r8188eu/include/usb_hal.h  | 10 ----------
 drivers/staging/r8188eu/os_dep/os_intfs.c  |  1 -
 drivers/staging/r8188eu/os_dep/usb_intf.c  |  3 +--
 6 files changed, 2 insertions(+), 15 deletions(-)
 delete mode 100644 drivers/staging/r8188eu/include/usb_hal.h

diff --git a/drivers/staging/r8188eu/hal/hal_intf.c b/drivers/staging/r8188eu/hal/hal_intf.c
index 4dda247e386a..02d76ac782d8 100644
--- a/drivers/staging/r8188eu/hal/hal_intf.c
+++ b/drivers/staging/r8188eu/hal/hal_intf.c
@@ -5,7 +5,6 @@
 #include <osdep_service.h>
 #include <drv_types.h>
 #include <hal_intf.h>
-#include <usb_hal.h>
 
 void rtw_hal_chip_configure(struct adapter *adapt)
 {
diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 8ecb94728462..f784d8dcdd34 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -11,7 +11,6 @@
 #include <rtl8188e_led.h>
 #include <rtw_iol.h>
 #include <usb_ops.h>
-#include <usb_hal.h>
 #include <usb_osintf.h>
 
 #define		HAL_MAC_ENABLE	1
diff --git a/drivers/staging/r8188eu/include/hal_intf.h b/drivers/staging/r8188eu/include/hal_intf.h
index c829aee518dd..d64fcda37100 100644
--- a/drivers/staging/r8188eu/include/hal_intf.h
+++ b/drivers/staging/r8188eu/include/hal_intf.h
@@ -309,6 +309,7 @@ enum hardware_type {
 
 #define is_boot_from_eeprom(adapter) (adapter->eeprompriv.EepromOrEfuse)
 
+void rtl8188eu_set_hal_ops(struct adapter *padapter);
 void rtw_hal_def_value_init(struct adapter *padapter);
 
 void	rtw_hal_free_data(struct adapter *padapter);
diff --git a/drivers/staging/r8188eu/include/usb_hal.h b/drivers/staging/r8188eu/include/usb_hal.h
deleted file mode 100644
index 584602c40cca..000000000000
--- a/drivers/staging/r8188eu/include/usb_hal.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
-/* Copyright(c) 2007 - 2011 Realtek Corporation. */
-
-#ifndef __USB_HAL_H__
-#define __USB_HAL_H__
-
-void rtl8188eu_set_hal_ops(struct adapter *padapter);
-#define hal_set_hal_ops	rtl8188eu_set_hal_ops
-
-#endif /* __USB_HAL_H__ */
diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
index 454b94b037f3..34af5237d9e6 100644
--- a/drivers/staging/r8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
@@ -12,7 +12,6 @@
 #include <rtw_version.h>
 
 #include <usb_osintf.h>
-#include <usb_hal.h>
 #include <rtw_br_ext.h>
 #include <linux/version.h>
 
diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index 9be70ed65072..905a08ebd80d 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -15,7 +15,6 @@
 #include <usb_vendor_req.h>
 #include <usb_ops.h>
 #include <usb_osintf.h>
-#include <usb_hal.h>
 #include <rtw_ioctl.h>
 
 int ui_pid[3] = {0, 0, 0};
@@ -628,7 +627,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
 	padapter = rtw_netdev_priv(pnetdev);
 
 	/* step 2. hook HalFunc, allocate HalData */
-	hal_set_hal_ops(padapter);
+	rtl8188eu_set_hal_ops(padapter);
 
 	padapter->intf_start = &usb_intf_start;
 	padapter->intf_stop = &usb_intf_stop;
-- 
2.32.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 5/6] staging: r8188eu: Remove header file include/rtw_version.h
  2021-07-29 17:09 [PATCH 0/6] Do more cleanup of the new rtl8188eu driver Larry Finger
                   ` (3 preceding siblings ...)
  2021-07-29 17:09 ` [PATCH 4/6] staging: r8188eu: Remove header file include/usb_hal.h Larry Finger
@ 2021-07-29 17:09 ` Larry Finger
  2021-07-30  8:23   ` Greg KH
  2021-07-29 17:09 ` [PATCH 6/6] staging: r8188eu: Add "fallthrough" statement to quiet compiler Larry Finger
  5 siblings, 1 reply; 8+ messages in thread
From: Larry Finger @ 2021-07-29 17:09 UTC (permalink / raw)
  To: gregkh; +Cc: phil, linux-staging, linux-kernel, Larry Finger

This file contains only the definition of the driver version. This statement
is moved into a header called by all the affected source files, and the now
empty header is deleted.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/staging/r8188eu/core/rtw_debug.c      | 2 +-
 drivers/staging/r8188eu/include/drv_types.h   | 2 ++
 drivers/staging/r8188eu/include/rtw_version.h | 2 --
 drivers/staging/r8188eu/os_dep/ioctl_linux.c  | 1 -
 drivers/staging/r8188eu/os_dep/os_intfs.c     | 1 -
 drivers/staging/r8188eu/os_dep/usb_intf.c     | 1 -
 6 files changed, 3 insertions(+), 6 deletions(-)
 delete mode 100644 drivers/staging/r8188eu/include/rtw_version.h

diff --git a/drivers/staging/r8188eu/core/rtw_debug.c b/drivers/staging/r8188eu/core/rtw_debug.c
index 522fd59c2d50..a0ca61d8c3b8 100644
--- a/drivers/staging/r8188eu/core/rtw_debug.c
+++ b/drivers/staging/r8188eu/core/rtw_debug.c
@@ -4,7 +4,7 @@
 #define _RTW_DEBUG_C_
 
 #include <rtw_debug.h>
-#include <rtw_version.h>
+#include <drv_types.h>
 
 int proc_get_drv_version(char *page, char **start,
 			  off_t offset, int count,
diff --git a/drivers/staging/r8188eu/include/drv_types.h b/drivers/staging/r8188eu/include/drv_types.h
index 0acc5847a602..d407d9274a78 100644
--- a/drivers/staging/r8188eu/include/drv_types.h
+++ b/drivers/staging/r8188eu/include/drv_types.h
@@ -38,6 +38,8 @@
 #include <rtw_mp.h>
 #include <rtw_br_ext.h>
 
+#define DRIVERVERSION	"v4.1.4_6773.20130222"
+
 enum _NIC_VERSION {
 	RTL8711_NIC,
 	RTL8712_NIC,
diff --git a/drivers/staging/r8188eu/include/rtw_version.h b/drivers/staging/r8188eu/include/rtw_version.h
deleted file mode 100644
index 4ca74a9465fe..000000000000
--- a/drivers/staging/r8188eu/include/rtw_version.h
+++ /dev/null
@@ -1,2 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
-#define DRIVERVERSION	"v4.1.4_6773.20130222"
diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
index 37973930845d..109389549435 100644
--- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
@@ -14,7 +14,6 @@
 #include <rtw_ioctl_set.h>
 #include <rtw_mp_ioctl.h>
 #include <usb_ops.h>
-#include <rtw_version.h>
 #include <rtl8188e_hal.h>
 
 #include <rtw_mp.h>
diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
index 34af5237d9e6..cf92dc2a4fcc 100644
--- a/drivers/staging/r8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
@@ -9,7 +9,6 @@
 #include <recv_osdep.h>
 #include <hal_intf.h>
 #include <rtw_ioctl.h>
-#include <rtw_version.h>
 
 #include <usb_osintf.h>
 #include <rtw_br_ext.h>
diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index 905a08ebd80d..7db33946e418 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -8,7 +8,6 @@
 #include <recv_osdep.h>
 #include <xmit_osdep.h>
 #include <hal_intf.h>
-#include <rtw_version.h>
 #include <linux/usb.h>
 #include <osdep_intf.h>
 
-- 
2.32.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 6/6] staging: r8188eu: Add "fallthrough" statement to quiet compiler
  2021-07-29 17:09 [PATCH 0/6] Do more cleanup of the new rtl8188eu driver Larry Finger
                   ` (4 preceding siblings ...)
  2021-07-29 17:09 ` [PATCH 5/6] staging: r8188eu: Remove header file include/rtw_version.h Larry Finger
@ 2021-07-29 17:09 ` Larry Finger
  5 siblings, 0 replies; 8+ messages in thread
From: Larry Finger @ 2021-07-29 17:09 UTC (permalink / raw)
  To: gregkh; +Cc: phil, linux-staging, linux-kernel, Larry Finger

Compiler gcc11, and possibly others, emit a warning when a fall-through
case is found in a switch statement. Add a "fallthrough" statement to
eliminate this warning.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/staging/r8188eu/core/rtw_mlme_ext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
index 021044768b61..488a18133e59 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
@@ -460,7 +460,7 @@ void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame)
 			ptable->func = &OnAuth;
 		else
 			ptable->func = &OnAuthClient;
-		/* fall through */
+		fallthrough;
 	case WIFI_ASSOCREQ:
 	case WIFI_REASSOCREQ:
 		_mgt_dispatcher(padapter, ptable, precv_frame);
-- 
2.32.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 5/6] staging: r8188eu: Remove header file include/rtw_version.h
  2021-07-29 17:09 ` [PATCH 5/6] staging: r8188eu: Remove header file include/rtw_version.h Larry Finger
@ 2021-07-30  8:23   ` Greg KH
  0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2021-07-30  8:23 UTC (permalink / raw)
  To: Larry Finger; +Cc: phil, linux-staging, linux-kernel

On Thu, Jul 29, 2021 at 12:09:29PM -0500, Larry Finger wrote:
> This file contains only the definition of the driver version. This statement
> is moved into a header called by all the affected source files, and the now
> empty header is deleted.

And now that the driver is in the tree, the "version" can be removed
entirely.  But that's for a later patch :)

Thanks for all of these cleanups, now applied.

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-07-30  8:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-29 17:09 [PATCH 0/6] Do more cleanup of the new rtl8188eu driver Larry Finger
2021-07-29 17:09 ` [PATCH 1/6] staging: r8188eu: Remove empty header file Larry Finger
2021-07-29 17:09 ` [PATCH 2/6] staging: r8188eu: Remove tests of kernel version Larry Finger
2021-07-29 17:09 ` [PATCH 3/6] staging: r8188eu: Remove include/rtw_qos.h Larry Finger
2021-07-29 17:09 ` [PATCH 4/6] staging: r8188eu: Remove header file include/usb_hal.h Larry Finger
2021-07-29 17:09 ` [PATCH 5/6] staging: r8188eu: Remove header file include/rtw_version.h Larry Finger
2021-07-30  8:23   ` Greg KH
2021-07-29 17:09 ` [PATCH 6/6] staging: r8188eu: Add "fallthrough" statement to quiet compiler Larry Finger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).