1
0
Fork 0
Commit Graph

1117 Commits (c261189862c6f65117eb3b1748622a08ef49c262)

Author SHA1 Message Date
Sreenath Madasu 249472588c staging: rtl8188eu: core: Fixed 80 character length warning
When the checkpatch.pl script was run, it showed lines with length
more than 80 characters in rtw_ap.c file. Fixed line number 382 by
breaking it up into two lines within 80 characters.

Signed-off-by: Sreenath Madasu <Sreenath.Madasu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 20:08:31 -07:00
Sunil Shahu e1d0bcedfb staging: rtl8188eu: core: rtw_mlme: remove space before ','
Fix coding style error by removing spaces before ',' as suggested by
checkpatch.pl script.

Signed-off-by: Sunil Shahu <shshahu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 20:07:43 -07:00
Prasanna Karthik 9e7e78d829 staging:rtl8188eu: Code cleanup fix reported by coccinelle
bool check modified

Signed-off-by: Prasanna Karthik <mkarthi3@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 20:07:42 -07:00
Jakub Sitnicki 027d3efd93 staging: rtl8188eu: don't duplicate ieee80211 WLAN_CAPABILITY_* constants
linux/ieee80211.h already defines constants for capability bits.
Include it where needed, resolve discrepancies in naming, and remove the
duplicated definitions.

Also, make use of WLAN_CAPABILITY_IS_STA_BSS() macro to check if neither
ESS nor IBSS capability bits are set.

Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 20:07:42 -07:00
Jimmy Devine c99efd4fec staging: rtl8188eu: remove space before open square bracket '['
Fixes checkpatch error regarding the space before open square bracket '['

Signed-off-by: Jimmy Devine <fxmulder@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18 21:13:48 -07:00
Jakub Sitnicki 08c4019747 staging: rtl8188eu: kill unused INCLUDE_MULTI_FUNC_* macros
Also, remove rt_multi_func enum used exclusively by the killed macros.

Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-15 21:56:37 -07:00
Hari Prasath Gujulan Elango 84b2f7985c staging: rtl8188eu: fix typo in comments section
This patch fixes a typo in the comment section.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-15 21:56:37 -07:00
Luca Ceresoli f996bd10a0 staging: rtl8188eu: don't define OnAuth() in non-AP mode
If CONFIG_88EU_AP_MODE is undefined, OnAuth() is never referenced.

Fixes warning:
  drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:2725:21: warning: ‘OnAuth’ defined but not used [-Wunused-function]

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Fixes: 68345dd7bc ("staging: rtl8188eu: rtw_mlme_ext.c: unexport message callbacks")
Cc: Greg Kroah-Hartman <gregkh@linux.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-14 09:45:55 -07:00
Luca Ceresoli 2b49e0fce2 staging: rtl8188eu: don't define issue_asocrsp() in non-AP mode
If CONFIG_88EU_AP_MODE is undefined, issue_asocrsp() is never referenced.

Fixes warning:
  drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:891:13: warning: ‘issue_asocrsp’ defined but not used [-Wunused-function]

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Fixes: 782eddd748 ("staging: rtl8188eu: unexport internal functions")
Cc: Greg Kroah-Hartman <gregkh@linux.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-14 09:45:55 -07:00
Sudip Mukherjee 4e18248a66 staging: rtl8188eu: remove function which does nothing
The function rtw_mfree_all_stainfo() is just holding the lock,
traversing the list, and then unlocking. It is not doing anything else.
So removed the function and modified the places from where it was called.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12 17:23:11 -07:00
Sudip Mukherjee 9393d34e49 staging: rtl8188eu: remove unused variables
These variables were being set but not used afterwards.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12 17:23:11 -07:00
Sudip Mukherjee 71d62adb67 staging: rtl8188eu: remove unused enum and CONFIG
The CONFIGs, the enum and the function declaration was not being
used anywhere.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12 17:23:11 -07:00
Luca Ceresoli ebd21582bd staging: rtl8188eu: fix wrong debug print
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12 17:22:06 -07:00
Luca Ceresoli a26c9eedcd staging: rtl8188eu: issue_probersp(): remove unused variable and dead code
is_valid_p2p_probereq is initialized to false and never modified. Code
depending on it is dead code. Remove all of it.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12 17:22:06 -07:00
Luca Ceresoli 935142236d staging: rtl8188eu: issue_probersp(): remove unused parameter
The is_valid_p2p_probereq is never referenced in the function body.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12 17:22:05 -07:00
Luca Ceresoli 782eddd748 staging: rtl8188eu: unexport internal functions
These are internal functions. Remove their declaration in rtw_mlme_ext.h
and make them static.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12 17:22:05 -07:00
Luca Ceresoli 68345dd7bc staging: rtl8188eu: rtw_mlme_ext.c: unexport message callbacks
These are internal functions. Remove their declaration in rtw_mlme_ext.h
and make them static.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12 17:22:05 -07:00
Luca Ceresoli 4e10234453 staging: rtl8188eu: rtw_mlme_ext.c: reorder message callbacks and tables
The message handling stored in mlme_sta_tbl and OnAction_tbl are internal and
will be declared static, and their declaration removed from rtw_mlme_ext.h, in
a later commit.

This would break compilation, since they are are referenced before their
definition.

Reorder these functions and the structures that hold them so that symbols are
defined before they are referenced, without the need for forward declarations.

This commit only reorders code, there is no content change.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12 17:22:05 -07:00
Fabian Frederick 8a889aee58 Staging: rtl8188eu: use swap() in WMMOnAssocRsp()
Use kernel.h macro definition.

Thanks to Julia Lawall for Coccinelle scripting support.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12 17:13:27 -07:00
Andrzej Pietrasiewicz e703f23747 staging: rtl8188eu: eliminate spaces before commas
Eliminate "space prohibited before that ','" errors found by checkpatch,
but do this only to lines which after the patch is applied do not
exceed 80 characters. Out of that only those lines are changed, whose
context does not exceed 80 characters in each line. In other words the
changes are limited to cases where the patch generated is itself
checkpatch-correct.

Rebased onto next-20150605.

Signed-off-by: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-10 18:04:04 -07:00
Markus Böhme bfee7c9665 staging: rtl8188eu: core/rtw_led.c: fix coding style issue
Convert spaces at the start of a line to a tab.

Signed-off-by: Markus Böhme <markus.boehme@mailbox.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:45:30 -07:00
Hari Prasath Gujulan Elango ed701c4ab2 staging: rtl8188eu: use table to get channel plan from country code
Use a table to get a channel plan from a given country code.This was a
TODO mentioned as a comment in the driver.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:38:56 -07:00
Hari Prasath Gujulan Elango 3b83fb7589 staging: rtl8188eu: remove unwanted assignment
remove an unwanted assignment to a variable which is overwritten in the
very next line.The first value assigned is not used.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:33:39 -07:00
Jakub Sitnicki 5df5910b13 staging: rtl8188eu: Kill dead calls to kill_pid()
There is no interface to register PIDs of processes the driver should
send a signal to.  Remove it.

Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01 06:25:51 +09:00
Jakub Sitnicki 44af49b63e staging: rtl8188eu: Remove redundant CONFIG_88EU_AP_MODE tests
Remove #ifdef's enclosed by an #ifdef test for the same macro to improve
readability.

No code changes:

  md5, CONFIG_88EU_AP_MODE=y:
    b819a33f65133607ebc33b8999ee3a79  r8188eu.o.before
    b819a33f65133607ebc33b8999ee3a79  r8188eu.o.after

  md5, CONFIG_88EU_AP_MODE=n:
    94c84035d59285408b866a57b442276d  r8188eu.o.before
    94c84035d59285408b866a57b442276d  r8188eu.o.after

Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 12:01:37 +09:00
Luca Ceresoli 7fc0406f48 staging: rtl8188eu: return an error code, not a boolean
"If the name of a function is an action or an imperative command,
the function should return an error-code integer." (Documentation/CodingStyle)

Several action-like functions in this driver return a boolean: _SUCCESS = 1 on
success, _FAIL = 0 on error, defined in
drivers/staging/rtl8188eu/include/osdep_service.h.

Change rtw_start_drv_threads() to return a proper 0-or-error value.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Greg Kroah-Hartman <gregkh@linux.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 12:01:37 +09:00
Luca Ceresoli 8b9ffb43ac staging: rtl8188eu: declare internal symbols as static
Also remove them from .h files.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Greg Kroah-Hartman <gregkh@linux.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 12:01:37 +09:00
Luca Ceresoli cfaf917e6b staging: rtl8188eu: remove useless return value
The loadparam() function cannot fail, it's called only once and its return
value is ignored there.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Greg Kroah-Hartman <gregkh@linux.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 12:01:37 +09:00
Luca Ceresoli ede000f375 staging: rtl8188eu: add missing blank lines after declarations
Fixes checkpatch warnings:
  WARNING: Missing a blank line after declarations

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Greg Kroah-Hartman <gregkh@linux.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 12:01:37 +09:00
Luca Ceresoli 79ef68c83b staging: rtl8188eu: cosmetic: remove useless spaces
Even though these are not reported by checkpatch, they are coding style issues.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Greg Kroah-Hartman <gregkh@linux.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 12:01:36 +09:00
Jagan Teki 0a36d5fbd9 staging: rtl8188eu: core: Fix line over 80 characters
This patch fixes line over 80 characters warninings while
running checkpatch.pl - "WARNING: line over 80 characters"

Signed-off-by: Jagan Teki <jteki@openedev.com>
Cc: Greg Kroah-Hartman <gregkh@linux.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:47:56 +09:00
Sai.Jiang ae33b51453 Staging: rtl8188eu: fix coding style
Remove two warnings of missing-blank-line-after-declaration.

Signed-off-by: Sai.Jiang <sai.d.jiang@foxmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:47:56 +09:00
Paul Gortmaker 04fbf979b3 rtl8188eu: don't duplicate ieee80211 constants for status/reason
These are all defined as a part of the standard and should not be
duplicated on a per-driver basis.  Use the global ones and delete the
local ones.

Note that a couple of them had slight wording differences, things like
INVALID vs. NOT_VALID or similar, so they are aligned with the global
naming conventions here, as dictated by compile testing.

This isn't the totality of duplicated data removed, but it is a start.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:13 +02:00
Luca Ceresoli 4b248ab2dd staging: rtl8188eu: remove commented code
This code is commented since the initial commit. Probably it is a remnant of
old code.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:11 +02:00
Luca Ceresoli 2f13617a35 staging: rtl8188eu: remove useless comment
"step 2" does mean much as there is no "step 1" stated anywhere...

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:10 +02:00
Luca Ceresoli 471450531c staging: rtl8188eu: fix lines over 80 characters
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:10 +02:00
Luca Ceresoli 6c4743f7d6 staging: rtl8188eu: simplify nested ifs
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:10 +02:00
Luca Ceresoli 2ff4e79f0e staging: rtl8188eu: document enum where it is declared
The comment "/* open system */" is repeated verbatim in several places where
dot11AuthAlgrthm_Open is referenced, but not where it is declared.

Move it to be only at its declaration.

This also fixes some "line over 80 characters" checkpatch warnings.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:09 +02:00
Luca Ceresoli 22a1279b84 staging: rtl8188eu: fix comments over 80 characters
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:09 +02:00
Luca Ceresoli 3446ef56f8 staging: rtl8188eu: remove duplicated comments
There are identical comments near the static variable declaration, around
lines 118~120.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:09 +02:00
Carlos E. Garcia 69e98df782 Staging: fixed multiple spelling errors.
Fixed multiple spelling errors.

Signed-off-by: Carlos E. Garcia <carlos@cgarcia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:23:58 +02:00
Niranjan Dighe da3c8deef6 Staging: rtl8188eu: replace kzalloc and memcpy by kmemdup
This was generated by 'make coccicheck' using scripts at
scripts/coccinelle/api/memdup.cocci.

Signed-off-by: Niranjan Dighe <niranjan.dighe@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 13:16:19 +01:00
Matteo Semenzato c181be7f32 Staging: rtl8188eu: remove dead code
The condition pxmitpriv->hwxmit_entry == 5 is always false because
HWXMIT_ENTRY is always 4.

Signed-off-by: Matteo Semenzato <mattew8898@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 13:13:13 +01:00
Vatika Harlalka fe36bad239 Staging: rtl8188eu: Add new variable to make code compact
Introducing this variable leads to overall more code
compactness and increases readability.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 10:34:14 +01:00
Vatika Harlalka 175bbae0c7 Staging: rtl8188eu: Refactor repititive code to loop to increase compactness
Refactor repetitive code to loop so as to increase
compactness and introduce newlines for readability.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 10:34:14 +01:00
Vatika Harlalka bf95251571 Staging: rtl8188eu: Reduce line size to increase readability
Reduce line size to increase readability.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 10:34:14 +01:00
Hatice ERTÜRK 4c0dbe0a2e Staging: rtl8188eu: Delete space
Deleted spaces before ','.Because it is prohibited by the kernel coding style.
Error found with checkpatch.pl

Signed-off-by: Hatice ERTURK <haticeerturk27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-23 22:39:15 +01:00
Vatika Harlalka 2c4b2980ae Staging: rtl8188eu: Remove extern as it is defined but never used
RTW_WPA_VERSION is removed as is declared and defined but
never used in the code.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:29:27 +01:00
Vatika Harlalka 680355f3d4 Staging: rtl8188eu: Remove unused macros
These macros are defined but never used in the code.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:29:27 +01:00
Vatika Harlalka 5ce019df9b Staging: rtl8188eu: Remove unused extern declarations.
These externs are defined but not used anywhere in the code.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:29:27 +01:00
Vaishali Thakkar 0f362d9df4 Staging: rtl8188eu: Remove timer handler macros
After the commit 28af7ea81e ("Staging: rtl8188eu:
Eliminate use of _init_timer"), macros
(RTW_TIMER_HDL_ARGS, RTW_TIMER_HDL_NAME,
RTW_DECLARE_TIMER_HDL) are no longer needed. So,
remove them.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-18 11:16:36 +01:00
Haneen Mohammed adb3d770d2 Staging: rtl8188eu: Remove parentheses around right side an assignment
Parentheses are not needed around the right hand side of an assignment.
This patch remove parenthese of such occurenses. Issue was detected and
solved using the following coccinelle script:

@rule1@
identifier x, y, z;
expression E1, E2;
@@

(
x = (y == z);
|
x = (E1 == E2);
|
 x =
-(
...
-)
 ;
)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 16:08:01 +01:00
Supriya Karanth e1cc3112b2 staging: rtl8188eu: remove break after return
Remove "break" statement after a "return" statement as
it does not get executed.

Found by checkpatch.pl - break is not useful after a goto
or return

Signed-off-by: Supriya Karanth <iskaranth@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 16:08:01 +01:00
Supriya Karanth 37e0807879 staging: rtl8188eu: remove intialization of static ints
static ints are initialized to 0 by the compiler.
Explicit initialization is not necessary.

Found by checkpatch.pl - ERROR: do not initialise statics to 0 or NULL

changes made using coccinelle script:
@@
type T;
identifier var;
@@
static T var
- =0
;

Signed-off-by: Supriya Karanth <iskaranth@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 16:08:01 +01:00
Vaishali Thakkar 28af7ea81e Staging: rtl8188eu: Eliminate use of _init_timer
This patch introduces the use of API function setup_timer
instead of driver specific function init_timer as it is
the preferred and standard way to set and setup the timer.
To be compatible with the changes, argument types of
referenced functions are changed. Also, definition of
function _init_timer is removed as it is no longer needed
after this change.

Here, these cases are handled using Coccinelle and
semantic patch used for this is as follows:

@@ expression x, y; identifier a, b;@@

- _init_timer (&x, y, a, b);
+ setup_timer (&x, a, (unsigned long)b);

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 16:07:15 +01:00
Vaishali Thakkar 4d4efe3e95 Staging: rtl8188eu: Eliminate use of _set_timer
This patch introduces the use of API function mod_timer
instead of driver specific function _set_timer as it is
a more efficient and standard way to update the expire
field of an active timer. Also, definition of function
_set_timer is removed as it is no longer needed after
this change.

Here, these cases are handled using Coccinelle and
semantic patch used for this is as follows:

@@ expression x; expression y;@@

- _set_timer (&x, y);
+ mod_timer (&x, jiffies + msecs_to_jiffies (y));

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 16:04:55 +01:00
Ioana Ciornei e7b1269db0 drivers: staging: rtl8188eu: core: rtw_security: Fix misspelled word
This patch fixes the checkpatch.pl warning:

WARNING: 'halfs' may be misspelled - perhaps 'halves'?

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 16:04:24 +01:00
Mike Krinkin 789fd7adf5 staging: rtl8188eu: use %pM specifier instead of passing direct values
The patch converts code to use %pM specifier instead of pushing
each byte via stack.

Signed-off-by: Mike Krinkin <krinkin.m.u@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 16:04:24 +01:00
Somya Anand 22e7f1e25b Staging: rtl8188eu: Remove unneeded return statement
This patch removes unnecessary return statement from a void
function and hence make it more compatible.

This issue is identified by checkpatch.pl

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15 18:41:10 +01:00
Somya Anand 1ce7948fe1 Staging: rtl8188eu: Remove redundant local variable
This patch removes a redundant variable "val" and adds
inline return statements. It also adds a default case
to the switch statement which returns 0 to keep the logic
intact.

It also removes a redundant variable "inx" and adds inline
return statements.

This issue is identified by the following coccinelle script.
@@
expression ret;
identifier f;
@@

-ret =
+return
     f(...);
-return ret;

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15 18:41:10 +01:00
Navya Sri Nizamkari 0507a1e52b staging: rtl8188eu: Use kcalloc instead of kzalloc.
This patch uses kcalloc instead of kzalloc function.
A coccinelle script was used to make this change.

Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15 18:41:09 +01:00
Navya Sri Nizamkari 7f39902654 staging: rtl8188eu: Use kcalloc instead of kzalloc
This patch uses kcalloc instead of kzalloc function.
A coccinelle script was used to make this change.

Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15 18:41:09 +01:00
Tina Johnson dce34aee00 drivers: staging: rtl8188eu: core: Removed unnecessary parentheses
Parentheses around the right side of an assignment statement are
unnecessary and hence removed. Coccinelle was used to produce the
patch:

@rule1@
identifier x,y;
constant c;
@@

(

 x =
-(
 y << c
-)
 ;
|
 x =
-(
 y >> c
-)
 ;
|
 x =
-(
 y + c
-)
 ;
|
 x =
-(
 y - c
-)
 ;

)

Signed-off-by: Tina Johnson <tinajohnson.1234@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09 13:37:22 +01:00
Somya Anand acd3f6cf05 staging: rtl8188eu: Remove unneeded parentheses
This patch removes unneeded parentheses from a if statement
for better readability.

This issue is identified by checkpatch.pl

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09 13:19:17 +01:00
Yannick Guerrini 8895f04b7a staging: rtl8188eu: Fix trivial typos in comments
Change 'disabed' and 'disabel' to 'disabled'
Change 'inviation' to 'invitation'
Change 'negoitation' to 'negotiation'

Signed-off-by: Yannick Guerrini <yguerrini@tomshardware.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 16:35:53 -08:00
Somya Anand 3bd52fb13a Staging: rtl8188eu: Remove unnecessary return statements
This patch removes unnecessary return statement from a void
function.

This issue is identified by checkpatch.pl

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 15:30:07 -08:00
Somya Anand aea42ee421 Staging: rtl8188eu: Remove redundant local variable
This patch removes a redundant variable "raid" and adds inline
return statements.

This issue is identified by the following coccinelle script:
@@
expression ret;
identifier f;
@@

-ret =
+return
     f(...);
-return ret;

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 15:30:07 -08:00
Aya Mahfouz 8e5d943341 staging: rtl8188eu: replace memset(x,0,ETH_ALEN)
eth_zero_addr() is a wrapper function for memset if 0 is going to
be assigned to a mac address. The aforementioned function replaces
memset. In addition, linux/etherdevice.h was included as a header
since it is the file that define the inline function eth_zero_addr().
The changes were carried out using the following coccinelle script:

@header@
@@

#include <linux/etherdevice.h>

@eth_zero_addr@
expression e;
@@

-memset(e,0,ETH_ALEN);
+eth_zero_addr(e);

@eth_broadcast_addr@
identifier e;
@@

-memset(e,\(0xff\|0xFF\|255\),ETH_ALEN);
+eth_broadcast_addr(e);

@linux_header depends on !header && (eth_zero_addr || eth_broadcast_addr) @
@@

+ #include <linux/etherdevice.h>
+

@special_header depends on !header && !linux_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>
+

@custom_header depends on !header && !linux_header && !special_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 15:30:07 -08:00
Aya Mahfouz 07add2d38d staging: rtl8188eu: remove extra parentheses around right bit shift operations
Removes extra parentheses around bitwise right shift operations.
The cases handled here are when resultant values are assigned to
variables. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
>>
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 15:22:42 -08:00
Navya Sri Nizamkari ea18c05882 staging: rtl8188eu: Remove memset.
The memory area set by the call to memset is immediately
overwritten by the subsequent call to memcpy. Hence, remove that
redundant memset.

Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 16:22:53 -08:00
Navya Sri Nizamkari 131c359e8e staging: rtl8188eu: Add blank line after declarations
This patch removes the following checkpatch.pl warning:

WARNING: Missing a blank line after declarations

Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 16:22:52 -08:00
Navya Sri Nizamkari 25034ff83c staging: rtl8188eu: Compress two statements into one.
This patch removes the use of a variable used only for
returning a value. The following coccinelle script was
used to discover it:

@@
expression ret;
identifier f;
@@

-ret =
+return
     f(...);
     -return ret;

It also fixes the checkpatch.pl warning about line being over
80 characters, in the lines where changes were made.

Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 16:22:52 -08:00
Vatika Harlalka 3fe9065801 Staging: rtl8188eu: Remove unused variable
Remove unused variable assignment for is2t and assign
sim_bitmap at declaration to make the code more compact.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 16:22:05 -08:00
Aya Mahfouz 5f70306ba0 staging: rtl8188eu: os_dep: remove unused variable
This patch removes a variable that was simply used to
store the return value of a function call before
returning it.

The issue was detected and resolved using the following
coccinelle script:

@@
identifier len,f;
@@

-int len;
 ... when != len
     when strict
-len =
+return
        f(...);
-return len;

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 16:20:00 -08:00
Vatika Harlalka 179e7dcde4 Staging: rtl8188eu: Move variable assignment
Variable path_on is assigned explicitly in the if branch and so
its assignment outside can be moved to the else branch.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 16:20:00 -08:00
Vatika Harlalka dacd2eced5 Staging: rtl8188eu: Remove braces from single statement block
Remove braces from single statement if condition
to follow kernel coding convention.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 15:17:01 -08:00
Vatika Harlalka 0395e554f8 Staging: rtl8188eu: Remove unnecessary code
Code removed as variables assigned are not used anywhere.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 15:25:08 -08:00
Aya Mahfouz 10a8643b76 staging: rtl8188eu: rewrite the right hand side of an assignment
This patch rewrites the right hand side of an assignment for
expressions of the form:
a = (a <op> b);
to be:
a <op>= b;
where <op> = << | >>.

This issue was detected and resolved using the following
coccinelle script:

@@
identifier i;
expression e;
@@

-i = (i >> e);
+i >>= e;

@@
identifier i;
expression e;
@@

-i = (i << e);
+i <<= e;

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 15:24:15 -08:00
Aya Mahfouz 74ff87997f staging: rtl8188eu: rewrite the right hand side of an assignment
This patch rewrites the right hand side of an assignment for
expressions of the form:
a = (a <op> b);
to be:
a <op>= b;
where <op> = << | >>.

This issue was detected and resolved using the following
coccinelle script:

@@
identifier i;
expression e;
@@

-i = (i >> e);
+i >>= e;

@@
identifier i;
expression e;
@@

-i = (i << e);
+i <<= e;

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 15:24:15 -08:00
Aya Mahfouz c6112e4839 staging: rtl8188eu: rewrite the right hand side of an assignment
This patch rewrites the right hand side of an assignment for
expressions of the form:
a = (a <op> b);
to be:
a <op>= b;
where <op> = << | >>.

This issue was detected and resolved using the following
coccinelle script:

@@
identifier i;
expression e;
@@

-i = (i >> e);
+i >>= e;

@@
identifier i;
expression e;
@@

-i = (i << e);
+i <<= e;

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 15:24:15 -08:00
Aya Mahfouz 945f018561 staging: rtl8188eu: rewrite the right hand side of an assignment
This patch rewrites the right hand side of an assignment for
expressions of the form:
a = (a <op> b);
to be:
a <op>= b;
where <op> = << | >>.

This issue was detected and resolved using the following
coccinelle script:

@@
identifier i;
expression e;
@@

-i = (i >> e);
+i >>= e;

@@
identifier i;
expression e;
@@

-i = (i << e);
+i <<= e;

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 15:24:15 -08:00
Vatika Harlalka e790d442b0 Staging: rtl8188eu: Replace if-else block with switch-case
Replace if-else block with switch-case to make it more compact
and increase readability.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:56:58 -08:00
Vatika Harlalka 294a7fcc85 Staging: rtl8188eu: Refactor conditional code to increase readability
Remove the nested conditionals. The if and else-if have the same
code so they are combined to make the code more compact.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:56:58 -08:00
Vatika Harlalka 4ceb7f7233 Staging: rtl8188eu: Combine two loops to increase readability
The first loop assigns values to ofdm_index array and the
second checks for boundary conditions. They are combined and
a comment is added to increase clarity.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:56:58 -08:00
Vatika Harlalka 1d6871f8dc Staging: rtl8188eu: Remove unnecessary if condition
Remove this branch as is2t is defined false and is not
modified. The variable value32 is then unused.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:56:58 -08:00
Katie Dunne 0ed83e995e Staging: rtl8188eu: Remove unused macros
Removes macro definitions that are unused elsewhere

Signed-off-by: Katie Dunne <kdunne@mail.ccsf.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:55:17 -08:00
Vatika Harlalka 065be69f26 Staging: rtl8188eu: Remove unnecessary variable
Remove unnecessary variable and replace its uses with previously
defined variable.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:54:12 -08:00
Vatika Harlalka 4c3fa64038 Staging: rtl8188eu: Refactored code to increase readility
Refactored the conditional code to make it more compact.
Replaced the ternary operators with abs() macro to increase readability.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:53:48 -08:00
Vatika Harlalka d5dd06ea01 Staging: rtl8188eu: Replace ternary operator with existing macro
Replace ternary operator with existing abs() macro to increase
code readability.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:53:48 -08:00
Vatika Harlalka 8e2c69b62d Staging: rtl8188eu: Remove redundant if condition
Remove redundant if condition as !result is always false.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:53:47 -08:00
Melike Yurtoglu 1068fb676a Staging: rtl8188eu: Add blank line after declarations
WARNING: "Missing a blank line after declarations"
That was found by running checkpatch

Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:53:47 -08:00
Vatika Harlalka 93ab486d3f Staging: rtl8188eu: Changed array and loop construct
This function only required the array from the 14th element
onwards. Therefore, the array size is reduced and the loop
counter is modified so as to start from 0.
Also, the assignment of variable place is redundant as it is
initialized again in the loop.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:45:32 -08:00
Vatika Harlalka efb8d49794 Staging: rtl8188eu: Replace unneeded switch-case block
Replace switch-case block with single if statement to
increase code readability.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:45:32 -08:00
Vatika Harlalka 9734d632bb Staging: rtl8188eu: Remove unnecessary variable
Remove unneccessary variable and replace its uses with another
variable which is previously defined.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:45:32 -08:00
Vatika Harlalka 3da741ff94 Staging: rtl8188eu: Fix line over 80 characters
Added a variable to reduce line size and enhance code readability.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:45:32 -08:00
Vaishali Thakkar e4504a1519 Staging: rtl8188eu: Use put_unaligned_le16
Using byte ordering functions and then memcpy() is risky and
prone to hide errors which are hard to track down. So, this
patch introduces the use of function put_unaligned_le16 which
makes the code clear. Here, use of variable tim_bitmap_le
and variable itself is removed. Also, to be compatible with the
changes header file is added too.

Coccinelle is used to do this change and semantic patch used for
this is as follows:

@a@
typedef __le16;
__le16 e16;
identifier tmp;
expression ptr;
expression y,e;
type T;
@@

- tmp = cpu_to_le16(y);

<+... when != tmp
(
- memcpy(ptr, (T)&tmp, \(2\|sizeof(__le16)\|sizeof(e16)\));
+ put_unaligned_le16(y,ptr);
|
- memcpy(ptr, (T)&tmp, ...);
+ put_unaligned_le16(y,ptr);
)
...+>
? tmp = e

@@ type T; identifier a.tmp; @@

- T tmp;
...when != tmp

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:34:17 -08:00
Vaishali Thakkar 78f5d8f9f9 Staging: rtl8188eu: Remove unused struct ndis_802_11_key
This patch removes struct ndis_802_11_key as it is defined
in a header file but never used.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:34:16 -08:00
Nicholas Mc Guire e971e8de38 staging: rtl8188eu: core: switch with redundant cases
A few redundant switch cases as well as a redundant if/else
within one of the cases was consolidated to a single call.
The cases are intentionally retained for documentation purposes.

case WIFI_REASSOCREQ,WIFI_PROBEREQ,WIFI_BEACON,WIFI_ACTION all
have the same effect - notably the also for WIFI_PROBEREQ where
the if/else is executing the same function.

These redundant cases could all be dropped and consolidated into
the default but probably it is better for documentation/readability
to leave them in the switch/case explicitly.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07 17:37:52 +08:00
Nicholas Mc Guire e914024d46 staging: rtl8188eu: odm: conditional setting with no effect
The if and the else branch code are identical - so the condition has no
effect on the effective code - this patch removes the condition and the
duplicated code. Due to this being a fall-through-if here - the first
if condition has no effect either - so it also can be removed.
struct mlme_priv is thus also no longer needed here.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07 17:37:52 +08:00
Nicholas Mc Guire 3d272700d7 staging: rtl8188eu: odm: condition with no effect
The if and the else branch code are identical - so the condition has no
effect on the effective code - this patch removes the condition and the
duplicated code.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07 17:37:52 +08:00
Nicholas Mc Guire 37257276a4 staging: rtl8188eu: use msecs_to_jiffies for conversions
This is only an API consolidation to make things more readable.
Instances of  var * HZ / 1000  are replaced by  msecs_to_jiffies(var).

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07 17:25:42 +08:00
Kumar Amit Mehta 0137f1a019 staging: rtl8188eu: core: rtw_wlan_util.c: Fix for NULL dereference
In rtw_check_bcn_info(), check the return value of kzalloc() before
dereferencing it, to avoid NULL pointer dereference.

Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-28 10:56:49 -08:00
Rickard Strandqvist e575edfbd7 staging: rtl8188eu: core: rtw_mlme_ext.c: Remove unused function
Remove the function NULL_hdl() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:10:03 -08:00
Rickard Strandqvist 17ad975c5a staging: rtl8188eu: os_dep: usb_ops_linux.c: Remove unused function
Remove the function usb_writeN() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:06:03 -08:00
Rickard Strandqvist f225d04e4e staging: rtl8188eu: hal: rtl8188e_hal_init.c: Remove unused function
Remove the function GetEEPROMSize8188E() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:04:16 -08:00
Rickard Strandqvist 55b3bba0b8 staging: rtl8188eu: hal: rtl8188e_cmd.c: Remove unused function
Remove the function rtl8188e_set_rssi_cmd() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:04:16 -08:00
Gangadhar Vukkesala 7aa36b4bc2 staging: rtl8188eu: Fixed a space coding style issue.
Fixed a space coding style issue which was found when running checkpatch.pl
script on rtw_ap.c.

Signed-off-by: Gangadhar Vukkesala <gangs.freelancer@gmail.com>
Reviewed-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:02:57 -08:00
Abel Moyo 74df1cd759 Staging: rtl8188eu: {core, hal, include}: Removed inline function
Removed inline function get_my_bssid and open coded all its references

Signed-off-by: Abel Moyo <abelmoyo.ab@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:02:57 -08:00
Rickard Strandqvist 99eff12f8a staging: rtl8188eu: hal: hal_intf.c: Cleaning up functions that are not used anywhere
Removes some functions that are not used anywhere.
rtw_hal_interrupt_handler() rtw_hal_sreset_get_wifi_status()

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02 16:29:26 -08:00
Jes Sorensen 6179ed592b staging: rtl8188eu: usb_dvobj_init(): A NULL pointer check for usb_host_endpoints makes no sense
struct usb_host_interface points to an array of
struct usb_host_endpoints - it makes no sense to do a NULL pointer
check for each pointer.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02 16:29:26 -08:00
Anjana Sasindran 8b21696c51 staging:drivers:staging:rtl8188eu:hal:rtl8188e_hal_init.c: Added a blank line after declaration
This patch fix a checkpatch.pl warning

WARNING:Missing blank line after declaration

Signed-off-by: Anjana Sasindran <anjanasasindran123@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02 16:29:26 -08:00
Greg Kroah-Hartman deef2a118a Merge 3.18-rc7 into staging-work.
We want those staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02 16:20:59 -08:00
Larry Finger 6d4556fc03 staging: r8188eu: Add new device ID for DLink GO-USB-N150
The DLink GO-USB-N150 with revision B1 uses this driver.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-27 08:55:01 -08:00
Krzysztof Konopko f4a52b40de rtl8188eu: Fix a typo in rtw_led.*
A rather obvious typo in one of the identifier has been found.  This patch
fixes the typo and ensures any lines changed do not exceed 80 characters
as indicated by scripts/checkpatch.pl

Signed-off-by: Krzysztof Konopko <kris@konagma.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 15:27:25 -08:00
Krzysztof Konopko 79a8641d9f rtl8188eu: Fix FSF_MAILING_ADDRESS in rtw_led.*
rtw_led.* files include Free Software Foundation's mailing address in
the sample GPL notice.  This is not desired and picked when running
scripts/checkpatch.pl.

Signed-off-by: Krzysztof Konopko <kris@konagma.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 15:27:25 -08:00
Krzysztof Konopko 31d4cf1294 rtl8188eu: Simplify rtw_endofpktfile() in xmit_linux.c
scripts/checkpatch.pl reports a coding style problem in xmit_linux.c

  WARNING:BRACES: braces {} are not necessary for single statement blocks
  #61852: FILE: rtl8188eu/os_dep/xmit_linux.c:70:

This patch removes unnecessary braces and simplifies the function to a
single return statement.

Signed-off-by: Krzysztof Konopko <kris@konagma.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 15:27:25 -08:00
Larry Finger 33dc85c3c6 staging: r8188eu: Fix scheduling while atomic error introduced in commit fadbe0cd
In commit fadbe0cd52 entitled "staging:
rtl8188eu:Remove rtw_zmalloc(), wrapper for kzalloc()", the author failed
to note that the original code in the wrapper tested whether the caller
could sleep, and set the flags argument to kzalloc() appropriately.
After the patch, GFP_KERNEL is used unconditionally. Unfortunately, several
of the routines may be entered from an interrupt routine and generate
a BUG splat for every such call. Routine rtw_sitesurvey_cmd() is used in the
example below:

BUG: sleeping function called from invalid context at mm/slub.c:1240
in_atomic(): 1, irqs_disabled(): 0, pid: 756, name: wpa_supplicant
INFO: lockdep is turned off.
CPU: 2 PID: 756 Comm: wpa_supplicant Tainted: G        WC O   3.18.0-rc4+ #34
Hardware name: TOSHIBA TECRA A50-A/TECRA A50-A, BIOS Version 4.20   04/17/2014
ffffc90005557000 ffff880216fafaa8 ffffffff816b0bbf 0000000000000000
ffff8800c3b58000 ffff880216fafac8 ffffffff8107af77 0000000000000001
0000000000000010 ffff880216fafb18 ffffffff811b06ce 0000000000000000
Call Trace:
 [<ffffffff816b0bbf>] dump_stack+0x4e/0x71
 [<ffffffff8107af77>] __might_sleep+0xf7/0x120
 [<ffffffff811b06ce>] kmem_cache_alloc_trace+0x4e/0x1f0
 [<ffffffffa0888226>] ? rtw_sitesurvey_cmd+0x56/0x2a0 [r8188eu]
 [<ffffffffa0888226>] rtw_sitesurvey_cmd+0x56/0x2a0 [r8188eu]
 [<ffffffffa088f00d>] rtw_do_join+0x22d/0x370 [r8188eu]
 [<ffffffffa088f6e8>] rtw_set_802_11_ssid+0x218/0x3d0 [r8188eu]
 [<ffffffffa08c3ca5>] rtw_wx_set_essid+0x1e5/0x410 [r8188eu]
 [<ffffffffa08c3ac0>] ? rtw_wx_get_rate+0x50/0x50 [r8188eu]
 [<ffffffff816938f1>] ioctl_standard_iw_point+0x151/0x3f0
 [<ffffffff81693d52>] ioctl_standard_call+0xb2/0xe0
 [<ffffffff81597df7>] ? rtnl_lock+0x17/0x20
 [<ffffffff816945a0>] ? iw_handler_get_private+0x70/0x70
 [<ffffffff81693ca0>] ? call_commit_handler+0x40/0x40
 [<ffffffff81693256>] wireless_process_ioctl+0x176/0x1c0
 [<ffffffff81693e79>] wext_handle_ioctl+0x69/0xc0
 [<ffffffff8159fe79>] dev_ioctl+0x309/0x5e0
 [<ffffffff810be9c7>] ? call_rcu+0x17/0x20
 [<ffffffff8156a472>] sock_ioctl+0x142/0x2e0
 [<ffffffff811e0c70>] do_vfs_ioctl+0x300/0x520
 [<ffffffff81101514>] ? __audit_syscall_entry+0xb4/0x110
 [<ffffffff81101514>] ? __audit_syscall_entry+0xb4/0x110
 [<ffffffff810102bc>] ? do_audit_syscall_entry+0x6c/0x70
 [<ffffffff811e0f11>] SyS_ioctl+0x81/0xa0
 [<ffffffff816ba1d2>] system_call_fastpath+0x12/0x17

Additional routines that generate this BUG are rtw_joinbss_cmd(),
rtw_dynamic_chk_wk_cmd(), rtw_lps_ctrl_wk_cmd(), rtw_rpt_timer_cfg_cmd(),
rtw_ps_cmd(), report_survey_event(), report_join_res(), survey_timer_hdl(),
and rtw_check_bcn_info().

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>
2014-11-26 14:03:48 -08:00
Sudip Mukherjee d48037f916 staging: rtl8188eu: unneeded NULL check
before these NULL checks we are already checking it for NULL, and if
it is NULL then we are jumping to the error label and handling
the error before returning.
So we can reach this part of the code only if the variable is known
to be not NULL, and if we already know that it is not NULL, then no
need to check it again.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-07 09:47:29 -08:00
Sudip Mukherjee c78a964c25 staging: rtl8188eu: unneeded return variable
a variable is declared and initialized and then never updated in the
function.This default value is then used as the return from the
function.
So removed that unneeded return variable and returning that default
initial value directly.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-07 09:45:35 -08:00
Jia He 7be921a226 staging: rtl8188eu: Fix coding style space related ERROR problems
This fixes space related ERROR reports by checkpatch.pl
Generated by $ git ls-files "drivers/staging/rtl8188eu/*.[ch]" | \
  xargs ./scripts/checkpatch.pl -f --fix-inplace --strict --types=SPACING
Already checked by text comparasion
$git diff -w
and binary comparasion of r8188eu.ko
$objdiff diff <old_commit> <new_commit>

Signed-off-by: Jia He <hejianet@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-03 18:13:34 -08:00
Dan Carpenter 85e1c554f4 staging: r8188eu: cleanups in rtw_android_set_block()
1) We can tighten up the code a little by returning directly and it
   makes the code more future proof and easier to read.
2) "free" is a better name than "exit".
3) sizeof(priv_cmd) is shorter and more clear than sizeof(struct
   android_wifi_priv_cmd).

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-03 16:22:50 -08:00
Dan Carpenter d0915b2255 staging: r8188eu: get a string from the user correctly
The original code had two bugs:
1) It didn't check if the string was zero length so it could oops when
   it tried to dereference the ZERO_SIZE_PTR.
2) It didn't enforce that the string was NUL terminated.

It was also messy as pants.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-03 16:22:50 -08:00
Vaishali Thakkar 2b365fa9d9 Staging: rtl8188eu: Use put_unaligned_le32
This patch introduces the use of function put_unaligned_le32.

This is done using Coccinelle and semantic patch used is as follows:

@@ identifier tmp; expression ptr; expression y,e; type T; @@

- tmp = cpu_to_le32(y);

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

@@ type T; identifier tmp; @@

- T tmp;
...when != tmp

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-03 16:10:38 -08:00
Surya Seetharaman 2adc8c46b4 Staging: rtl8188eu: rtw_pwrctrl: removed space before semicolon.
WARNING: space prohibited before semicolon

Signed-off-by: Surya Seetharaman<suryaseetharaman.9@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-03 16:09:28 -08:00
Surya Seetharaman 1e39898b66 Staging: rtl8188eu: rtw_pwrctrl: removed a checkpatch warning.
WARNING: void function return statements are not generally useful

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-03 16:09:27 -08:00
Surya Seetharaman 86ca02dae7 Staging: rtl8188eu: rtw_pwrctrl: fixed checkpatch warning.
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-03 16:09:27 -08:00
Dilek Uzulmez b7c12ca4df staging: rtl8188eu: Remove unnecessary else after return
This patch fixes checkpatch.pl warning in files of rtl8188eu
WARNING: else is not generally useful after a break or return

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-03 16:08:06 -08:00
Tapasweni Pathak 3cfab18ce5 staging: rtl8188eu: core: Improve cleanup code
The code is restructured such that kfree(efuseTbl) is not called
if the allocation of efuseTbl and such that kfree(eFuseWord) is not
called if the allocation of eFuseWord has failed.

To accomplish this a new label eFuseWord_failed has been added.

Suggested by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30 13:12:05 -07:00
Tapasweni Pathak a055b3cbb7 staging: rtl8188eu: core: Remove null check before kfree
kfree on NULL pointer is a no-op.

This patch uses the following semantic patch to find such an instance
where NULL check is present before kfree.

// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);
@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>smpl>

Build tested it.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30 13:12:05 -07:00
Tapasweni Pathak 7499b702f0 staging: rt18188eu: Remove useless cast on NULL
Cast on NULL to a pointer type is not required. This
patch removes NULL casted to some pointer type.

The sematic patch used is:
@r@
type T;
@@
- (T *)NULL
+ NULL

Build tested it.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30 13:09:15 -07:00
Tapasweni Pathak f811be139e staging: rtl8188eu: Remove double test
Removed the duplicate test on memcmp(pIE->data, BROADCOM_OUI2, 3).

The semantic that find this problem is
// <smpl>
@@
expression E;
@@

(
* E
  || ... || E
|
* E
  && ... && E
)
// </smpl>

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30 13:09:15 -07:00
Tapasweni Pathak 037a449ac7 staging: rtl8188eu: os_dep: Remove useless cast on void pointer
void pointers do not need to be cast to other pointer types.

The semantic patch used to find this:

@r@
expression x;
void* e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Build tested it.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30 13:05:49 -07:00
Tapasweni Pathak 08a3d85a01 staging: rtl8188eu: hal: Remove useless cast on void pointer
void pointers do not need to be cast to other pointer types.

The semantic patch used to find this:

@r@
expression x;
void* e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Build tested it.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30 13:05:49 -07:00
Tapasweni Pathak 60c8991148 staging: rtl8188eu: core: Remove useless cast on void pointer
void pointers do not need to be cast to other pointer types.

The semantic patch used to find this:

@r@
expression x;
void* e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Build tested it.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30 13:05:48 -07:00
Gulsah Kose 3fd511d986 staging: rtl8188eu: os_dep: Used min_t instead of min
This patch fixes this checkpatch.pl warning:
WARNING: min() should probably be min_t(int, req->essid_len,
IW_ESSID_MAX_SIZE)

by using this coccinelle script:

@r@
identifier i;
expression e1, e2;
type t1, t2;
@@

t1 i =
- min((t2)e1, e2);
+ min_t(t2, e1, e2);

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30 12:20:16 -07:00
Gulsah Kose 04947c5be5 staging: rtl8188eu: os_dep: Removed unnecessary return.
This patch fixes
WARNING:  void function return statements are not generally useful
checkpatch.pl warning in usb_intf.c by using this coccinelle script

@r@
identifier i;
@@
void i(...)
{
...
-return;
}

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30 12:20:15 -07:00
Gulsah Kose 9d9921e930 staging: rtl8188eu: core: Removed unnecessary return keyword.
This patch fixes
WARNING:  void function return statements are not generally useful
checkpatch.pl warning in rtw_efuse.c by using this coccinelle script

@r@
identifier i;
@@
void i(...)
{
...
-return;
}

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30 12:20:15 -07:00
Gulsah Kose 0d20dac377 staging: rtl8188eu: core: Removed unnecessary parenthesis.
This patch removes unnecessarry parenthesis in rtw_security.c by
using this coccinelle script:

@r1@
expression e1,e2;
@@
if
- ((e1 == e2))
+ (e1 == e2)
{...}

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 16:20:56 -07:00
Paul McQuade 422caed999 staging: rtl8188eu: hal: space required
ERROR: space required before the open brace '{'

Signed-off-by: Paul McQuade <paulmcquad@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 16:48:32 +08:00
Tapasweni Pathak a707edd236 staging: rtl8188eu: core: Remove redundant memset before memcpy
The region set by the call to memset, immediately overwritten by the
subsequent call to memcpy makes the memset redundant.

This patch removes the redundant memset before memcpy using the
following coccinelle script:

@@
expression e1,e2,e3,e4;
@@

- memset(e1,e2,e3);
  memcpy(e1,e4,e3);

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 15:41:42 +08:00
Tapasweni Pathak 157b8e59fa staging: rtl8188eu: os_dep: Remove null check before kfree
This patch is generated by the following semantic patch

// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);
@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-27 10:33:06 +08:00
Jiayi Ye 1d06bb4e9d staging: remove unneeded parentheses around the right hand side of an assignment
In assignments such as value = (FLASH_CMD_STATUS_REG_READ << 24);, parentheses
are not needed. The Coccinelle semantic patch was used to find cases.

@r@
identifier x;
expression e1, e2;
@@

- x = (e1 << e2);
+ x = e1 << e2;

Signed-off-by: Jiayi Ye <yejiayily@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-27 10:33:06 +08:00
Jiayi Ye 7424a06090 staging: rtl8188eu: core: fix null dereference on exit path in rtw_mlme.c
If adapter is null, null dereference may occur. This patch fixes it.
The following Coccinelle semantic patch was used to find the case.

@@
expression E, E1;
identifier f;
statement S1,S2,S3;
@@

* if (E == NULL)
{
 ... when != if (E == NULL) S1 else S2
     when != E = E1
* E->f
 ... when any
 return ...;
}
else S3

Signed-off-by: Jiayi Ye <yejiayily@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-27 10:33:05 +08:00
Tapasweni Pathak 705515cdcd staging: rtl8188eu: os_dep: Replaced kzalloc and memcpy with kmemdup
Replaced calls to kzalloc followed by memcpy with a single call to
kmemdup.

Patch found using coccicheck.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-23 12:20:44 +08:00
Tapasweni Pathak b312fb06b5 staging: rtl8188eu: os_dep: Remove useless cast on kzalloc
Casting rhe return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language, as mentioned in
Documentation/CodingStyle, Chap 14.

Removed the cast on kzalloc return value.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-23 12:20:44 +08:00
Jiayi Ye c8cb5f2c78 staging: rtl8188eu: core: fixed msleep < 20ms can sleep for up to 20ms warning in rtw_efuse.c
This patch fixes following checkpatch.pl warning:
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt

Signed-off-by: Jiayi Ye <yejiayily@gmail.comi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-23 12:20:44 +08:00
Heena Sirwani 9cc56fa827 Staging: rtl8188eu: core: Remove variable that is not very useful.
The following patch removes a variable which is not very useful using
coccinelle.
The following semaintic patch was used:
@@
identifier ret;
@@

-int ret = 0;
 ... when != ret
     when strict
-return ret;
+return 0;

Signed-off-by: Heena Sirwani <heenasirwani@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:12 +08:00
Mahati Chamarthy 0b7d9bc2a4 Staging: rtl8188eu: include: Remove unused macros
This patch removes macros that are never used.

Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:12 +08:00
Tapasweni Pathak 049845dfd6 staging: rtl8188eu: core: Replace "the the " with "the"
This patch replace "the the " with "the".
The replacement couldn't be automated because sometimes
the first "the" was meant to be another word.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:12 +08:00
Mahati Chamarthy c9e27530b2 Staging: rtl8188eu: include: Remove unnecessary macro
This patch removes a macro which is not used anywhere except in the header
file. The existing usage in the header file is replaced with the actual value.

Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:12 +08:00
Ebru Akagunduz 6d36fe3edc staging: rtl8188eu: Fix prefer ether_addr_copy() over memcpy()
This patch fixes "Prefer ether_addr_copy() over memcpy()
if the Ethernet addresses are __aligned(2)" in rtw_ap.c
Pahole showed that the addresses are aligned.

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:12 +08:00
Rasmus Villemoes 7569055b81 staging: r8188eu: replace strnicmp with strncasecmp
The kernel used to contain two functions for length-delimited,
case-insensitive string comparison, strnicmp with correct semantics and
a slightly buggy strncasecmp.  The latter is the POSIX name, so strnicmp
was renamed to strncasecmp, and strnicmp made into a wrapper for the new
strncasecmp to avoid breaking existing users.

To allow the compat wrapper strnicmp to be removed at some point in the
future, and to avoid the extra indirection cost, do
s/strnicmp/strncasecmp/g.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-10-14 02:18:25 +02:00
navin patidar 368c75b98b staging: rtl8188eu: odm.h: Remove unused struct dyn_primary_cca
struct odm_dm_struct has a member of struct dyn_primary_cca,
which is initialized once and then never used by driver, so
we can remove struct dyn_promary_cca and code which initialize
it.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 23:47:13 -07:00
navin patidar 8f4ece938a staging: rtl8188eu: Rework function ODM_AntennaDiversity_88E()
Rename CamelCase function name.
Remove unnecessary comments.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 23:47:13 -07:00
navin patidar d2f44b7cf6 staging: rtl8188eu: Rework function odm_HWAntDiv()
Rename CamelCase function name and local variables.
 Remove unnecessary debugging messages.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 23:47:13 -07:00
navin patidar 5c45dde4ab staging: rtl8188eu: Rework function ODM_AntselStatistics_88E()
Rename CamelCase function name and local variables.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 23:47:13 -07:00
navin patidar 6b26b75daf staging: rtl8188eu: Rework function ODM_SetTxAntByTxInfo_88E()
Rename CamelCase function name and local variables.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 23:47:13 -07:00
navin patidar 7614f02350 staging: rtl8188eu: Rework function odm_UpdateTxAnt_88E()
Rename CamelCase function name and local variables.
Remove unnecessary debugging messages.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 23:47:13 -07:00
navin patidar 052a806d6b staging: rtl8188eu: Rework function ODM_UpdateRxIdleAnt_88E()
Rename CamelCase function name and local variables.
Remove unnecessary debugging messages and comments.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 23:47:12 -07:00
navin patidar db0ccdacd0 staging: rtl8188eu: Rework function ODM_AntennaDiversityInit_88E()
Rename CamelCase function name.
Remove unnecessary debugging messages.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 23:47:12 -07:00
navin patidar c4d7ea0991 staging: rtl8188eu: Rework function odm_FastAntTrainingInit()
Rename CamelCase function name.
Remove unnecessary comments and debugging messages.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 23:47:12 -07:00
navin patidar 09002c76b5 staging: rtl8188eu: Rework function odm_TRX_HWAntDivInit()
Rename CamelCase function name.
Remove unnecessary comments.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 23:47:12 -07:00
navin patidar 87b89e850f staging: rtl8188eu: Rework function odm_RX_HWAntDivInit()
Rename CamelCase function name.
Remove unnecessary comments.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 23:47:12 -07:00
navin patidar 146b901038 staging: rtl8188eu: Remove unused header file odm_RegDefine11AC.h
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 23:47:12 -07:00
navin patidar 6f1b7df415 staging: rtl8188eu: Remove odm_debug.c
Move a function and global variable from odm_debug.c to odm.c

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 23:47:12 -07:00
Vaishali Thakkar 1703c17b8a Staging: rtl8188eu: os_dep: Compression of lines for immediate return
This patch compresses two lines in to a single line in file rtw_android.c
if immediate return statement is found. It also removes variable bytes_written as
it is no longer needed.

It is done using script Coccinelle. And coccinelle uses following semantic
patch for this compression function:

@@
expression ret;
identifier f;
@@

-ret =
+return
     f(...);
-return ret;

Signed-off-by: Vaishali Thakkar<vthakkar1994@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19 16:26:01 -07:00
Gulsah Kose 16e614e850 staging: rtl8188eu: core: Fixed wrong space error.
This patch fixes "foo     * bar" should be "foo   *bar" checkpatch.pl error in rtw_cmd.c

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19 16:26:01 -07:00
Tobenna P. Igwe 1299b721d3 staging:rtl8188eu: Fix sparse warning cast to restricted __le16
This patch fixes the following sparse warnings:

  CHECK   drivers/staging/rtl8188eu/hal/fw.c
drivers/staging/rtl8188eu/hal/fw.c:219:13: warning: cast to restricted __le16
drivers/staging/rtl8188eu/hal/fw.c:219:13: warning: cast to restricted __le16
drivers/staging/rtl8188eu/hal/fw.c:219:13: warning: cast to restricted __le16
drivers/staging/rtl8188eu/hal/fw.c:219:13: warning: cast to restricted __le16

by changing the signature from 'u16' to '__le16'.

Signed-off-by: Tobenna P. Igwe <ptigwe@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-11 14:56:51 -07:00
navin patidar d9124e064d staging: rtl8188eu: Remove HalPhyRf_8188e.c
Move functions from HalPhyRf_8188e.c to phy.c .

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:51 -07:00
navin patidar 053ab2a18f staging: rtl8188eu: Remove HalPhyRf_8188e.h
Move macros and function declarations from HalPhyRf_8188e.h
to phy.h .

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:51 -07:00
navin patidar 9275ec2381 staging: rtl8188eu: HalPhyRf_8188e.h :Remove unused function declaration
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:51 -07:00
navin patidar fbf346b76f staging: rtl8188eu: HalPhyRf_8188e.c: Remove unused functions
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:51 -07:00
navin patidar 0cf81f67c0 staging: rtl8188eu: Rework function PHY_LCCalibrate_8188E()
Rename CamelCase local variables and function name.
Remove unnecessary debugging messages.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:21 -07:00
navin patidar 0ffb650322 staging: rtl8188eu: Rework function PHY_LCCalibrate_8188E()
Rename CamelCase local variables and function name.
Remove unnecessary debugging messages.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:21 -07:00
navin patidar a9c00d71c1 staging: rtl8188eu: Rework function phy_LCCalibrate_8188E()
Rename CamelCase local variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:21 -07:00
navin patidar ce7c49e725 staging: rtl8188eu: Rework function phy_IQCalibrate_8188E()
Rename CamelCase local variables and function name.
Remove unnecessary debugging messages.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:20 -07:00
navin patidar c14ad0565a staging: rtl8188eu: Rework function phy_SimularityCompare_8188E()
Rename CamelCase local variables and function name.
Remove unnecessary debugging messages.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:20 -07:00
navin patidar 00c185e76d staging: rtl8188eu: Rework function _PHY_PIModeSwitch()
Rename CamelCase local variables and function name.
Remove unnecessary debugging messages and local variables.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:20 -07:00
navin patidar 3dec6aa2a1 staging: rtl8188eu: Rework function _PHY_PathAStandBy()
Rename CamelCase local variables and function name.
Remove unnecessary debugging messages and local variables.
Declare it as a static function.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:20 -07:00
navin patidar 86e9e28889 staging: rtl8188eu: Rework function _PHY_MACSettingCalibration()
Rename CamelCase local variables and function name.
Remove unnecessary debugging messages and local variables.
Declare it as a static function.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:20 -07:00
navin patidar 4ef1a32dfc staging: rtl8188eu: Rework function _PHY_PathADDAOn()
Rename CamelCase local variables and function name.
Remove unnecessary debugging messages and local variables.
Declare it as a static function.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:20 -07:00
navin patidar 33ce098007 staging: rtl8188eu: Rework function _PHY_ReloadMACRegisters()
Rename CamelCase local variables and function name.
Remove unnecessary debugging messages and local variables.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:20 -07:00
navin patidar 5d99b8b3e8 staging: rtl8188eu: Rework function reload_adda_reg()
Rename CamelCase local variables.
Remove unnecessary debugging messages and local variables.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:20 -07:00
navin patidar ccfd0b39e4 staging: rtl8188eu: Rework function _PHY_SaveMACRegisters()
Rename CamelCase local variables and function name.
Remove unnecessary debugging messages and local variables.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:20 -07:00
navin patidar 98c04a2dd3 staging: rtl8188eu: Rework function _PHY_SaveADDARegisters()
Rename CamelCase local variables and function name.
Remove unnecessary debugging messages and local variables.
Declare it as a static function.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:20 -07:00
navin patidar f2a2994b5f staging: rtl8188eu: Rework function pathb_fill_iqk()
Rename CamelCase local variables.
Remove unnecessary debugging messages and local variables.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:20 -07:00
navin patidar 198cd2d35f staging: rtl8188eu: Rework function patha_fill_iqk()
Rename CamelCase local variables.
Remove unnecessary debugging messages and local variables.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:20 -07:00
navin patidar 43a3876c99 staging: rtl8188eu: Rework function phy_PathB_IQK_8188E()
Rename CamelCase function name and local variables.
Remove unnecessary debugging messages.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:19 -07:00
navin patidar 14ee976b96 staging: rtl8188eu: Rework function phy_PathA_IQK_8188E()
Rename CamelCase function name and local variables.
Remove unnecessary debugging messages and local variables.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:19 -07:00
navin patidar 0fdd0c3248 staging: rtl8188eu: Rework function phy_PathA_RxIQK()
Rename CamelCase function name and variables.
Remove unnecessary debugging messages.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:05:19 -07:00
navin patidar 05103ff0b9 staging: rtl8188eu: Rework odm_TXPowerTrackingCallback_ThermalMeter_8188E()
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:04:31 -07:00
navin patidar f335a61c7f staging: rtl8188eu: Rename function odm_TxPwrTrackSetPwr88E()
Rename CamelCase function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:04:30 -07:00
navin patidar 4de93b1ab7 staging: rtl8188eu: Rework function ODM_TxPwrTrackAdjust88E()
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:04:30 -07:00
navin patidar a97c49af79 staging: rtl8188eu: Rename function ODM_GetRightChnlPlaceforIQK()
Rename CamelCase function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 14:04:30 -07:00
Nicolas Thery f60705fd13 staging: rtl8188eu: include missing header
This patch fixes the following sparse warnings:

drivers/staging/rtl8188eu/hal/phy.c:46:5: warning: symbol
'phy_query_bb_reg' was not declared. Should it be static?
drivers/staging/rtl8188eu/hal/phy.c:56:6: warning: symbol
'phy_set_bb_reg' was not declared. Should it be static?
drivers/staging/rtl8188eu/hal/phy.c:129:5: warning: symbol
'phy_query_rf_reg' was not declared. Should it be static?
drivers/staging/rtl8188eu/hal/phy.c:140:6: warning: symbol
'phy_set_rf_reg' was not declared. Should it be static?
drivers/staging/rtl8188eu/hal/phy.c:228:6: warning: symbol
'phy_set_tx_power_level' was not declared. Should it be static?
drivers/staging/rtl8188eu/hal/phy.c:324:6: warning: symbol
'phy_set_bw_mode' was not declared. Should it be static?
drivers/staging/rtl8188eu/hal/phy.c:360:6: warning: symbol 'phy_sw_chnl'
was not declared. Should it be static?

Signed-off-by: Nicolas Thery <nthery@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-06 22:02:17 -07:00
Luca Ceresoli 708a7ec873 staging: rtl8188eu: fix missing blank lines after declarations
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Greg Kroah-Hartman <gregkh@linux.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-06 21:45:33 -07:00
navin patidar 1c2775ec3c staging: rtl8188eu: Rename Hal8188EPwrSeq.h to pwrseq.h
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-02 11:20:01 -07:00
navin patidar 0ff471fc1e staging: rtl8188eu: Hal8188EPwrSeq.h: fix lines over 80 char
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-02 11:20:01 -07:00
navin patidar 2f2a798ac5 staging: rtl8188eu: Rename HalPwrSeqCmd.h to pwrseqcmd.h
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-02 11:20:01 -07:00
navin patidar 8290d2fbba staging: rtl8188eu: Rename HalPwrSeqCmd.c to pwrseqcmd.c
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-02 11:20:01 -07:00
navin patidar a031d01c8d staging: rtl8188eu: Rename Hal8188EPwrSeq.c to pwrseq.c
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-02 11:20:01 -07:00
navin patidar 582c7fbe16 staging: rtl8188eu: HalPwrSeqCmd.h: Remove unnecessary comments.
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-02 11:20:01 -07:00
navin patidar 8bfdbb1b59 staging: rtl8188eu: Hal8188EPwrSeq.c: fix lines over 80 characters.
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-02 11:20:01 -07:00
navin patidar 876cbe238d staging: rtl8188eu: Rework function HalPwrSeqCmdParsing()
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-02 11:20:01 -07:00
Greg Kroah-Hartman e9723bf2ad Merge 3.17-rc3 into staging-next
We want the staging bugfixes in this branch as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 20:53:12 -07:00
navin patidar 58964e8d73 staging: rtl8188eu: Remove unused function SetBcnCtrlReg()
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:58:41 -07:00
navin patidar c52fae3042 staging: rtl8188eu: Rename rtl8188e_rf6052.c to rf.c
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:58:40 -07:00
navin patidar 6b361e585f staging: rtl8188eu: Remove file rtl8188e_rf.h
Move macros from rtl8188e_rf.h to rf.h and then remove rtl8188e_rf.h .

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:58:40 -07:00
navin patidar d857135270 staging: rtl8188eu: Rework function get_rx_power_val_by_reg()
Rename CamelCase variables.
Remove block of the code which is specific to the bluetooth.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:58:40 -07:00
navin patidar 1faec15be4 staging: rtl8188eu: Rework function writeOFDMPowerReg88E()
Rename CamelCase variables and function name.
Remove a block of the code which is executed only if RF type is T2R2 but
rtl8188eu's RF is a T1R1 type, so driver doesn't need that code.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:58:40 -07:00
navin patidar fb393d260d staging: rtl8188eu: Rework function rtl8188e_PHY_RF6052SetOFDMTxPower()
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:58:40 -07:00
navin patidar c1adeba122 staging: rtl8188eu: Rework function getpowerbase88e()
Rename CamelCase variables.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:58:40 -07:00
navin patidar c5db81acf4 staging: rtl8188eu: Rework function rtl8188e_PHY_RF6052SetCckTxPower()
Rename CamelCase variables and function name.
Remove redundant variable TurboScanOff.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:58:40 -07:00
navin patidar 2027324402 staging: rtl8188eu: Rework function rtl8188e_PHY_RF6052SetBandwidth()
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:58:40 -07:00
navin patidar 86cb35aff1 staging: rtl8188eu: Rename HalHWImg8188E_MAC.c to mac_cfg.c
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:57:42 -07:00
navin patidar fcaa9426b2 staging: rtl8188eu: Rename HalHWImg8188E_RF.c to rf_cfg.c
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:57:41 -07:00
navin patidar 6767982d23 staging: rtl8188eu: Rename HalHWImg8188E_BB.c to bb_cfg.c
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:57:41 -07:00
navin patidar 238bd31e2e staging: rtl8188eu: Rename rtl8188e_phycfg.c to phy.c
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:57:41 -07:00
navin patidar ba50fbc0ee staging: rtl8188eu: Rework function PHY_SwChnl8188E()
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:57:41 -07:00
navin patidar 5f6a5cdb5f staging: rtl8188eu: Rework function PHY_SetBWMode8188E()
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:57:41 -07:00
navin patidar 01c5f833ee staging: rtl8188eu: Rework function PHY_SetTxPowerLevel8188E()
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:57:41 -07:00
navin patidar 9c43194053 staging: rtl8188eu: Rework function _PHY_SwChnl8192C()
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:57:41 -07:00
navin patidar 55d8dfbfaf staging: rtl8188eu: Rework function _PHY_SetBWMode92C()
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:57:41 -07:00
navin patidar a8b74c3ec7 staging: rtl8188eu: Rework function phy_PowerIndexCheck88E()
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:57:41 -07:00
navin patidar 88cbb39026 staging: rtl8188eu: Rework function getTxPowerIndex88E()
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:57:41 -07:00
navin patidar 7b98485c72 staging: rtl8188eu: Rework function rtl8188e_PHY_SetRFReg()
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:57:41 -07:00
navin patidar 41b77d2602 staging: rtl8188eu: Rework function PHY_QueryRFReg()
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:57:41 -07:00
navin patidar 42f27158ae staging: rtl8188eu: Rework function phy_RFSerialWrite()
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:57:40 -07:00
navin patidar a35b747d3d staging: rtl8188eu: Rework function phy_RFSerialRead()
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:57:40 -07:00
navin patidar 9c6db65199 staging: rtl8188eu: Rework function PHY_SetBBReg()
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:57:40 -07:00
navin patidar ef1220a0d4 staging: rtl8188eu: Remove unused wrapper function rtw_hal_write_bbreg()
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:57:40 -07:00
navin patidar ecd1f9b3f7 staging: rtl8188eu: Rework function PHY_QueryBBReg()
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31 12:56:50 -07:00
Stephen Rothwell 90d88de82c staging: rtl8188eu: using unique names is good
fixes:

drivers/staging/built-in.o:(.opd+0xaab8): multiple definition of `rtl88e_phy_rf_config'
drivers/net/built-in.o:(.opd+0x78840): first defined here
drivers/staging/built-in.o:(.opd+0xa9f8): multiple definition of `rtl88e_download_fw'
drivers/net/built-in.o:(.opd+0x781b0): first defined here
drivers/staging/built-in.o: In function `.rtl88e_phy_rf_config':
(.text+0xe0a00): multiple definition of `.rtl88e_phy_rf_config'
drivers/net/built-in.o:(.text+0xe85a48): first defined here
drivers/staging/built-in.o: In function `.rtl88e_download_fw':
(.text+0xdf28c): multiple definition of `.rtl88e_download_fw'
drivers/net/built-in.o:(.text+0xe6f330): first defined here
drivers/staging/built-in.o: In function `.rtl88e_phy_mac_config':
(.text+0xdf984): multiple definition of `.rtl88e_phy_mac_config'
drivers/net/built-in.o:(.text+0xe84a8c): first defined here
drivers/staging/built-in.o: In function `.rtl88e_phy_bb_config':
(.text+0xdfa2c): multiple definition of `.rtl88e_phy_bb_config'
drivers/net/built-in.o:(.text+0xe84d14): first defined here
drivers/staging/built-in.o:(.opd+0xaa58): multiple definition of `rtl88e_phy_bb_config'
drivers/net/built-in.o:(.opd+0x78828): first defined here
drivers/staging/built-in.o:(.opd+0xaa28): multiple definition of `rtl88e_phy_mac_config'

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:51:37 -07:00
Max Vozeler 65fe76eaa0 staging: rtl8188eu: Add missing include to pick up prototype
This fixes the following sparse warning:

drivers/staging/rtl8188eu/hal/HalHWImg8188E_MAC.c:119:6: warning: symbol
'rtl88e_phy_mac_config' was not declared. Should it be static?

Signed-off-by: Max Vozeler <max@hinterhof.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:45:17 -07:00
navin patidar 48a86ca4df staging: rtl8188eu: Remove unused wrapper function rtw_hal_read_bbreg()
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:43:48 -07:00
navin patidar 6e264feb6a staging: rtl8188eu: Rework function phy_CalculateBitShift()
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:43:48 -07:00
Larry Finger a2fa6721c7 staging: r8188eu: Add new USB ID
The Elecom WDC-150SU2M uses this chip.

Reported-by: Hiroki Kondo <kompiro@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-25 15:00:56 -07:00
Holger Paradies 8626d524ef staging/rtl8188eu: add 0df6:0076 Sitecom Europe B.V.
The stick is not recognized.
This dongle uses r8188eu but usb-id is missing.
3.16.0

Signed-off-by: Holger Paradies <retabell@gmx.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-25 13:24:28 -07:00
Adrian Remonda 4246e490b5 Staging: rtl8188eu: Removed unneeded code.
This patch removes some unneeded code.
1) kzalloc() allocates 4 extra bytes so that we can align the return
   value.  But actually the return value is already aligned so we can
   remove the + 4 and the call to N_BYTE_ALIGMENT().
2) The memset() isn't needed because kzalloc() zeroes the allocation.

Suggested-by: Larry Finger <Larry.Finger@lwfinger.net>

Signed-off-by: Adrian Remonda <adrianremonda@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:23 -07:00
Adrian Remonda 66ed681a30 Staging: rtl8188eu: Lines over 80 characters fixed.
This is a patch to the hal/rtl8188eu_recv.c file that fixes up a "line
over 80 characters" warning found by the checkpatch.pl tool.

Signed-off-by: Adrian Remonda <adrianremonda@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:23 -07:00
navin patidar e7e7068f60 staging: rtl8188eu: Declare Efuse_GetCurrentSize() as a static function
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:22 -07:00
navin patidar 43ffc5be9e staging: rtl8188eu: rtw_iol.h: Remove unused struct, enum and macro
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:22 -07:00
navin patidar 1eb87e2206 staging: rtl8188eu: rtw_iol.c: Remove unused functions
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:22 -07:00
navin patidar 51e3d8eded staging: rtl8188eu: Remove unused function iol_ioconfig()
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:22 -07:00
navin patidar 4ffa54e6b1 staging: rtl8188eu: Remove rtl8188e_IOL_exec_cmds_sync() and its wrapper function
rtl8188e_IOL_exec_cmds_sync() is a unused function.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:22 -07:00
navin patidar b5c391a4b0 staging: rtl8188eu: Remove unused function rtw_IOL_cmd_buf_dump()
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:22 -07:00
navin patidar 63bd7e26d2 staging: rtl8188eu: Remove unused function rtw_IOL_cmd_tx_pkt_buf_dump()
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:22 -07:00
navin patidar 678826f503 staging: rtl8188eu: Remove unused functions rtw_IOL_append_DELAY_[US, MS]_cmd()
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:22 -07:00
navin patidar 94616fbc5c staging: rtl8188eu: Remove unused function rtw_IOL_exec_cmds_sync()
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:21 -07:00
navin patidar 91ed283ab5 staging: rtl8188eu: Remove unused function rtw_IOL_append_WD_cmd()
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16 12:23:21 -07:00