Commit graph

1325 commits

Author SHA1 Message Date
Ivan Safonov d94971aa97 staging: r8188eu: remove ieee80211_txb and tx_pending structures
ieee80211_txb and tx_pending structures are not used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12 11:23:20 +02:00
Ivan Safonov 5cd8396540 staging: r8188eu: replace rtw_ieee80211_hdr_3addr_qos with ieee80211_qos_hdr
rtw_ieee80211_hdr_3addr_qos is duplicate of ieee80211_qos_hdr.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12 11:23:20 +02:00
Ivan Safonov bbfe286b07 staging: r8188eu: replace rtw_ieee80211_hdr_3addr with ieee80211_hdr_3addr
rtw_ieee80211_hdr_3addr is duplicate of ieee80211_hdr_3addr.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12 11:23:20 +02:00
Ivan Safonov d87f574d69 staging: r8188eu: replace rtw_ieee80211_hdr with ieee80211_hdr
rtw_ieee80211_hdr is duplicate of ieee80211_hdr.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12 11:23:20 +02:00
Ivan Safonov bd83585d2d staging: r8188eu: remove some structures definitions from rtw_ioctl.h
oid_funs_node and oid_obj_priv structures are not used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:42 +02:00
Ivan Safonov 46d64dc40b staging: r8188eu: remove some structure definitions from rtw_event.h
addba_event, event_node and c2hevent_queue structures are not used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:42 +02:00
Ivan Safonov 962bbaaf90 staging: r8188eu: remove some structure definitions from rtw_cmd.h
del_assocsta_parm and setstapwrstate_parm structures are not used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:42 +02:00
Ivan Safonov a24b964d1a staging: r8188eu: remove some structure definitions from wlan_bssdef.h
cmd_msg_parm, H2C_SS_RFOFF_PARAM, joinbssrpt_parm,
P2P_PS_Offload_t and P2P_PS_CTWPeriod_t structures are not used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:42 +02:00
Ivan Safonov 36b010d008 staging: r8188eu: remove odm_sta_info structure
odm_sta_info structure does not used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:42 +02:00
Ivan Safonov 2e9ae71939 staging: r8188eu: remove smooth_rssi_data structure
This structure does not used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:42 +02:00
Ivan Safonov 87b05ed81f staging: r8188eu: remove sha256_state structure
This structure does not used in driver code.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:42 +02:00
Ivan Safonov c56b9a3aac staging: r8188eu: remove agg_pkt_info structure
This structure does not used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:42 +02:00
Ivan Safonov 21b8461f80 staging: r8188eu: remove some structure definitions from wlan_bssdef.h
ndis_802_11_ai_reqfi, ndis_802_11_ai_resfi, ndis_802_11_assoc_info,
ndis_802_11_remove_key, ndis_802_11_auth_req, ndis_802_11_status_ind,
ndis_802_11_auth_evt, ndis_802_11_test, pmkid_candidate, ndis_802_11_pmkid_list,
ndis_802_11_auth_encrypt and ndis_802_11_cap structures are not used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:41 +02:00
Ivan Safonov 50a619d52c staging: r8188eu: remove include/HalHWImg8188E_FW.h
This file does not included to other sources.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:41 +02:00
Ivan Safonov 603c562096 staging: r8188eu: remove some structure definitions from Hal8188EPhyCfg.h
ant_sel_ofdm and ant_sel_cck structures are not used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:41 +02:00
Ivan Safonov 36eb7d108e staging: r8188eu: remove some structure definitions from include/ieee80211.h
ieee_ibss_seq, rtw_ieee80211_hdr_qos, eapol, ieee80211_rx_stats,
ieee80211_frag_entry, ieee80211_stats, ieee80211_softmac_stats,
ieee80211_security, ieee80211_header_data, ieee80211_info_element_hdr,
ieee80211_info_element, ieee80211_authentication, ieee80211_probe_response,
ieee80211_probe_request, ieee80211_assoc_request_frame,
ieee80211_assoc_response_frame structures are not used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:41 +02:00
Ivan Safonov 7326be5967 staging:r8188eu: remove unnecessary include from include/rtw_ht.h
osdep_service.h does not required in include/rtw_ht.h.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:41 +02:00
Ivan Safonov 8204ba143f staging: r8188eu: remove dead code from rtw_update_ht_cap function
This code affect only to local variables that does not used later.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:41 +02:00
Ivan Safonov 8e5e7647b9 staging: r8188eu: remove rx_ampdu_maxlen member of ht_priv
rx_ampdu_maxlen used only once for assigning value.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:41 +02:00
Ivan Safonov 3c6ccb8094 staging: r8188eu: remove unused members of ht_priv structure
tx_amsdu_enable and tx_amdsu_maxlen are not used in driver code.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:41 +02:00
Ivan Safonov 2976f0a5bc staging: r8188eu: remove HT_caps_element structure
This type does not used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:41 +02:00
Ivan Safonov 3d3cd94d0d staging: r8188eu: replace HT_caps_element with ieee80211_ht_cap structure
HT_caps_element is reimplementation of ieee80211_ht_cap.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:41 +02:00
Ivan Safonov ad0ca5903c staging: r8188eu: simplify HT_caps_element structure
Now HT_caps_element structure is similar to ieee80211_ht_caps.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:41 +02:00
Ivan Safonov 16d475cb47 staging: r8188eu: remove HT_cap member of HT_caps_element structure
This member used only once and can be replaced
with address of HT_caps_element.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:41 +02:00
Ivan Safonov 7494b27f65 staging: r8188eu: remove rtw_ieee80211_ht_cap structure
rtw_ieee80211_ht_cap does not used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:40 +02:00
Ivan Safonov cfecac2e22 staging: r8188eu: change rtw_ieee80211_ht_cap type of structures members to ieee80211_ht_cap
Also cap_info member of ieee80211_ht_cap wrapped by le16_to_cpu function.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:40 +02:00
Ivan Safonov c7873d8bad staging: r8188eu: change rtw_ieee80211_ht_cap type of local variables to ieee80211_ht_cap
rtw_ieee80211_ht_cap is reimplementation of the ieee80211_ht_cap.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:40 +02:00
Ivan Safonov 7f98038a39 staging: r8188eu: remove dead code from rtw_get_cur_max_rate function
Values assugned to pht_capie and mcs_rate variables,
but variables does not used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:40 +02:00
Ivan Safonov 81a2b8e4bb staging: r8188eu: replace sizeof(struct rtw_ieee80211_ht_cap) with sizeof(struct ieee80211_ht_cap)
Values of this expressions are equal, but ieee80211_ht_cap is library type.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:40 +02:00
Ivan Safonov da9090adb7 staging: r8188eu: replace rtw_ieee80211_ht_cap with ieee80211_ht_cap type in translate_scan function
rtw_ieee80211_ht_cap is reimplementation of the ieee80211_ht_cap.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:40 +02:00
Ivan Safonov 042ca34b9a staging: r8188eu: replace rtw_ieee80211_ht_cap with ieee80211_ht_cap type in rtw_check_beacon_data function
rtw_ieee80211_ht_cap is reimplementation of the ieee80211_ht_cap.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:40 +02:00
Ivan Safonov be98624d14 staging: r8188eu: remove for_each_ie macro
for_each_ie does not used in the driver code.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:40 +02:00
Ivan Safonov 1b9e6df516 staging: r8188eu: remove action_public_str function
Driver does not use this function.
Also _action_public_str array removed.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:40 +02:00
Ivan Safonov 86d54a7b78 staging: r8188eu: remove rtw_action_frame_parse function
Driver does not use this function.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:40 +02:00
Ivan Safonov c9735cb6ea staging: r8188eu: remove dump_wps_ie function
Driver does not use this function.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:40 +02:00
Ivan Safonov 92224ac300 staging: r8188eu: remove dump_ies function
Driver does not use this function.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:40 +02:00
Ivan Safonov ec4eb6e146 staging: r8188eu: remove rtw_set_ie_ch_switch function
Driver does not use this function.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:40 +02:00
Ivan Safonov 798d8c2a8c staging: r8188eu: remove rtw_set_ie_mesh_ch_switch_parm function
Driver does not use this function.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:39 +02:00
Ivan Safonov b02b573fcf staging: r8188eu: remove rtw_set_ie_secondary_ch_offset function
Driver does not use this function.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:39 +02:00
Ivan Safonov d5b80f9457 staging: r8188eu: remove hal_ch_offset_to_secondary_ch_offset function
Driver does not use this function.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:39 +02:00
Ivan Safonov d02463e06e staging: r8188eu: remove issue_action_spct_ch_switch function
Driver does not use this function.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:39 +02:00
Ivan Safonov f92dcecace staging: r8188eu: remove secondary_ch_offset_to_hal_ch_offset function
Driver does not use this function.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:39 +02:00
Ivan Safonov fd0a793a0b staging: r8188eu: remove rtw_ap_inform_ch_switch function
Driver does not use this function.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:39 +02:00
Ivan Safonov d7335dc9ab staging: r8188eu: remove rtw_get_ie_ex function
Driver does not use this function.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:39 +02:00
Ivan Safonov f0fde4f867 staging: r8188eu: remove rtw_ies_remove_ie function
Driver does not use this function.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 18:01:39 +02:00
Wei Yongjun eaf47b713b staging: rtl8188eu: fix missing unlock on error in rtw_resume_process()
Add the missing unlock before return from function
rtw_resume_process() in the error handling case.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:55:43 +02:00
Larry Finger 1335a9516d staging: r8188eu: Fix scheduling while atomic splat
Commit fadbe0cd52 ("staging: rtl8188eu:
Remove rtw_zmalloc(), wrapper for kzalloc()") changed all allocation
calls to be GFP_KERNEL even though the original wrapper was testing
to determine if the caller was in atomic mode. Most of the mistakes
were corrected with commit 33dc85c3c6
("staging: r8188eu: Fix scheduling while atomic error introduced in
commit fadbe0cd"); however, two kzalloc calls were missed as the
call only happens when the driver is shutting down.

Fixes: fadbe0cd52 ("staging: rtl8188eu: Remove rtw_zmalloc(), wrapper for kzalloc()")
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:29:41 +02:00
Larry Finger bc83c4cfc2 staging: r8188eu: Remove some false positives from kmemleak
When this driver preallocates some SKBs, kmemleak is unable to find that
allocated memory when it scans. When the driver is unloaded, that memory
is released; therefore, the report is a false positive.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:28:59 +02:00
Ivan Safonov a0693e22d1 staging: rtl8188eu: remove _EFUSE_DEF_TYPE enum
This enumeration does not used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:15:28 +02:00
Ivan Safonov 9de204cd59 staging: rtl8188eu: remove EFUSE_GetEfuseDefinition function
This function does not used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:15:28 +02:00
Ivan Safonov 054bf87c90 staging: rtl8188eu: replace EFUSE_GetEfuseDefinition(..., TYPE_AVAILABLE_EFUSE_BYTES_BANK, &a) call with a = (EFUSE_REAL_CONTENT_LEN_88E - EFUSE_OOB_PROTECT_BYTES_88E)
This makes the code easier to read.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:15:28 +02:00
Ivan Safonov f573fed712 staging: rtl8188eu: replace EFUSE_GetEfuseDefinition(..., TYPE_EFUSE_MAX_SECTION, &a) with a = EFUSE_MAX_SECTION_88E
This makes the code easier to read.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:15:28 +02:00
Ivan Safonov 28d040fb72 staging: rtl8188eu: remove efuse_max variable in hal_EfusePartialWriteCheck
This variable does not used after assigning value.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:15:28 +02:00
Ivan Safonov 0cdec5a450 staging: rtl8188eu: replace EFUSE_GetEfuseDefinition(..., TYPE_EFUSE_MAP_LEN, ...) call with it's result (EFUSE_MAP_LEN_88E)
This makes the code easier to read.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:15:28 +02:00
Binoy Jayan 7fbf8f73ed rtl8188eu: Remove unused semaphores
The semaphores xmit_sema, terminate_xmitthread_sema and tx_retevt
have no users, hence remove all references to them.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:14:51 +02:00
Binoy Jayan f18c566e4e rtl8188eu: pwrctrl_priv: Replace semaphore 'lock' with mutex
The semaphore 'lock' in pwrctrl_priv is a simple mutex, so it should
be written as one. Semaphores are going away in the future.
_enter_pwrlock was using down_interruptible(), so the lock could be broken
by sending a signal. This could be a bug, because nothing checks the return
code here. Hence, using mutex_lock instead of the interruptible version.
Also, remove the now unused wrappers _init_pwrlock, _enter_pwrlock,
_exit_pwrlock and _rtw_down_sema.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:14:51 +02:00
Binoy Jayan 16677cca77 rtl8188eu: Replace semaphore terminate_cmdthread_sema with completion
The semaphore 'terminate_cmdthread_sema' is used as completion,
so convert it to struct completion.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:14:51 +02:00
Binoy Jayan c84f5e2872 rtl8188eu: Replace semaphore cmd_queue_sema with completion
The semaphore 'cmd_queue_sema' is used as completion,
so convert it to struct completion.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:14:51 +02:00
Hans de Goede bc8201e3e1 Revert "Staging: rtl8188eu: rtw_efuse: Use sizeof type *pointer instead of sizeof type."
This reverts commit b5e12ec383 ("Staging: rtl8188eu: rtw_efuse: Use
sizeof type *pointer instead of sizeof type.").

This commit is wrong, the rtw_malloc2d helper function takes the size of
the array elements as its 3th argument, whereas sizeof(*eFuseWord)
gives the size of a pointer instead of the size of a u16.

Since sizeof(void *) > sizeof(u16) this has no adverse effects, but it
is still wrong.

Cc: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17 11:21:45 -07:00
Hans de Goede 6982f867e0 Revert "Staging: drivers: rtl8188eu: use sizeof(*ptr) instead of sizeof(struct)"
This reverts commit 99aded71b5 ("Staging: drivers: rtl8188eu: use
sizeof(*ptr) instead of sizeof(struct)").

This commit is wrong, as adapt->HalData has a type of "void *", so
now we are allocating a much to small struct, which causes the driver
to overwrite random memory which leads to a non working driver and
various system crashes.

Cc: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-17 11:21:45 -07:00
Linus Torvalds 2f37dd131c Staging and IIO driver update for 4.7-rc1
Here's the big staging and iio driver update for 4.7-rc1.
 
 I think we almost broke even with this release, only adding a few more
 lines than we removed, which isn't bad overall given that there's a
 bunch of new iio drivers added.  The Lustre developers seem to have
 woken up from their sleep and have been doing a great job in cleaning up
 the code and pruning unused or old cruft, the filesystem is almost
 readable :)
 
 Other than that, just a lot of basic coding style cleanups in the churn.
 All have been in linux-next for a while with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlc/00QACgkQMUfUDdst+ynXYQCdG9oEsw4CCItbjGfQau5YVGbd
 TOcAnA19tZz+Wcg3sLT8Zsm979dgVvDt
 =9UG/
 -----END PGP SIGNATURE-----

Merge tag 'staging-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging and IIO driver updates from Greg KH:
 "Here's the big staging and iio driver update for 4.7-rc1.

  I think we almost broke even with this release, only adding a few more
  lines than we removed, which isn't bad overall given that there's a
  bunch of new iio drivers added.

  The Lustre developers seem to have woken up from their sleep and have
  been doing a great job in cleaning up the code and pruning unused or
  old cruft, the filesystem is almost readable :)

  Other than that, just a lot of basic coding style cleanups in the
  churn.  All have been in linux-next for a while with no reported
  issues"

* tag 'staging-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (938 commits)
  Staging: emxx_udc: emxx_udc: fixed coding style issue
  staging/gdm724x: fix "alignment should match open parenthesis" issues
  staging/gdm724x: Fix avoid CamelCase
  staging: unisys: rename misleading var ii with frag
  staging: unisys: visorhba: switch success handling to error handling
  staging: unisys: visorhba: main path needs to flow down the left margin
  staging: unisys: visorinput: handle_locking_key() simplifications
  staging: unisys: visorhba: fail gracefully for thread creation failures
  staging: unisys: visornic: comment restructuring and removing bad diction
  staging: unisys: fix format string %Lx to %llx for u64
  staging: unisys: remove unused struct members
  staging: unisys: visorchannel: correct variable misspelling
  staging: unisys: visorhba: replace functionlike macro with function
  staging: dgnc: Need to check for NULL of ch
  staging: dgnc: remove redundant condition check
  staging: dgnc: fix 'line over 80 characters'
  staging: dgnc: clean up the dgnc_get_modem_info()
  staging: lustre: lnet: enable configuration per NI interface
  staging: lustre: o2iblnd: properly set ibr_why
  staging: lustre: o2iblnd: remove last of kiblnd_tunables_fini
  ...
2016-05-20 22:20:48 -07:00
Jacky Boen 99aded71b5 Staging: drivers: rtl8188eu: use sizeof(*ptr) instead of sizeof(struct)
Fix coding style issue

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:53 -07:00
Jacky Boen 9cb2dbf316 Staging: drivers: rtl8188eu: fixed extraneous spaces
Fix coding style issue

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:50 -07:00
Jacky Boen d5fdbca674 Staging: drivers: rtl8188eu: fixed extraneous parentheses
Fix coding style issue

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:50 -07:00
Jacky Boen a305990d38 Staging: drivers: rtl8188eu: fixed extraneous indentation
Fixed coding style issue

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:50 -07:00
Jacky Boen a634696eb4 Staging: drivers: rtl8188eu: fixed unnecessary else branch
Fixed coding style issue

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:50 -07:00
Jacky Boen a48d498b15 Staging: drivers: rtl8188eu: fixed brace style
Fixed coding style issue

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:50 -07:00
Jacky Boen 99f8adc450 Staging: drivers: rtl8188eu: fixed newlines style
Fixed coding style issue

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:50 -07:00
Jacky Boen 637642e2a3 Staging: drivers: rtl8188eu: fixed block comments style
Fixed coding style issue

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:50 -07:00
Jacky Boen f43534b97a Staging: drivers: rtl8188eu: fixed typo
Fixed typo

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:50 -07:00
Jacky Boen ffc9b27571 Staging: drivers: rtl8188eu: move constants to the right in comparisons
Fixed coding style issue

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:50 -07:00
Phil Sutter 9e73991732 staging: rtl8188eu: Convert to using IFF_NO_QUEUE
Cc: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-04-16 22:02:13 -04:00
Nicholas Sim e7c77e437b staging: rtl8188eu: remove return at end of void function call
Remove unnecessary return statements from last lines of void function call
(several)

Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Bhaktipriya Shridhar 4ada295da1 staging: rtl8188eu: os_dep: ioctl_linux: Clean up tests if NULL returned on failure
Some functions like kmalloc/kzalloc return NULL on failure.
When NULL represents failure, !x is commonly used.

This was done using Coccinelle:

@@
expression *e;
identifier l1;
@@

e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...);
...
- e == NULL
+ !e

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Bhaktipriya Shridhar 574502caed staging: rtl8188eu: os_dep: usb_intf: Clean up tests if NULL returned on failure
Some functions like kmalloc/kzalloc return NULL on failure.
When NULL represents failure, !x is commonly used.

This was done using Coccinelle:

@@
expression *e;
identifier l1;
@@

e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...);
...
- e == NULL
+ !e

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Bhaktipriya Shridhar 6e9aeda3fa staging: rtl8188eu: core: rtw_mlme: Clean up tests if NULL returned on failure
Some functions like kmalloc/kzalloc return NULL on failure.
When NULL represents failure, !x is commonly used.

This was done using Coccinelle:

@@
expression *e;
identifier l1;
@@

e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...);
...
- e == NULL
+ !e

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Bhaktipriya Shridhar a703f47265 staging: rtl8188eu: rtw_mlme_ext: Clean up tests if NULL returned on failure
Some functions like kzalloc return NULL on failure.
When NULL represents failure, !x is commonly used.

This was done using Coccinelle:

@@
expression *e;
identifier l1;
@@

e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...);
...
- e == NULL
+ !e

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Bhaktipriya Shridhar 12f037ece3 staging: rtl8188eu: rtw_cmd: Clean up tests if NULL returned on failure
Some functions like kmalloc/kzalloc return NULL on failure.
When NULL represents failure, !x is commonly used.

This was done using Coccinelle:

@@
expression *e;
identifier l1;
@@

e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...);
...
- e == NULL
+ !e

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Sandhya Bankar b5e12ec383 Staging: rtl8188eu: rtw_efuse: Use sizeof type *pointer instead of sizeof type.
Use sizeof type *pointer instead of sizeof type.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Sandhya Bankar f3e80d80e9 Staging: rtl8188eu: usb_halinit: Use !x instead of x == NULL.
Use !x instead of x == NULL.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Sandhya Bankar eec1c50002 Staging: rtl8188eu: rtl8188e_rxdesc: Use !x instead of x == NULL.
Use !x instead of x == NULL.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Sandhya Bankar 79146cedc3 Staging: rtl8188eu: hal_intf: Use x instead of x != NULL.
Use x instead of x != NULL.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Sandhya Bankar 7f69e09aba Staging: rtl8188eu: Hal8188ERateAdaptive: Use x instead of x != NULL.
Use x instead of x != NULL.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Nicholas Sim 17d4591d96 staging: rtl8188eu: remove return at end of void function call
Remove unnecessary return statement from last line of void function call

Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Kyle Kuffermann fb025382b4 staging: rtl8188eu: Remove license paragraph with mailing address
This fixes the issue reported by checkpatch.pl:

	"Do not include the paragraph about writing to the Free Software
	Foundation's mailing address from the sample GPL notice. The FSF
	has changed addresses in the past, and may do so again.  Linux
	already includes a copy of the GPL."

in all files for the rtl8188eu driver.

Signed-off-by: Kyle Kuffermann <kyle.kuffermann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Ben Marsh 5a9e10a11e Staging: rtl8188eu: removes an unnecessary cast on a void pointer.
Patch to rtl8188e_rxdesc.c to remove an unnecessary cast on a void
pointer.

Signed-off-by: Ben Marsh <bmarsg94@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Bhumika Goyal 78a729ff16 Staging: rtl8188eu: Remove function rtw_freq2ch
Remove function rtw_freq2ch as it is never used anywhere in the kernel.
Also, remove the function prototype.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Claudiu Beznea eb8329c6b3 Staging: rtl8188eu: removed unnecessary check in core/rtw_ap.c
This patch removes unnecessary "if (true)" check in update_BCNTIM()
from core/rtw_ap.c file. After this remove the code alignment was
necessary.

Signed-off-by: Claudiu Beznea <claudiu.beznea@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar 61a95c8d71 staging: rtl8188eu: os_dep: Remove unnecessary else after return
This patch fixes the checkpatch warning that else is not generally
useful after a break or return.

This was done using Coccinelle:
@@
expression e2;
statement s1;
@@
if(e2) { ... return ...; }
-else
         s1

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Sandhya Bankar e59b76cfca Staging: rtl8188eu: Use !x instead of x==NULL.
Use !x instead of x==NULL.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Sandhya Bankar b08e0fc0d4 Staging: rtl8188eu: rtw_efuse: Do not print message if kzalloc() failed.
Do not print message if kzalloc() failed.
kzalloc() has its own messages. So no need to add extra one.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Sandhya Bankar d4ff4e2967 Staging: rtl8188eu: Do not print message if kzalloc() failed.
Do not print message if kzalloc() failed.
kzalloc() has its own messages. So no need to add extra one.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Kyle Kuffermann 7a1586353b rtl8188eu: Add spaces around arithmetic operators
This fixes the checkpatch.pl issue: CHECK: spaces preferred around that '+'

Signed-off-by: Kyle Kuffermann <kyle.kuffermann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Ivan Safonov 0f94b0afcd staging: rtl8188eu: remove PWR_BASEADDR_* macro definitions and "base" member of wl_pwr_cfg structure
These macros and "base" member of wl_pwr_cfg structure
are used only to produce debug output.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Ivan Safonov 0e54dbd4c7 staging: rtl8188eu: remove PWR_INTF_*_MSK macro definitions and interface_mask of wl_pwr_cfg structure
This driver is intended only for usb devices.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Ivan Safonov 3f1599e886 staging: rtl8188eu: remove PWR_FAB_*_MSK macro definitions and fab_msk of wl_pwr_cfg structure
fab_msk used for marking commands
for devices of a certain manufacturer.

However, always used only PWR_FAB_ALL_MSK value of fab_msk.

Most likely, such mark is useless.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Ivan Safonov fd50e119e6 staging: rtl8188eu: remove FabVersion member of odm_dm_struct struct
Value of this variable is hardcoded
and used only to produce debug output.
Probably, FabVersion is useless.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Ivan Safonov 29b9e16884 staging: rtl8188eu: remove chip_type of the adapter structure
chip_type variable is unnecessary here,
because this driver is only for one chip
and it is not used after initialization.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Ivan Safonov 2e48f0df5c staging: rtl8188eu: replace (a == NULL) to (!a) in rtw_drv_init
It is a checkpatch cleanups:
CHECK: Comparasion to NULL could be written ...

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Ivan Safonov 43e02454d7 staging: rtl8188eu: remove unnecessary debug output from os_dep/usb_intf.c
Debug output in rtw_drw_init is excess

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Ivan Safonov 02295b7f24 staging: rtl8188eu: remove unused macros from include/basic_types.h
FIELD_OFFSET, READEF1BYTE, READEF2BYTE, READEF4BYTE
WRITEEF1BYTE, WRITEEF2BYTE, WRITEEF4BYTE are removed.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Ivan Safonov e2d5d10dea staging: rtl8188eu: remove unused include/ieee80211_ext.h
This file is not used for the driver compiling

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Ivan Safonov 5e3027b653 staging: rtl8188eu: FIELD_OFFSET macro replaced by offsetof macro
FIELD_OFFSET and offsetof macro are equal

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar 2c10efbd07 staging: rtl8188eu: os_dep: Remove NULL test before vfree
vfree frees the virtually continuous memory area starting at addr.
If addr is NULL, no operation is performed. So NULL test is not needed
before vfree.

This was done using Coccinelle:

@@
expression x;
@@
-if (x != NULL)
    vfree(x);

@@
expression x;
@@

-if (x != NULL) {
vfree(x);
x = NULL;
-}

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar 7570ad9104 staging: rtl8188eu: core: Remove NULL test before vfree
vfree frees the virtually continuous memory area starting at addr.
If addr is NULL, no operation is performed. So NULL test is not needed
before vfree.

This was done using Coccinelle:

@@
expression x;
@@
-if (x != NULL)
    vfree(x);

@@
expression x;
@@

-if (x != NULL) {
vfree(x);
x = NULL;
-}

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar 235a010362 staging: rtl8188eu: core: Remove useless return variables
This patch removes unnecessary return variables and compresses the
return logic.
The coccinelle script that finds and fixes this issue is:

@@ type T; identifier i,f; constant C; @@
- T i;
...when != i
when strict
( return -C;
|
- i =
+ return
f(...);
- return i;
)

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar 92098c1f0b staging: rtl8188eu: os_dep: Remove useless return variables
This patch removes unnecessary return variables and compresses the
return logic.
The coccinelle script that finds and fixes this issue is:
@@ type T; identifier i,f; constant C; @@
- T i;
...when != i
when strict
( return -C;
|
- i =
+ return
f(...);
- return i;
)

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar bd37c43c8d staging: rtl8188eu: core: Remove casts of pointer to same type
Casting a pointer to a pointer of the same type is unnecessary, so remove
these unnecessary casts.

This was done with Coccinelle:

@@
type T;
T *ptr;
@@
- (T *)ptr
+ ptr

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar 3edd192bb8 staging: rtl8188eu: hal: Drop Useless Initialization
Removed initialisation of a varible if it is immediately reassigned.
Changes were made using Coccinelle.
@bad@
identifier i;
position p;
@@

i =@p <+...i...+>;

@@
type T;
constant C;
expression e;
identifier i;
position p != bad.p;
@@
T i
- = C
;
i =@p e;

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar 47b67704a1 staging: rtl8188eu: Remove unnecessary parantheses
Removed parantheses on the right hand side of assignments as they are
not needed.

This was done with Coccinelle:

@@ expression a, b; @@

a =
- (
b
- )
;

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Amitoj Kaur Chawla a32ee8bbfa staging: rtl8188eu: os_dep: Remove header file
Remove duplicate include file. Found using includecheck.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-22 12:03:22 -08:00
Bhaktipriya Shridhar b383f2acbd staging: rtl8188eu: core: Remove unnecessary braces
This patch removes braces for single statement blocks. The warning
was detected using checkpatch.pl.
Coccinelle was used to make the change.

@@
expression e,e1;
@@

- if (e) {
+ if (e)
  e1;
- }

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Andrew Bradford 816c2db010 staging: rtl8188eu: Remove RF_PATH_C & RF_PATH_D
RTL8188EE has a maximum of 2 RF paths (chains) so paths C and D are not
needed to support this part.

Signed-off-by: Andrew Bradford <andrew@bradfordembedded.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Colin Vidal a3c0c480e8 Staging: rtl8188eu/core: Coding style fix, avoid line over 80 characters
Jump a new line after and operator of the test. It avoids to exceed 80
chars line, and remove a checkpatch warning.

Signed-off-by: Colin Vidal <colin@cvidal.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Colin Vidal 18dbf8eacc Staging: rtl8188eu/core: Coding style fix, set constant operand on right in tests
Remove a checkpatch warning, putting constant operant on right of two tests.

Signed-off-by: Colin Vidal <colin@cvidal.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Colin Vidal c3588214cb Staging: rtl8188eu/core: Coding style fix, set conform spaces between identifiers
And a space after include keyword, making the preprocessor more
readable, and remove an unexpected space between a type and variable
name.

Signed-off-by: Colin Vidal <colin@cvidal.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Colin Vidal 7ca6a96340 Staging: rtl8188eu/core: remove paragraph which mention FSF address in comment header
As FSF address changed in the past, and can change in the future,
remove the address paragraph in the comment header, and avoid a warning
of checkpatch.

Signed-off-by: Colin Vidal <colin@cvidal.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Amitoj Kaur Chawla 684d2f1005 staging: rtl8188eu: core: Use put_unaligned_le16
Introduce the use of function put_unaligned_le16.
This is done using the following Coccinelle semantic patch:

//<smpl>
@@ identifier tmp; expression ptr; expression y,e; type T; @@

- tmp = cpu_to_le16(y);

  <+... when != tmp
- memcpy(ptr, (T)&tmp, ...);
+ put_unaligned_le16(y,ptr);
  ...+>
? tmp = e

@@ type T; identifier tmp; @@

- T tmp;
...when != tmp
//</smpl>

Corresponding header file has been added too.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Bhumika Goyal da04bf74b4 Staging: rtl8188eu: core: rtw_xmit.c: Remove NULL test before vfree
The function vfree tests whether the argument is NULL and returns
immediately. So NULL test is not needed before vfree. Also remove blank
line between function calls.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Bhumika Goyal 64e6619fd3 Staging: rtl8188eu: core: rtw_mlme.c: Remove NULL test before vfree
The function vfree tests whether the argument is NULL and returns
immediately. So NULL test before vfree is not needed. Also remove braces
around if branch as they are no longer needed.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Bhumika Goyal a4e320b721 Staging: rtl8188eu: os_dep: Remove NULL test before rtw_free_netdev
The function rtw_free_netdev test whether its argument is NULL and
return immediately. So NULL test before this function is not needed.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:44:06 -08:00
Andrew Bradford d9b36d5225 staging: rtl8188eu: fix signal strength indication
RTL8188E can only have a maximum of 2 chains so match that in the actual
phy_rx_agc_info structure within phy_status_rpt.  This will cause the
other data received from the PHY, such as signal strength indication of
beacons, to properly align and allow extraction and use within the
signal strength record-keeping mechanisms.

Signed-off-by: Andrew Bradford <andrew@bradfordembedded.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 20:03:56 -08:00
Ivan Safonov 8b0187188a staging: rtl8188eu: add release_firmware() between request_firmware and function error exit
Small memory leak fixed.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 20:03:56 -08:00
Ivan Safonov 29e20dd4c7 staging: rtl8188eu: remove pfirmware and fwsize of the hal_data_8188e structure
The pfirmware is used only in rtl88eu_download_fw function
(except the kfree(rtlhal->pfirmware) in netdev_close).

The fwsize not used after initialization at all.

The pfirmvare replaced by fw_data and fwsize removed.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 20:03:56 -08:00
Ivan Safonov f643ba69d1 staging: rtl8188eu: remove _rtl88e_fill_dummy
The _rtl88e_fill_dummy function replaced by memset in rtl88eu_download_fw.

More appropriate names are used for pfwdata and fwsize variables
(download_data and download_size respectively).

Also u32 replaced by size_t for download_size variable.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 20:03:56 -08:00
Janani Ravichandran 139737983d staging: rtl8188eu: Remove unnecessary pointer cast
Remove unnecessary pointer cast. Issue found using the following Coccinelle semantic patch.

@@
type T;
T e;
identifier x;
@@

* T x = (T)e;

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 20:03:56 -08:00
Greg Kroah-Hartman 8052d7dd4e staging: rtl8*: fix my email address up
For some reason I had an old linux.com address in these TODO files,
point to my linuxfoundation.org address as that works properly here.

Reported-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:33:46 -08:00
Hari Prasath Gujulan Elango a3124e7b72 staging: rtl8188eu: use eth_broadcast_addr() in place of memset
Replace the memset of array to broadcast address 0xFF by using the
eth_broadcast_addr() API

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:00:46 -08:00
Geliang Tang b9f1c275b6 staging: rtl8188eu: use list_first_entry_or_null()
Use list_first_entry_or_null() instead of list_empty() + container_of()
to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:00:46 -08:00
Andy Shevchenko a67080ee82 staging: rtl8188eu: print OUI with %*ph
There is no need to pass each byte as a parameter when printing values in hex
format. We rather use %*ph specifier for that.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:00:46 -08:00
Andy Shevchenko fb27e19c08 staging: rtl8188eu: replace open-coded print_hex_dump()
No need to reinvent a wheel, i.e. print_hex_dump(). Replace an open-coded
variant by generic kernel helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:00:46 -08:00
Andy Shevchenko 6d7b280144 staging: rtl8188eu: provide an absolute path to include folder
Otherwise compiler will complain as follows

  CC [M]  drivers/staging/rtl8188eu/core/rtw_ap.o
cc1: warning: drivers/staging/rtl8188eu/include: No such file or directory [-Wmissing-include-dirs]

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:00:46 -08:00
Chris Elliott 5fa0e06d7a Staging: rtl8188eu: core: rtw_debug: fixed a parentheses coding style issue
Removed unnecessary parentheses.

Signed-off-by: Chris Elliott <chris@uksysadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:00:46 -08:00
Alexey Tulia b0800a4bd9 staging: rtl8188eu: remove an extra space
drivers/staging/rtl8188eu/core/rtw_wlan_util.c:1377 check_assoc_AP() warn: inconsistent indenting

Signed-off-by: Alexey Tulia <alexey.tulia@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:58:31 -08:00
Luca Ceresoli 35ad45a199 staging: rtl8188eu: rtw_mlme_ext.c: simplify call to issue_action_BA()
Using the ternary operator allows to more concisely write the same
code, and to stay within 80 characters without even increasing the
number of lines.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:58:31 -08:00
Luca Ceresoli d6c6ad9611 staging: rtl8188eu: rename camelcase bAcceptAddbaReq
There is such a field both in struct mlme_ext_info and in struct
registry_priv. Rename both.

Also fix checkpatch issue in the lines touched:
  WARNING: line over 80 characters

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:58:31 -08:00
Luca Ceresoli f0f17bed9a staging: rtl8188eu: remove useless variable rtw_AcceptAddbaReq
rtw_AcceptAddbaReq is a static variable, it is set once and never
modified. It is referenced only once, to assign its value to a member
of struct registry_priv with practically the same name.

Get rid of the variable, and move the meaningful part of the comment
near the declaration of the relevant field of struct registry_priv.

Raises a new checkpatch issue, which is fixed in a later commit:
  CHECK: Avoid CamelCase: <bAcceptAddbaReq>

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:58:31 -08:00
Luca Ceresoli 329862549c staging: rtl8188eu: rtw_mlme_ext.c: remove commented code
This line is connented since the initial import in commit 7b464c9fa5
("staging: r8188eu: Add files for new driver - part 4") and there's no
comment stating how it could ever be useful.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:58:31 -08:00
Luca Ceresoli d0beccb04e staging: rtl8188eu: don't cast to void* when calling memset()
The first argument to memset() is (void *), the explicit typecasts are
not needed. They just make code less readable.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:58:31 -08:00
Luca Ceresoli 8891bcac17 staging: rtl8188eu: add spaces around binary '*'
Fix checkpatch issue:
  CHECK: spaces preferred around that '*' (ctx:VxV)

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:58:31 -08:00
Ivan Safonov 25e168a4a3 staging: rtl8188eu: goto removed
malloc error handling moved into one place.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov 4a3bda22fd staging: rtl8188eu: goto replaced by 'else' branch
goto is not needed here.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov d14c07f6ff staging: rtl8188eu: unused macros removed
IS_* and GET_CVID_* macros have not been used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov 940f90eae6 staging: rtl8188eu: rarely used macros replaced by their definitions
IS_* macros (except one) occur only once.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov 08ecab13e1 staging: rtl8188eu: for loop instead of while loop used
The range of elements to fill with zeros is determined by using a roundup macro

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov 13cab3d422 staging: rtl8188eu: offset renamed to write_address
This name is better suited for this variable.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov 7e91b28a01 staging: rtl8188eu: pu4BytePtr renamed to dword_buffer
This name is better suited for this variable.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov 988c514688 staging: rtl8188eu: buf_ptr renamed to byte_buffer
This name is better suited for this variable.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov 6e84aa6c82 staging: rtl8188eu: unnessesary braces for single statement block removed
checkpatch fix:
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov 429078e1f1 staging: rtl8188eu: unnecessary initialization removed
It is superfluous.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov 645d2a8f46 staging: rtl8188eu: types of local variables conformed with types of function arguments
The array should not change in any case.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov 1e7e93ee6d staging: rtl8188eu: buf_ptr variable completely defined in a single line
It is simpler.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov ec60e037c7 staging: rtl8188eu: offset increment placed into for loop header
It makes the code little easier.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov f464b3a08c staging: rtl8188eu: unnecessary branching removed
If the 'remain' is zero, the loop is not executed at all.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov 8107b147d7 staging: rtl8188eu: unnecessary variable override removed
Variable value calculated in the previous loop.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov 37d5579095 staging: rtl8188eu: offset variable replaced by its value
It is now possible to get rid of re-initializing the offset variable.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov 1c48deffc7 staging: rtl8188eu: initial value placed in the variable
Line become shorter.
After the loop offset variable points to the location following insertion.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov d44f58f7c5 staging: rtl8188eu: assigning a value to the variable is replaced by the increment
It is made to the initial value could be placed in the offset variable.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov 52863d83f3 staging: rtl8188eu: *(ptr + i) replaced by ptr[i] in _rtl88e_fw_block_write
It is better to read.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Abdul Hussain 6d9b0f00ec Staging: rtl8188eu: fix space prohibited before that ','
This patch fixes the following checkpatch.pl error:
fix space prohibited before that ','

Signed-off-by: Abdul Hussain <hussain.abdul@outlook.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov 37efd08231 staging: rtl8188eu: 'infinite' loop removed
The body of this loop is executed only once, so it can be removed.
In this loop no keyword 'continue', only 'break' at the end.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov 72fb6c5a9d staging: rtl8188eu: while loop replaced by for loop
Here is more suitable for loop.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov 2b5a10a923 staging: rtl8188eu: do .. while (0) loop replaced by while (...) loop
It is a simple and clear representation of this loop.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Rémy Oudompheng 3913c19ae7 staging: rtl8188eu: add missing delay in polling loops.
Previously the code could exit with failure too early.

Signed-off-by: Rémy Oudompheng <remyoudompheng@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Rémy Oudompheng ed73749426 staging: rtl8188eu: jiffies are unsigned long
Remove rtw_get_passing_time_ms function and adjust type
of relevant variables.

Signed-off-by: Rémy Oudompheng <remyoudompheng@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Amitoj Kaur Chawla afcf9bc1bf staging: rtl8188eu: core: Change function parameter to bool
Change int wait_ack to bool wait_ack as it only takes true or false as its argument.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Amitoj Kaur Chawla 03ea25f0c5 staging: rtl8188eu: core: Remove wrapper function
Remove wrapper function issue_probereq() that can be replaced by a
single line of code and rename _issue_probereq() to issue_probereq().

This patch also fixes line over 80 characters checkpatch.pl warning.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Amitoj Kaur Chawla ce3b84ab53 staging: rtl8188eu: Remove unused function
Remove function that is declared but not called anywhere.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Amitoj Kaur Chawla f3a2d1adfd staging: rtl8188eu: core: rtw_ap : Remove unnecessary functions
Drop unnecessary functions that are declared but not being used.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ivan Safonov 853a46638e staging: rtl8188eu: pwrGrpCnt variable removed in store_pwrindex_offset function
This variable used only once in the beginning of the function,
it can be removed.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov 5bee5d583b staging: rtl8188eu: new variable for hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt] in store_pwrindex_offset function
hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt] frequent in this function, so it replaced by the power_level_offset new variable.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov 83d7b6cbc8 staging: rtl8188eu: checkpatch fixes: 'Avoid CamelCase' in hal/bb_cfg.c
This is checkpatch fixes for hal/bb_cfg.c file: Avoid CamelCase.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov 420a952e42 staging: rtl8188eu: checkpatch fixes: line over 80 characters splited into two parts
This is checkpatch fixes for hal/bb_cfg.c file:
line over 80 characters.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov 5d5efcbddc staging: rtl8188eu: checkpatch fixes: alignment should match open parenthesis
This is checkpatch fixes for hal/bb_cfg.c file:
alignment should match open parenthesis.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov 5ce5b8d3f2 staging: rtl8188eu: checkpatch fixes: unnecessary parentheses removed in hal/bb_cfg.c
This is checkpatch fixes for hal/bb_cfg.c file:
unnecessary parentheses around <expr>.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov 53d06211e2 staging: rtl8188eu: checkpatch fixes: spaces preferred around that '|' in hal/bb_cfg.c
This is checkpatch fixes for hal/bb_cfg.c file:
spaces preferred around that '|'.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov 160edfddf7 staging: rtl8188eu: operator = replaced by += in loop increment
x = x + a and x += a equivalen, but second preferably.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov 32b5844e1f staging: rtl8188eu: occurrence of the 5 GHz code marked
Channel numbers greater than 14 are used here, which are possible only
for the 5 GHz frequency.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov b546c0f9c3 staging: rtl8188eu: increment placed into for loop header
The increment at the end of the cycle, and it can be placed in the loop header.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov 628bd1c057 staging: rtl8188eu: while loop replaced by for loop in rtw_restruct_wmm_ie
This patch replaces while loop with for loop, because the initial condition and the increment clearly and briefly defined for this loop.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov 2bc8c2fb22 staging: rtl8188eu: unused MIN macro removed
This patch removes unused MIN macro from include/rtw_security.h.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov 7687e58a5a staging: rtl8188eu: unused MEM_ALIGNMENT_OFFSET and MEM_ALIGNMENT_PADDING macros removed
This patch removes unused MEM_ALIGNMENT_OFFSET and MEM_ALIGNMENT_PADDING macros
from include/basic_types.h.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov 8a3a379d35 staging: rtl8188eu: unused SUCCESS and FAIL macros removed
This patch removes unused SUCCESS and FAIL macros in include/basic_types.h.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov 016c6bbaf1 staging: rtl8188eu: abs kernel macro used in simularity_compare function
abs macro is useful for determining the difference between the two integers.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov 530c9b1b21 staging: rtl8188eu: ternary operator (?:) replaced by min_t kernel macro
min_t macro better conveys the meaning of the code.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov ad8d8cd3b5 staging: rtl8188eu: ternary operator (?:) replaced by min_t kernel macro
min_t macro better conveys the meaning of the code.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov 20e765310e staging: rtl8188eu: ternary operator (?:) replaced by min/max kernel macro
min (or max) kernel macro better conveys the meaning of the code.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov 66eaaf4d0d staging: rtl8188eu: clamp kernel macro used in proc_get_rx_signal
To limit the range of integers there is clamp macro.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Ivan Safonov bbef4729a1 staging: rtl8188eu: sizeof/sizeof replaced by ARRAY_SIZE kernel macro
ARRAY_SIZE shorter and more difficult to create bugs.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Amitoj Kaur Chawla f79dc1679a staging: rtl8188eu: Remove unnecessary variables
Remove unnecessary variable that can be replaced with a single line
of code.

The semantic patch used to find this is:

// <smpl>
@@
expression ret;
@@
- if (ret) return ret;
- return 0;
+ return ret;

@@
local idexpression ret;
expression e;
@@
- ret = e;
- return ret;
+ return e;

@@
type T;
identifier i;
expression E;
@@
- T i = E;
 ... when != i

@@
type T;
identifier i;
@@
- T i;
 ... when != i
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:00:47 +09:00
Luis de Bethencourt 7346489110 staging: rtl8188eu: fix misleading indentation
Code is correct, i needs to be moved back by 2 to correct for the last
iteration of the while loop, since READ_NEXT_PAIR advances two. Fixing
the misleading indentation.

Fix a smatch warning:
drivers/staging/rtl8188eu/hal/rf_cfg.c:217
rtl88e_phy_config_rf_with_headerfile() warn: curly braces intended?

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:25:13 -07:00
Anish Bhatt 9c68ed09fe rtl8188eu : BIT() macro cleanup
Use the BIT(x) macro directly instead using multiple
BITX defines.

Signed-off-by: Anish Bhatt <anish@gatech.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:25:13 -07:00
Alexey Khoroshilov ac0a366799 staging: r8188eu: Add _enter_critical_mutex() error handling
_enter_critical_mutex() is a simple call to mutex_lock_interruptible(),
but there is no error handling code for it.

The patch removes wrapper _enter_critical_mutex() and
adds error handling for mutex_lock_interruptible().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17 20:56:10 -07:00
Shivani Bhardwaj d762c9b4b4 Staging: rtl8188eu: rtw_ieee80211: Remove unnecessary cast
Explicit type conversion is not required and should be removed.
Semantic patch used:
@@
type T;
T e;
identifier x;
@@

* T x = (T)e;

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:51:48 -07:00
Shivani Bhardwaj 96c3522855 Staging: rtl8188eu: rf_cfg: Remove useless cast
Type conversion of variables can be done by compiler implicitly so,
explicit conversions should be removed.
Semantic patch used:
@@
type T;
T e;
identifier x;
@@

* T x = (T)e;

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:51:48 -07:00
Ivan Safonov bb30b15aea staging: rtl8188eu: spaces preferred around that + inserted
This patch inserts spaces preferred around that '+' found by checkpatch.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 20:48:09 -07:00
Ivan Safonov 59056281af staging: rtl8188eu: ARRAY_SIZE instead of sizeof/sizeof used
This patch inserts ARRAY_SIZE instead of sizeof(type array[])/sizeof(type),
made arraylen variable constant
and removes unnecessary default value in variable definition.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 20:48:09 -07:00
Shraddha Barke e525e7a63b Staging: rtl8188eu: core: Use ARRAY_SIZE macro
ARRAY_SIZE is more concise to use when the size of an array is divided
by the size of its type.

Changes made using Coccinelle-

@@
type T;
T[] E;
@@

- (sizeof(E)/sizeof(T))
+ ARRAY_SIZE(E)

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 20:45:38 -07:00
Ivan Safonov d84d66f6f7 staging: rtl8188eu: unused macro read_next_pair removed
Unused macro read_next_pair removed from rtl8188eu driver.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 20:45:38 -07:00
Iban Rodriguez 19fac3bbe2 Staging: rtl8188eu: Correct coding style errors
Correct errors reported by checkpatch.pl because space prohibited
before ','.
Also split one line into two as it was longer than
80 characters

Signed-off-by: Iban Rodriguez <iban.rodriguez@ono.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 20:45:38 -07:00