Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754758AbbKHG62 (ORCPT ); Sun, 8 Nov 2015 01:58:28 -0500 Received: from mail-lb0-f181.google.com ([209.85.217.181]:35041 "EHLO mail-lb0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753624AbbKHG6V (ORCPT ); Sun, 8 Nov 2015 01:58:21 -0500 Date: Sun, 8 Nov 2015 13:43:08 +0700 From: Ivan Safonov To: devel@driverdev.osuosl.org Cc: Greg Kroah-Hartman , Vaishali Thakkar , Jakub Sitnicki , Anish Bhatt , Joe Perches , Ivan Safonov , Nicholas Mc Guire , Alexey Khoroshilov , =?iso-8859-1?Q?R=E9my?= Oudompheng , Sudip Mukherjee , Shraddha Barke , linux-kernel@vger.kernel.org Subject: [PATCH 04/12] staging: rtl8188eu: remove unused hal_data_8188e members Message-ID: <20151108064308.GA1090@alpha.sfu-kras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3830 Lines: 109 u8 *pfirmware and u32 fwsize of hal_data_8188e structure not used. The pfwdata variable used to store a pointer to the buffer in rtl88eu_download_fw and the pfwbody variable points to the body of the firmware (without header). Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/fw.c | 16 ++++++++-------- drivers/staging/rtl8188eu/include/rtl8188e_hal.h | 2 -- drivers/staging/rtl8188eu/os_dep/os_intfs.c | 4 ---- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c index 3e354eb..1d8930a 100644 --- a/drivers/staging/rtl8188eu/hal/fw.c +++ b/drivers/staging/rtl8188eu/hal/fw.c @@ -170,13 +170,12 @@ exit: int rtl88eu_download_fw(struct adapter *adapt) { - struct hal_data_8188e *rtlhal = GET_HAL_DATA(adapt); struct dvobj_priv *dvobj = adapter_to_dvobj(adapt); struct device *device = dvobj_to_dev(dvobj); const struct firmware *fw; const char fw_name[] = "rtlwifi/rtl8188eufw.bin"; struct rtl92c_firmware_header *pfwheader = NULL; - u8 *pfwdata; + u8 *pfwdata, *pfwbody; u32 fwsize; if (request_firmware(&fw, fw_name, device)) { @@ -194,17 +193,17 @@ int rtl88eu_download_fw(struct adapter *adapt) if (!pfwdata) return -ENOMEM; - rtlhal->pfirmware = pfwdata; - memcpy(rtlhal->pfirmware, fw->data, fw->size); - rtlhal->fwsize = fw->size; + memcpy(pfwdata, fw->data, fw->size); + fwsize = fw->size; release_firmware(fw); - fwsize = rtlhal->fwsize; pfwheader = (struct rtl92c_firmware_header *)pfwdata; if (IS_FW_HEADER_EXIST(pfwheader)) { - pfwdata = pfwdata + 32; + pfwbody = pfwdata + 32; fwsize = fwsize - 32; + } else { + pfwbody = pfwdata; } if (usb_read8(adapt, REG_MCUFWDL) & RAM_DL_SEL) { @@ -213,8 +212,9 @@ int rtl88eu_download_fw(struct adapter *adapt) } _rtl88e_enable_fw_download(adapt, true); usb_write8(adapt, REG_MCUFWDL, usb_read8(adapt, REG_MCUFWDL) | FWDL_ChkSum_rpt); - _rtl88e_write_fw(adapt, pfwdata, fwsize); + _rtl88e_write_fw(adapt, pfwbody, fwsize); _rtl88e_enable_fw_download(adapt, false); + kfree(pfwdata); return _rtl88e_fw_free_to_go(adapt); } diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h index cbad364..9f5050e 100644 --- a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h +++ b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h @@ -191,8 +191,6 @@ struct txpowerinfo24g { struct hal_data_8188e { struct HAL_VERSION VersionID; u16 CustomerID; - u8 *pfirmware; - u32 fwsize; u16 FirmwareVersion; u16 FirmwareVersionRev; u16 FirmwareSubVersion; diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c index 9201b94..2cca5d2 100644 --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c @@ -1157,7 +1157,6 @@ int pm_netdev_open(struct net_device *pnetdev, u8 bnormal) static int netdev_close(struct net_device *pnetdev) { struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev); - struct hal_data_8188e *rtlhal = GET_HAL_DATA(padapter); RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+88eu_drv - drv_close\n")); @@ -1190,9 +1189,6 @@ static int netdev_close(struct net_device *pnetdev) rtw_led_control(padapter, LED_CTL_POWER_OFF); } - kfree(rtlhal->pfirmware); - rtlhal->pfirmware = NULL; - RT_TRACE(_module_os_intfs_c_, _drv_info_, ("-88eu_drv - drv_close\n")); DBG_88E("-88eu_drv - drv_close, bup =%d\n", padapter->bup); return 0; -- 2.4.10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/