staging: r8188eu: remove cmd_osdep.h header file
PATCH 1/1 staging: r8188eu: remove cmd_osdep.h header file
All functions declared in the cmd_osdep.h header file are only used in a single c source file. Make the functions static and remove the header file and its includes.
Signed-off-by Michael Straube <[email protected]>
--- drivers/staging/r8188eu/core/rtw_cmd.c | 11 +++++------ drivers/staging/r8188eu/hal/rtl8188e_cmd.c | 1 - drivers/staging/r8188eu/include/cmd_osdep.h | 16 ---------------- 3 files changed, 5 insertions(+), 23 deletions(-) delete mode 100644 drivers/staging/r8188eu/include/cmd_osdep.h
drivers/staging/r8188eu/core/rtw_cmd.c +5 -6
@@ -6,7 +6,6 @@#include "../include/osdep_service.h" #include "../include/drv_types.h" #include "../include/recv_osdep.h" -#include "../include/cmd_osdep.h" #include "../include/mlme_osdep.h" #include "../include/rtw_br_ext.h" #include "../include/rtw_mlme_ext.h"
@@ -16,7 +15,7 @@ Caller and the rtw_cmd_thread can protect cmd_q by spin_lock.No irqsave is necessary. */ -int _rtw_init_cmd_priv (struct cmd_priv *pcmdpriv) +static int _rtw_init_cmd_priv (struct cmd_priv *pcmdpriv) {int res = _SUCCESS;
@@ -59,7 +58,7 @@ int _rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)static void c2h_wk_callback (struct work_struct *work); -int _rtw_init_evt_priv (struct evt_priv *pevtpriv) +static int _rtw_init_evt_priv (struct evt_priv *pevtpriv) {int res = _SUCCESS;
@@ -87,7 +86,7 @@ void rtw_free_evt_priv(struct evt_priv *pevtpriv) } } -void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv) +static void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv) {if (pcmdpriv) {kfree (pcmdpriv->cmd_allocated_buf);
@@ -105,7 +104,7 @@ ISR/Call-Back functions can't call this sub-function.*/ -int _rtw_enqueue_cmd (struct __queue *queue,struct cmd_obj *obj) +static int _rtw_enqueue_cmd (struct __queue *queue,struct cmd_obj *obj) {unsigned long flags;
@@ -123,7 +122,7 @@ int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj)return _SUCCESS; } -struct cmd_obj *_rtw_dequeue_cmd (struct __queue *queue) +static struct cmd_obj *_rtw_dequeue_cmd (struct __queue *queue) {struct cmd_obj *obj;unsigned long flags;
drivers/staging/r8188eu/hal/rtl8188e_cmd.c +0 -1
@@ -6,7 +6,6 @@#include "../include/osdep_service.h" #include "../include/drv_types.h" #include "../include/recv_osdep.h" -#include "../include/cmd_osdep.h" #include "../include/mlme_osdep.h" #include "../include/rtw_ioctl_set.h"
drivers/staging/r8188eu/include/cmd_osdep.h deleted +0 -16
@@ -1,16 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ -/* Copyright(c) 2007 - 2011 Realtek Corporation. */ - -#ifndef __CMD_OSDEP_H_ -#define __CMD_OSDEP_H_ - -#include "osdep_service.h" -#include "drv_types.h" - -extern int _rtw_init_cmd_priv (struct cmd_priv *pcmdpriv); -extern int _rtw_init_evt_priv (struct evt_priv *pevtpriv); -extern void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv); -extern int _rtw_enqueue_cmd (struct __queue *queue,struct cmd_obj *obj); -extern struct cmd_obj *_rtw_dequeue_cmd (struct __queue *queue); - -#endif
Signature · 1 line
2.32.0
Quoted 105 lines · Michael Straube
All functions declared in the
cmd_osdep.hheader file are only used in a single c source file. Make the functions static and remove the header file and its includes.Signed-off-by Michael Straube <[email protected]>--- drivers/staging/r8188eu/core/rtw_cmd.c | 11 +++++------ drivers/staging/r8188eu/hal/rtl8188e_cmd.c | 1 - drivers/staging/r8188eu/include/cmd_osdep.h | 16 ---------------- 3 files changed, 5 insertions(+), 23 deletions(-) delete mode 100644 drivers/staging/r8188eu/include/cmd_osdep.hdrivers/staging/r8188eu/core/rtw_cmd.c +5
-6@@ -6,7 +6,6 @@#include "../include/osdep_service.h" #include "../include/drv_types.h" #include "../include/recv_osdep.h" -#include "../include/cmd_osdep.h" #include "../include/mlme_osdep.h" #include "../include/rtw_br_ext.h" #include "../include/rtw_mlme_ext.h" @@ -16,7 +15,7 @@ Caller and the rtw_cmd_thread can protect cmd_q by spin_lock.No irqsave is necessary. */ -int _rtw_init_cmd_priv (struct cmd_priv *pcmdpriv) +static int _rtw_init_cmd_priv (struct cmd_priv *pcmdpriv) {int res = _SUCCESS;@@ -59,7 +58,7 @@ int _rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)static void c2h_wk_callback (struct work_struct *work); -int _rtw_init_evt_priv (struct evt_priv *pevtpriv) +static int _rtw_init_evt_priv (struct evt_priv *pevtpriv) {int res = _SUCCESS;@@ -87,7 +86,7 @@ void rtw_free_evt_priv(struct evt_priv *pevtpriv) } } -void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv) +static void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv) {if (pcmdpriv) {kfree (pcmdpriv->cmd_allocated_buf);@@ -105,7 +104,7 @@ ISR/Call-Back functions can't call this sub-function.*/ -int _rtw_enqueue_cmd (struct __queue *queue,struct cmd_obj *obj) +static int _rtw_enqueue_cmd (struct __queue *queue,struct cmd_obj *obj) {unsigned long flags;@@ -123,7 +122,7 @@ int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj)return _SUCCESS; } -struct cmd_obj *_rtw_dequeue_cmd (struct __queue *queue) +static struct cmd_obj *_rtw_dequeue_cmd (struct __queue *queue) {struct cmd_obj *obj;unsigned long flags;drivers/staging/r8188eu/hal/rtl8188e_cmd.c +0
-1@@ -6,7 +6,6 @@#include "../include/osdep_service.h" #include "../include/drv_types.h" #include "../include/recv_osdep.h" -#include "../include/cmd_osdep.h" #include "../include/mlme_osdep.h" #include "../include/rtw_ioctl_set.h" drivers/staging/r8188eu/include/cmd_osdep.h deleted +0
-17@@ -1,16 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ -/* Copyright(c) 2007 - 2011 Realtek Corporation. */ - -#ifndef __CMD_OSDEP_H_ -#define __CMD_OSDEP_H_ - -#include "osdep_service.h" -#include "drv_types.h" - -extern int _rtw_init_cmd_priv (struct cmd_priv *pcmdpriv); -extern int _rtw_init_evt_priv (struct evt_priv *pevtpriv); -extern void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv); -extern int _rtw_enqueue_cmd (struct __queue *queue,struct cmd_obj *obj); -extern struct cmd_obj *_rtw_dequeue_cmd (struct __queue *queue); - -#endif --
Quoted 2 lines
2.32.0
Looks good to me, thanks.
Acked-by Phillip Potter <[email protected]>
Regards,
Phil