From 589945844266b4450be7008f40ca6b0359b73dee Mon Sep 17 00:00:00 2001 From: Jason Yan Date: Mon, 27 Apr 2020 11:23:37 +0800 Subject: staging: rtl8723bs: os_dep: remove set but not used 'size' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And also remove the NULL check before kfree() because kfree() can handle NULL pointers correctly. Fix the following gcc warning: drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:157:6: warning: variable ‘size’ set but not used [-Wunused-but-set-variable] u32 size = 0; ^~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20200427032342.27211-3-yanaijie@huawei.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'drivers/staging/rtl8723bs') diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index 1ba85a43f05a..b037868fbf22 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -154,17 +154,6 @@ exit: static void rtw_spt_band_free(struct ieee80211_supported_band *spt_band) { - u32 size = 0; - - if (!spt_band) - return; - - if (spt_band->band == NL80211_BAND_2GHZ) - { - size = sizeof(struct ieee80211_supported_band) - + sizeof(struct ieee80211_channel)*RTW_2G_CHANNELS_NUM - + sizeof(struct ieee80211_rate)*RTW_G_RATES_NUM; - } kfree(spt_band); } -- cgit v1.2.3