staging: r8822be: Simplify deinit_priv()
authorLarry Finger <Larry.Finger@lwfinger.net>
Wed, 30 Aug 2017 19:43:13 +0000 (14:43 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Aug 2017 16:29:33 +0000 (18:29 +0200)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtlwifi/halmac/rtl_halmac.c

index 2b1c5fa..6448a8b 100644 (file)
@@ -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)