* [PATCH 1/2] staging: r8822be: Remove some dead code
2017-08-30 19:43 [PATCH 0/2] staging: r8822be: Remove some left-over debug code Larry Finger
@ 2017-08-30 19:43 ` Larry Finger
2017-08-30 19:43 ` [PATCH 2/2] staging: r8822be: Simplify deinit_priv() Larry Finger
1 sibling, 0 replies; 3+ messages in thread
From: Larry Finger @ 2017-08-30 19:43 UTC (permalink / raw)
To: gregkh
Cc: devel, Yan-Hsuan Chuang, netdev, Birming Chiu, Steven Ting,
Larry Finger
The code found inside an #ifdef CONFIG_RTL_DEBUG ... #endif section
is left over from debugging of the original driver, and should be
deleted.
Reported by: Andreas Ziegler <andreas.ziegler@fau.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
---
drivers/staging/rtlwifi/halmac/rtl_halmac.c | 20 --------------------
1 file changed, 20 deletions(-)
diff --git a/drivers/staging/rtlwifi/halmac/rtl_halmac.c b/drivers/staging/rtlwifi/halmac/rtl_halmac.c
index 031bf2c6078f..2b1c5fae64ef 100644
--- a/drivers/staging/rtlwifi/halmac/rtl_halmac.c
+++ b/drivers/staging/rtlwifi/halmac/rtl_halmac.c
@@ -386,26 +386,6 @@ static void deinit_priv(struct rtl_halmac *halmac)
u32 count, size;
count = HALMAC_FEATURE_ALL + 1;
-#ifdef CONFIG_RTL_DEBUG
- {
- struct submit_ctx *sctx;
- u32 i;
-
- for (i = 0; i < count; i++) {
- if (!indicator[i].sctx)
- continue;
-
- RT_TRACE(
- rtlpriv, COMP_HALMAC, DBG_LOUD,
- "%s: <WARN> %s id(%d) sctx still exist!!\n",
- __func__, RTL_HALMAC_FEATURE_NAME[i],
- i);
- sctx = indicator[i].sctx;
- indicator[i].sctx = NULL;
- rtl_mfree((u8 *)sctx, sizeof(*sctx));
- }
- }
-#endif /* !CONFIG_RTL_DEBUG */
size = sizeof(*indicator) * count;
kfree((u8 *)indicator);
}
--
2.12.3
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH 2/2] staging: r8822be: Simplify deinit_priv()
2017-08-30 19:43 [PATCH 0/2] staging: r8822be: Remove some left-over debug code Larry Finger
2017-08-30 19:43 ` [PATCH 1/2] staging: r8822be: Remove some dead code Larry Finger
@ 2017-08-30 19:43 ` Larry Finger
1 sibling, 0 replies; 3+ messages in thread
From: Larry Finger @ 2017-08-30 19:43 UTC (permalink / raw)
To: gregkh
Cc: netdev, devel, Larry Finger, Ping-Ke Shih, Yan-Hsuan Chuang,
Birming Chiu, Shaofu, Steven Ting
Now that the extraneous debugging code is removed, routine deinit_priv()
clearly contains code that serves no useful purpose.
A null test before a call to kfree() and a spurious cast are also removed.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
---
drivers/staging/rtlwifi/halmac/rtl_halmac.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/staging/rtlwifi/halmac/rtl_halmac.c b/drivers/staging/rtlwifi/halmac/rtl_halmac.c
index 2b1c5fae64ef..6448a8bfc14b 100644
--- a/drivers/staging/rtlwifi/halmac/rtl_halmac.c
+++ b/drivers/staging/rtlwifi/halmac/rtl_halmac.c
@@ -382,13 +382,7 @@ static void deinit_priv(struct rtl_halmac *halmac)
indicator = halmac->indicator;
halmac->indicator = NULL;
- if (indicator) {
- u32 count, size;
-
- count = HALMAC_FEATURE_ALL + 1;
- size = sizeof(*indicator) * count;
- kfree((u8 *)indicator);
- }
+ kfree(indicator);
}
int rtl_halmac_init_adapter(struct rtl_priv *rtlpriv)
--
2.12.3
^ permalink raw reply related [flat|nested] 3+ messages in thread