From: Ivan Safonov <insafonov@gmail.com>
To: devel@driverdev.osuosl.org
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Vaishali Thakkar" <vthakkar1994@gmail.com>,
"Jakub Sitnicki" <jsitnicki@gmail.com>,
"Anish Bhatt" <anish@gatech.edu>, "Joe Perches" <joe@perches.com>,
"Ivan Safonov" <insafonov@gmail.com>,
"Nicholas Mc Guire" <der.herr@hofr.at>,
"Alexey Khoroshilov" <khoroshilov@ispras.ru>,
"Rémy Oudompheng" <remyoudompheng@gmail.com>,
"Sudip Mukherjee" <sudipm.mukherjee@gmail.com>,
"Shraddha Barke" <shraddha.6596@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH v2 04/12] staging: rtl8188eu: remove unused hal_data_8188e members
Date: Sun, 8 Nov 2015 14:10:40 +0700 [thread overview]
Message-ID: <20151108071040.GA1493@alpha.sfu-kras.ru> (raw)
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 <insafonov@gmail.com>
---
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
reply other threads:[~2015-11-08 7:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151108071040.GA1493@alpha.sfu-kras.ru \
--to=insafonov@gmail.com \
--cc=anish@gatech.edu \
--cc=der.herr@hofr.at \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=jsitnicki@gmail.com \
--cc=khoroshilov@ispras.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=remyoudompheng@gmail.com \
--cc=shraddha.6596@gmail.com \
--cc=sudipm.mukherjee@gmail.com \
--cc=vthakkar1994@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®