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 2b1c5fae64ef885da6a5c779ac3d10db0c2a8704..6448a8bfc14b71f5b674a38ecebf6d3d26900b2b 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)