diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-15 18:06:13 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-15 18:06:13 -0800 |
| commit | dab363f938a53ddaee60bfecc1aebdbb3d3af5f0 (patch) | |
| tree | ccdb11a6e6191ba71fbc7716714c47b79172070d /drivers/staging/rtl8712 | |
| parent | a68db9cb858d10820add66682ad4d412f9914288 (diff) | |
| parent | 17d2c6439be65777245914be354c5a97c76ad246 (diff) | |
| download | linux-dab363f938a53ddaee60bfecc1aebdbb3d3af5f0.tar.gz linux-dab363f938a53ddaee60bfecc1aebdbb3d3af5f0.tar.bz2 linux-dab363f938a53ddaee60bfecc1aebdbb3d3af5f0.zip | |
Merge tag 'staging-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver updates from Greg KH:
"Here's the big staging tree pull request for 3.19-rc1.
We continued to delete more lines than were added, always a good
thing, but not at a huge rate this release, only about 70k lines
removed overall mostly from removing the horrid bcm driver.
Lots of normal staging driver cleanups and fixes all over the place,
well over a thousand of them, the shortlog shows all the horrid
details.
The "contentious" thing here is the movement of the Android binder
code out of staging into the "real" part of the kernel. This is code
that has been stable for a few years now and is working as-is in the
tens of millions of devices with no issues. Yes, the code is horrid,
and the userspace api leaves a lot to be desired, but it's not going
to change due to legacy issues that we have no control over. Because
so many devices and companies rely on this, and the code is stable,
might as well promote it out of staging.
This was all discussed at the Linux Plumbers conference, and everyone
participating agreed that this was the best way forward.
There is work happening to replace the binder code with something new
that is happening right now, but I don't expect to see the results of
that work for another year at the earliest. If that ever happens, and
Android switches over to it, I'll gladly remove this version.
As for maintainers, I'll be glad to maintain this code, I've been
doing it for the past few years with no problems. I'll send a
MAINTAINERS entry for it before 3.19-final is out, still need to talk
to the Google developers about if they are willing to help with it or
not, last I checked they were, which was good.
All of these patches have been in linux-next for a while with no
reported issues"
* tag 'staging-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1382 commits)
Staging: slicoss: Fix long line issues in slicoss.c
staging: rtl8712: remove unnecessary else after return
staging: comedi: change some printk calls to pr_err
staging: rtl8723au: hal: Removed the extra semicolon
lustre: Deletion of unnecessary checks before three function calls
staging: lustre: fix sparse warnings: static function declaration
staging: lustre: fixed sparse warnings related to static declarations
staging: unisys: remove duplicate header
staging: unisys: remove unneeded structure
staging: ft1000 : replace __attribute ((__packed__) with __packed
drivers: staging: rtl8192e: Include "asm/unaligned.h" instead of "access_ok.h" in "rtl819x_BAProc.c"
Drivers:staging:rtl8192e: Fixed checkpatch warning
Drivers:staging:clocking-wizard: Added a newline
staging: clocking-wizard: check for a valid clk_name pointer
staging: rtl8723au: Hal_InitPGData() avoid unnecessary typecasts
staging: rtl8723au: _DisableAnalog(): Avoid zero-init variables unnecessarily
staging: rtl8723au: Remove unnecessary wrapper _ResetDigitalProcedure1()
staging: rtl8723au: _ResetDigitalProcedure1_92C() reduce code obfuscation
staging: rtl8723au: Remove unnecessary wrapper _DisableRFAFEAndResetBB()
staging: rtl8723au: _DisableRFAFEAndResetBB8192C(): Reduce code obfuscation
...
Diffstat (limited to 'drivers/staging/rtl8712')
23 files changed, 119 insertions, 235 deletions
diff --git a/drivers/staging/rtl8712/hal_init.c b/drivers/staging/rtl8712/hal_init.c index 1d6ade05fa18..324da34383ea 100644 --- a/drivers/staging/rtl8712/hal_init.c +++ b/drivers/staging/rtl8712/hal_init.c @@ -86,7 +86,7 @@ static u32 rtl871x_open_fw(struct _adapter *padapter, const u8 **ppmappedfw) (int)padapter->fw->size); return 0; } - *ppmappedfw = (u8 *)((*praw)->data); + *ppmappedfw = (*praw)->data; return (*praw)->size; } @@ -136,15 +136,10 @@ static void update_fwhdr(struct fw_hdr *pfwhdr, const u8 *pmappedfw) static u8 chk_fwhdr(struct fw_hdr *pfwhdr, u32 ulfilelength) { u32 fwhdrsz, fw_sz; - u8 intf, rfconf; /* check signature */ if ((pfwhdr->signature != 0x8712) && (pfwhdr->signature != 0x8192)) return _FAIL; - /* check interface */ - intf = (u8)((pfwhdr->version&0x3000) >> 12); - /* check rf_conf */ - rfconf = (u8)((pfwhdr->version&0xC000) >> 14); /* check fw_priv_sze & sizeof(struct fw_priv) */ if (pfwhdr->fw_priv_sz != sizeof(struct fw_priv)) return _FAIL; @@ -162,7 +157,7 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter) sint i; u8 tmp8, tmp8_a; u16 tmp16; - u32 maxlen = 0, tmp32; /* for compare usage */ + u32 maxlen = 0; /* for compare usage */ uint dump_imem_sz, imem_sz, dump_emem_sz, emem_sz; /* max = 49152; */ struct fw_hdr fwhdr; u32 ulfilelength; /* FW file size */ @@ -262,7 +257,7 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter) if (tmp8_a != (tmp8|BIT(2))) goto exit_fail; - tmp32 = r8712_read32(padapter, TCR); + r8712_read32(padapter, TCR); /* 4.polling IMEM Ready */ i = 100; diff --git a/drivers/staging/rtl8712/ieee80211.c b/drivers/staging/rtl8712/ieee80211.c index fe9459e483c5..57868085ce58 100644 --- a/drivers/staging/rtl8712/ieee80211.c +++ b/drivers/staging/rtl8712/ieee80211.c @@ -124,11 +124,10 @@ u8 *r8712_get_ie(u8 *pbuf, sint index, sint *len, sint limit) if (*p == index) { *len = *(p + 1); return p; - } else { - tmp = *(p + 1); - p += (tmp + 2); - i += (tmp + 2); } + tmp = *(p + 1); + p += (tmp + 2); + i += (tmp + 2); if (i >= limit) break; } @@ -237,10 +236,9 @@ unsigned char *r8712_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit) goto check_next_ie; *wpa_ie_len = *(pbuf + 1); return pbuf; - } else { - *wpa_ie_len = 0; - return NULL; } + *wpa_ie_len = 0; + return NULL; check_next_ie: limit = limit - (pbuf - pie) - 2 - len; if (limit <= 0) @@ -370,13 +368,12 @@ int r8712_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, int r8712_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie, u16 *wpa_len) { - u8 authmode, sec_idx; + u8 authmode; u8 wpa_oui[4] = {0x0, 0x50, 0xf2, 0x01}; uint cnt; /*Search required WPA or WPA2 IE and copy to sec_ie[ ]*/ cnt = (_TIMESTAMP_ + _BEACON_ITERVAL_ + _CAPABILITY_); - sec_idx = 0; while (cnt < in_len) { authmode = in_ie[cnt]; if ((authmode == _WPA_IE_ID_) && @@ -414,7 +411,7 @@ int r8712_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen) cnt += in_ie[cnt+1]+2; match = true; break; - } else + } cnt += in_ie[cnt+1]+2; /* goto next */ } return match; diff --git a/drivers/staging/rtl8712/osdep_service.h b/drivers/staging/rtl8712/osdep_service.h index d7a357b8d2d1..5153ad9c2c75 100644 --- a/drivers/staging/rtl8712/osdep_service.h +++ b/drivers/staging/rtl8712/osdep_service.h @@ -88,17 +88,13 @@ static inline u32 _down_sema(struct semaphore *sema) { if (down_interruptible(sema)) return _FAIL; - else - return _SUCCESS; + return _SUCCESS; } static inline u32 end_of_queue_search(struct list_head *head, struct list_head *plist) { - if (head == plist) - return true; - else - return false; + return (head == plist); } static inline void sleep_schedulable(int ms) diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c index 495ee1205e02..0631f3638257 100644 --- a/drivers/staging/rtl8712/recv_linux.c +++ b/drivers/staging/rtl8712/recv_linux.c @@ -146,7 +146,7 @@ void r8712_os_read_port(struct _adapter *padapter, struct recv_buf *precvbuf) dev_kfree_skb_any(precvbuf->pskb); precvbuf->pskb = NULL; precvbuf->reuse = false; - if (precvbuf->irp_pending == false) + if (!precvbuf->irp_pending) r8712_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf); } diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c b/drivers/staging/rtl8712/rtl8712_cmd.c index 720e8a15db96..62e53cc1d8b9 100644 --- a/drivers/staging/rtl8712/rtl8712_cmd.c +++ b/drivers/staging/rtl8712/rtl8712_cmd.c @@ -157,10 +157,8 @@ static u8 read_bbreg_hdl(struct _adapter *padapter, u8 *pbuf) { u32 val; void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd); - struct readBB_parm *prdbbparm; struct cmd_obj *pcmd = (struct cmd_obj *)pbuf; - prdbbparm = (struct readBB_parm *)pcmd->parmbuf; if (pcmd->rsp && pcmd->rspsz > 0) memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz); pcmd_callback = cmd_callback[pcmd->cmdcode].callback; @@ -174,10 +172,8 @@ static u8 read_bbreg_hdl(struct _adapter *padapter, u8 *pbuf) static u8 write_bbreg_hdl(struct _adapter *padapter, u8 *pbuf) { void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd); - struct writeBB_parm *pwritebbparm; struct cmd_obj *pcmd = (struct cmd_obj *)pbuf; - pwritebbparm = (struct writeBB_parm *)pcmd->parmbuf; pcmd_callback = cmd_callback[pcmd->cmdcode].callback; if (pcmd_callback == NULL) r8712_free_cmd_obj(pcmd); @@ -190,10 +186,8 @@ static u8 read_rfreg_hdl(struct _adapter *padapter, u8 *pbuf) { u32 val; void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd); - struct readRF_parm *prdrfparm; struct cmd_obj *pcmd = (struct cmd_obj *)pbuf; - prdrfparm = (struct readRF_parm *)pcmd->parmbuf; if (pcmd->rsp && pcmd->rspsz > 0) memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz); pcmd_callback = cmd_callback[pcmd->cmdcode].callback; @@ -207,10 +201,8 @@ static u8 read_rfreg_hdl(struct _adapter *padapter, u8 *pbuf) static u8 write_rfreg_hdl(struct _adapter *padapter, u8 *pbuf) { void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd); - struct writeRF_parm *pwriterfparm; struct cmd_obj *pcmd = (struct cmd_obj *)pbuf; - pwriterfparm = (struct writeRF_parm *)pcmd->parmbuf; pcmd_callback = cmd_callback[pcmd->cmdcode].callback; if (pcmd_callback == NULL) r8712_free_cmd_obj(pcmd); @@ -222,9 +214,7 @@ static u8 write_rfreg_hdl(struct _adapter *padapter, u8 *pbuf) static u8 sys_suspend_hdl(struct _adapter *padapter, u8 *pbuf) { struct cmd_obj *pcmd = (struct cmd_obj *)pbuf; - struct usb_suspend_parm *psetusbsuspend; - psetusbsuspend = (struct usb_suspend_parm *)pcmd->parmbuf; r8712_free_cmd_obj(pcmd); return H2C_SUCCESS; } @@ -320,7 +310,7 @@ void r8712_fw_cmd_data(struct _adapter *pAdapter, u32 *value, u8 flag) int r8712_cmd_thread(void *context) { struct cmd_obj *pcmd; - unsigned int cmdsz, wr_sz, *pcmdbuf, *prspbuf; + unsigned int cmdsz, wr_sz, *pcmdbuf; struct tx_desc *pdesc; void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd); struct _adapter *padapter = (struct _adapter *)context; @@ -342,7 +332,6 @@ _next: continue; } pcmdbuf = (unsigned int *)pcmdpriv->cmd_buf; - prspbuf = (unsigned int *)pcmdpriv->rsp_buf; pdesc = (struct tx_desc *)pcmdbuf; memset(pdesc, 0, TXDESC_SIZE); pcmd = cmd_hdl_filter(padapter, pcmd); diff --git a/drivers/staging/rtl8712/rtl8712_efuse.c b/drivers/staging/rtl8712/rtl8712_efuse.c index c9eeb4270ab9..d95716999498 100644 --- a/drivers/staging/rtl8712/rtl8712_efuse.c +++ b/drivers/staging/rtl8712/rtl8712_efuse.c @@ -219,13 +219,12 @@ u16 r8712_efuse_get_current_size(struct _adapter *padapter) { int bContinual = true; u16 efuse_addr = 0; - u8 hoffset = 0, hworden = 0; + u8 hworden = 0; u8 efuse_data, word_cnts = 0; while (bContinual && efuse_one_byte_read(padapter, efuse_addr, &efuse_data) && (efuse_addr < efuse_available_max_size)) { if (efuse_data != 0xFF) { - hoffset = (efuse_data >> 4) & 0x0F; hworden = efuse_data & 0x0F; word_cnts = calculate_word_cnts(hworden); /* read next header */ @@ -414,19 +413,18 @@ u8 r8712_efuse_pg_packet_write(struct _adapter *padapter, const u8 offset, bResult = false; } break; - } else { /* write header fail */ - bResult = false; - if (0xFF == efuse_data) - return bResult; /* nothing damaged. */ - /* call rescue procedure */ - if (fix_header(padapter, efuse_data, efuse_addr) == - false) - return false; /* rescue fail */ - - if (++repeat_times > _REPEAT_THRESHOLD_) /* fail */ - break; - /* otherwise, take another risk... */ } + /* write header fail */ + bResult = false; + if (0xFF == efuse_data) + return bResult; /* nothing damaged. */ + /* call rescue procedure */ + if (!fix_header(padapter, efuse_data, efuse_addr)) + return false; /* rescue fail */ + + if (++repeat_times > _REPEAT_THRESHOLD_) /* fail */ + break; + /* otherwise, take another risk... */ } return bResult; } @@ -541,15 +539,16 @@ u8 r8712_efuse_map_write(struct _adapter *padapter, u16 addr, u16 cnts, } idx++; break; - } else { - if ((data[idx] != pktdata[i]) || (data[idx+1] != - pktdata[i+1])) { - word_en &= ~BIT(i >> 1); - newdata[j++] = data[idx]; - newdata[j++] = data[idx + 1]; - } - idx += 2; } + + if ((data[idx] != pktdata[i]) || (data[idx+1] != + pktdata[i+1])) { + word_en &= ~BIT(i >> 1); + newdata[j++] = data[idx]; + newdata[j++] = data[idx + 1]; + } + idx += 2; + if (idx == cnts) break; } diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index b27806209268..cd8b444b255b 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -158,8 +158,6 @@ int r8712_free_recvframe(union recv_frame *precvframe, static void update_recvframe_attrib_from_recvstat(struct rx_pkt_attrib *pattrib, struct recv_stat *prxstat) { - u32 *pphy_info; - struct phy_stat *pphy_stat; u16 drvinfo_sz = 0; drvinfo_sz = (le32_to_cpu(prxstat->rxdw0)&0x000f0000)>>16; @@ -189,10 +187,6 @@ static void update_recvframe_attrib_from_recvstat(struct rx_pkt_attrib *pattrib, /*Offset 16*/ /*Offset 20*/ /*phy_info*/ - if (drvinfo_sz) { - pphy_stat = (struct phy_stat *)(prxstat+1); - pphy_info = (u32 *)prxstat+1; - } } /*perform defrag*/ @@ -200,7 +194,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter, struct __queue *defrag_q) { struct list_head *plist, *phead; - u8 *data, wlanhdr_offset; + u8 wlanhdr_offset; u8 curfragnum; struct recv_frame_hdr *pfhdr, *pnfhdr; union recv_frame *prframe, *pnextrframe; @@ -223,7 +217,6 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter, curfragnum++; plist = &defrag_q->queue; plist = plist->next; - data = get_recvframe_data(prframe); while (end_of_queue_search(phead, plist) == false) { pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u); pnfhdr = &pnextrframe->u.hdr; @@ -436,13 +429,11 @@ void r8712_rxcmd_event_hdl(struct _adapter *padapter, void *prxcmdbuf) { uint voffset; u8 *poffset; - u16 pkt_len, cmd_len, drvinfo_sz; - u8 eid, cmd_seq; + u16 cmd_len, drvinfo_sz; struct recv_stat *prxstat; poffset = (u8 *)prxcmdbuf; voffset = *(uint *)poffset; - pkt_len = le32_to_cpu(voffset) & 0x00003fff; prxstat = (struct recv_stat *)prxcmdbuf; drvinfo_sz = ((le32_to_cpu(prxstat->rxdw0) & 0x000f0000) >> 16); drvinfo_sz = drvinfo_sz << 3; @@ -450,8 +441,6 @@ void r8712_rxcmd_event_hdl(struct _adapter *padapter, void *prxcmdbuf) do { voffset = *(uint *)poffset; cmd_len = (u16)(le32_to_cpu(voffset) & 0xffff); - cmd_seq = (u8)((le32_to_cpu(voffset) >> 24) & 0x7f); - eid = (u8)((le32_to_cpu(voffset) >> 16) & 0xff); r8712_event_handle(padapter, (uint *)poffset); poffset += (cmd_len + 8);/*8 bytes alignment*/ } while (le32_to_cpu(voffset) & BIT(31)); @@ -533,11 +522,10 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter, if (bforced == true) { if (list_empty(phead)) return true; - else { - prframe = LIST_CONTAINOR(plist, union recv_frame, u); - pattrib = &prframe->u.hdr.attrib; - preorder_ctrl->indicate_seq = pattrib->seq_num; - } + + prframe = LIST_CONTAINOR(plist, union recv_frame, u); + pattrib = &prframe->u.hdr.attrib; + preorder_ctrl->indicate_seq = pattrib->seq_num; } /* Prepare indication list and indication. * Check if there is any packet need indicate. */ diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c b/drivers/staging/rtl8712/rtl871x_cmd.c index d9c1561e3272..fe5e315319f7 100644 --- a/drivers/staging/rtl8712/rtl871x_cmd.c +++ b/drivers/staging/rtl8712/rtl871x_cmd.c @@ -205,12 +205,12 @@ void r8712_free_cmd_obj(struct cmd_obj *pcmd) { if ((pcmd->cmdcode != _JoinBss_CMD_) && (pcmd->cmdcode != _CreateBss_CMD_)) - kfree((unsigned char *)pcmd->parmbuf); + kfree(pcmd->parmbuf); if (pcmd->rsp != NULL) { if (pcmd->rspsz != 0) - kfree((unsigned char *)pcmd->rsp); + kfree(pcmd->rsp); } - kfree((unsigned char *)pcmd); + kfree(pcmd); } /* @@ -232,7 +232,7 @@ u8 r8712_sitesurvey_cmd(struct _adapter *padapter, return _FAIL; psurveyPara = kmalloc(sizeof(*psurveyPara), GFP_ATOMIC); if (psurveyPara == NULL) { - kfree((unsigned char *) ph2c); + kfree(ph2c); return _FAIL; } init_h2fwcmd_w_parm_no_rsp(ph2c, psurveyPara, @@ -264,7 +264,7 @@ u8 r8712_setdatarate_cmd(struct _adapter *padapter, u8 *rateset) return _FAIL; pbsetdataratepara = kmalloc(sizeof(*pbsetdataratepara), GFP_ATOMIC); if (pbsetdataratepara == NULL) { - kfree((u8 *) ph2c); + kfree(ph2c); return _FAIL; } init_h2fwcmd_w_parm_no_rsp(ph2c, pbsetdataratepara, @@ -286,7 +286,7 @@ u8 r8712_set_chplan_cmd(struct _adapter *padapter, int chplan) return _FAIL; psetchplanpara = kmalloc(sizeof(*psetchplanpara), GFP_ATOMIC); if (psetchplanpara == NULL) { - kfree((u8 *) ph2c); + kfree(ph2c); return _FAIL; } init_h2fwcmd_w_parm_no_rsp(ph2c, psetchplanpara, @@ -307,7 +307,7 @@ u8 r8712_setbasicrate_cmd(struct _adapter *padapter, u8 *rateset) return _FAIL; pssetbasicratepara = kmalloc(sizeof(*pssetbasicratepara), GFP_ATOMIC); if (pssetbasicratepara == NULL) { - kfree((u8 *) ph2c); + kfree(ph2c); return _FAIL; } init_h2fwcmd_w_parm_no_rsp(ph2c, pssetbasicratepara, @@ -329,7 +329,7 @@ u8 r8712_setptm_cmd(struct _adapter *padapter, u8 type) return _FAIL; pwriteptmparm = kmalloc(sizeof(*pwriteptmparm), GFP_ATOMIC); if (pwriteptmparm == NULL) { - kfree((u8 *) ph2c); + kfree(ph2c); return _FAIL; } init_h2fwcmd_w_parm_no_rsp(ph2c, pwriteptmparm, GEN_CMD_CODE(_SetPT)); @@ -349,7 +349,7 @@ u8 r8712_setfwdig_cmd(struct _adapter *padapter, u8 type) return _FAIL; pwriteptmparm = kmalloc(sizeof(*pwriteptmparm), GFP_ATOMIC); if (pwriteptmparm == NULL) { - kfree((u8 *) ph2c); + kfree(ph2c); return _FAIL; } init_h2fwcmd_w_parm_no_rsp(ph2c, pwriteptmparm, GEN_CMD_CODE(_SetDIG)); @@ -369,7 +369,7 @@ u8 r8712_setfwra_cmd(struct _adapter *padapter, u8 type) return _FAIL; pwriteptmparm = kmalloc(sizeof(*pwriteptmparm), GFP_ATOMIC); if (pwriteptmparm == NULL) { - kfree((u8 *) ph2c); + kfree(ph2c); return _FAIL; } init_h2fwcmd_w_parm_no_rsp(ph2c, pwriteptmparm, GEN_CMD_CODE(_SetRA)); @@ -389,7 +389,7 @@ u8 r8712_setrfreg_cmd(struct _adapter *padapter, u8 offset, u32 val) return _FAIL; pwriterfparm = kmalloc(sizeof(*pwriterfparm), GFP_ATOMIC); if (pwriterfparm == NULL) { - kfree((u8 *) ph2c); + kfree(ph2c); return _FAIL; } init_h2fwcmd_w_parm_no_rsp(ph2c, pwriterfparm, GEN_CMD_CODE(_SetRFReg)); @@ -410,7 +410,7 @@ u8 r8712_getrfreg_cmd(struct _adapter *padapter, u8 offset, u8 *pval) return _FAIL; prdrfparm = kmalloc(sizeof(*prdrfparm), GFP_ATOMIC); if (prdrfparm == NULL) { - kfree((u8 *) ph2c); + kfree(ph2c); return _FAIL; } INIT_LIST_HEAD(&ph2c->list); @@ -470,7 +470,6 @@ u8 r8712_createbss_cmd(struct _adapter *padapter) u8 r8712_joinbss_cmd(struct _adapter *padapter, struct wlan_network *pnetwork) { - u8 *auth; uint t_len = 0; struct ndis_wlan_bssid_ex *psecnetwork; struct cmd_obj *pcmd; @@ -517,7 +516,6 @@ u8 r8712_joinbss_cmd(struct _adapter *padapter, struct wlan_network *pnetwork) return _FAIL; } memcpy(psecnetwork, &pnetwork->network, t_len); - auth = &psecuritypriv->authenticator_ie[0]; psecuritypriv->authenticator_ie[0] = (unsigned char) psecnetwork->IELength; if ((psecnetwork->IELength-12) < (256 - 1)) @@ -527,7 +525,7 @@ u8 r8712_joinbss_cmd(struct _adapter *padapter, struct wlan_network *pnetwork) memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], (256-1)); psecnetwork->IELength = 0; - /* If the the driver wants to use the bssid to create the connection. + /* If the driver wants to use the bssid to create the connection. * If not, we copy the connecting AP's MAC address to it so that * the driver just has the bssid information for PMKIDList searching. */ @@ -626,7 +624,7 @@ u8 r8712_disassoc_cmd(struct _adapter *padapter) /* for sta_mode */ return _FAIL; pdisconnect = kmalloc(sizeof(*pdisconnect), GFP_ATOMIC); if (pdisconnect == NULL) { - kfree((u8 *)pdisconnect_cmd); + kfree(pdisconnect_cmd); return _FAIL; } init_h2fwcmd_w_parm_no_rsp(pdisconnect_cmd, pdisconnect, @@ -648,7 +646,7 @@ u8 r8712_setopmode_cmd(struct _adapter *padapter, return _FAIL; psetop = kmalloc(sizeof(*psetop), GFP_ATOMIC); if (psetop == NULL) { - kfree((u8 *) ph2c); + kfree(ph2c); return _FAIL; } init_h2fwcmd_w_parm_no_rsp(ph2c, psetop, _SetOpMode_CMD_); @@ -672,13 +670,13 @@ u8 r8712_setstakey_cmd(struct _adapter *padapter, u8 *psta, u8 unicast_key) return _FAIL; psetstakey_para = kmalloc(sizeof(*psetstakey_para), GFP_ATOMIC); if (psetstakey_para == NULL) { - kfree((u8 *) ph2c); + kfree(ph2c); return _FAIL; } psetstakey_rsp = kmalloc(sizeof(*psetstakey_rsp), GFP_ATOMIC); if (psetstakey_rsp == NULL) { - kfree((u8 *) ph2c); - kfree((u8 *) psetstakey_para); + kfree(ph2c); + kfree(psetstakey_para); return _FAIL; } init_h2fwcmd_w_parm_no_rsp(ph2c, psetstakey_para, _SetStaKey_CMD_); @@ -712,7 +710,7 @@ u8 r8712_setrfintfs_cmd(struct _adapter *padapter, u8 mode) return _FAIL; psetrfintfsparm = kmalloc(sizeof(*psetrfintfsparm), GFP_ATOMIC); if (psetrfintfsparm == NULL) { - kfree((unsigned char *) ph2c); + kfree(ph2c); return _FAIL; } init_h2fwcmd_w_parm_no_rsp(ph2c, psetrfintfsparm, @@ -734,7 +732,7 @@ u8 r8712_setrttbl_cmd(struct _adapter *padapter, return _FAIL; psetrttblparm = kmalloc(sizeof(*psetrttblparm), GFP_ATOMIC); if (psetrttblparm == NULL) { - kfree((unsigned char *)ph2c); + kfree(ph2c); return _FAIL; } init_h2fwcmd_w_parm_no_rsp(ph2c, psetrttblparm, @@ -755,7 +753,7 @@ u8 r8712_gettssi_cmd(struct _adapter *padapter, u8 offset, u8 *pval) return _FAIL; prdtssiparm = kmalloc(sizeof(*prdtssiparm), GFP_ATOMIC); if (prdtssiparm == NULL) { - kfree((unsigned char *) ph2c); + kfree(ph2c); return _FAIL; } INIT_LIST_HEAD(&ph2c->list); @@ -781,7 +779,7 @@ u8 r8712_setMacAddr_cmd(struct _adapter *padapter, u8 *mac_addr) return _FAIL; psetMacAddr_para = kmalloc(sizeof(*psetMacAddr_para), GFP_ATOMIC); if (psetMacAddr_para == NULL) { - kfree((u8 *) ph2c); + kfree(ph2c); return _FAIL; } init_h2fwcmd_w_parm_no_rsp(ph2c, psetMacAddr_para, @@ -803,13 +801,13 @@ u8 r8712_setassocsta_cmd(struct _adapter *padapter, u8 *mac_addr) return _FAIL; psetassocsta_para = kmalloc(sizeof(*psetassocsta_para), GFP_ATOMIC); if (psetassocsta_para == NULL) { - kfree((u8 *) ph2c); + kfree(ph2c); return _FAIL; } psetassocsta_rsp = kmalloc(sizeof(*psetassocsta_rsp), GFP_ATOMIC); if (psetassocsta_rsp == NULL) { - kfree((u8 *)ph2c); - kfree((u8 *)psetassocsta_para); + kfree(ph2c); + kfree(psetassocsta_para); return _FAIL; } init_h2fwcmd_w_parm_no_rsp(ph2c, psetassocsta_para, _SetAssocSta_CMD_); @@ -831,7 +829,7 @@ u8 r8712_addbareq_cmd(struct _adapter *padapter, u8 tid) return _FAIL; paddbareq_parm = kmalloc(sizeof(*paddbareq_parm), GFP_ATOMIC); if (paddbareq_parm == NULL) { - kfree((unsigned char *)ph2c); + kfree(ph2c); return _FAIL; } paddbareq_parm->tid = tid; @@ -852,7 +850,7 @@ u8 r8712_wdg_wk_cmd(struct _adapter *padapter) return _FAIL; pdrvintcmd_param = kmalloc(sizeof(*pdrvintcmd_param), GFP_ATOMIC); if (pdrvintcmd_param == NULL) { - kfree((unsigned char *)ph2c); + kfree(ph2c); return _FAIL; } pdrvintcmd_param->i_cid = WDG_WK_CID; @@ -1026,7 +1024,7 @@ u8 r8712_disconnectCtrlEx_cmd(struct _adapter *adapter, u32 enableDrvCtrl, return _FAIL; param = kzalloc(sizeof(*param), GFP_ATOMIC); if (param == NULL) { - kfree((unsigned char *) ph2c); + kfree(ph2c); return _FAIL; } diff --git a/drivers/staging/rtl8712/rtl871x_io.c b/drivers/staging/rtl8712/rtl871x_io.c index d7b63aedead7..e4e5b13cb927 100644 --- a/drivers/staging/rtl8712/rtl871x_io.c +++ b/drivers/staging/rtl8712/rtl871x_io.c @@ -93,7 +93,7 @@ static uint register_intf_hdl(u8 *dev, struct intf_hdl *pintfhdl) pintfhdl->intf_option = 0; pintfhdl->adapter = dev; pintfhdl->intf_dev = (u8 *)&(adapter->dvobjpriv); - if (_init_intf_hdl(adapter, pintfhdl) == false) + if (!_init_intf_hdl(adapter, pintfhdl)) goto register_intf_hdl_fail; return _SUCCESS; register_intf_hdl_fail: @@ -142,7 +142,7 @@ uint r8712_alloc_io_queue(struct _adapter *adapter) alloc_io_queue_fail: if (pio_queue) { kfree(pio_queue->pallocated_free_ioreqs_buf); - kfree((u8 *)pio_queue); + kfree(pio_queue); } adapter->pio_queue = NULL; return _FAIL; @@ -156,6 +156,6 @@ void r8712_free_io_queue(struct _adapter *adapter) kfree(pio_queue->pallocated_free_ioreqs_buf); adapter->pio_queue = NULL; unregister_intf_hdl(&pio_queue->intf); - kfree((u8 *)pio_queue); + kfree(pio_queue); } } diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c index 8e42ce06e5d7..73b7d864ccbd 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c @@ -170,7 +170,7 @@ static inline char *translate_scan(struct _adapter *padapter, s8 *p; u32 i = 0, ht_ielen = 0; u16 cap, ht_cap = false, mcs_rate; - u8 rssi, bw_40MHz = 0, short_GI = 0; + u8 rssi; if ((pnetwork->network.Configuration.DSConfig < 1) || (pnetwork->network.Configuration.DSConfig > 14)) { @@ -197,10 +197,6 @@ static inline char *translate_scan(struct _adapter *padapter, ht_cap = true; pht_capie = (struct ieee80211_ht_cap *)(p + 2); memcpy(&mcs_rate , pht_capie->supp_mcs_set, 2); - bw_40MHz = (pht_capie->cap_info&IEEE80211_HT_CAP_SUP_WIDTH) - ? 1 : 0; - short_GI = (pht_capie->cap_info&(IEEE80211_HT_CAP_SGI_20 | - IEEE80211_HT_CAP_SGI_40)) ? 1 : 0; } /* Add the protocol name */ iwe.cmd = SIOCGIWNAME; @@ -287,12 +283,10 @@ static inline char *translate_scan(struct _adapter *padapter, u8 wpa_ie[255], rsn_ie[255]; u16 wpa_len = 0, rsn_len = 0; int n; - sint out_len = 0; - out_len = r8712_get_sec_ie(pnetwork->network.IEs, - pnetwork->network. - IELength, rsn_ie, &rsn_len, - wpa_ie, &wpa_len); + r8712_get_sec_ie(pnetwork->network.IEs, + pnetwork->network.IELength, rsn_ie, &rsn_len, + wpa_ie, &wpa_len); if (wpa_len > 0) { memset(buf, 0, MAX_WPA_IE_LEN); n = sprintf(buf, "wpa_ie="); @@ -505,14 +499,14 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, } } exit: - kfree((u8 *)pwep); + kfree(pwep); return ret; } static int r871x_set_wpa_ie(struct _adapter *padapter, char *pie, unsigned short ielen) { - u8 *buf = NULL, *pos = NULL; + u8 *buf = NULL; int group_cipher = 0, pairwise_cipher = 0; int ret = 0; @@ -522,7 +516,6 @@ static int r871x_set_wpa_ie(struct _adapter *padapter, char *pie, buf = kmemdup(pie, ielen, GFP_ATOMIC); if (buf == NULL) return -ENOMEM; - pos = buf; if (ielen < RSN_HEADER_LEN) { ret = -EINVAL; goto exit; @@ -1133,13 +1126,11 @@ static int r871x_wx_set_mlme(struct net_device *dev, union iwreq_data *wrqu, char *extra) { int ret = 0; - u16 reason; struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); struct iw_mlme *mlme = (struct iw_mlme *) extra; if (mlme == NULL) return -1; - reason = cpu_to_le16(mlme->reason_code); switch (mlme->cmd) { case IW_MLME_DEAUTH: if (!r8712_set_802_11_disassociate(padapter)) @@ -2216,7 +2207,7 @@ static int wpa_supplicant_ioctl(struct net_device *dev, struct iw_point *p) } if (ret == 0 && copy_to_user(p->pointer, param, p->length)) ret = -EFAULT; - kfree((u8 *)param); + kfree(param); return ret; } diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_set.c b/drivers/staging/rtl8712/rtl871x_ioctl_set.c index 9d47eb472837..6318a0e65e6e 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_set.c +++ b/drivers/staging/rtl8712/rtl871x_ioc |
