Commit graph

1117 commits

Author SHA1 Message Date
Bhaktipriya Shridhar
3edd192bb8 staging: rtl8188eu: hal: Drop Useless Initialization
Removed initialisation of a varible if it is immediately reassigned.
Changes were made using Coccinelle.
@bad@
identifier i;
position p;
@@

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

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

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

This was done with Coccinelle:

@@ expression a, b; @@

a =
- (
b
- )
;

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

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

@@
expression e,e1;
@@

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

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

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

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

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

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

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

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

- tmp = cpu_to_le16(y);

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

@@ type T; identifier tmp; @@

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

Corresponding header file has been added too.

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

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

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

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

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

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

The fwsize not used after initialization at all.

The pfirmvare replaced by fw_data and fwsize removed.

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

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

Also u32 replaced by size_t for download_size variable.

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

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

* T x = (T)e;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

The semantic patch used to find this is:

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

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

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

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

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

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

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

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

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

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

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

* T x = (T)e;

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

* T x = (T)e;

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

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

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

Changes made using Coccinelle-

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

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

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

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

Signed-off-by: Iban Rodriguez <iban.rodriguez@ono.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 20:45:38 -07:00
Iban Rodriguez
2d89353756 Staging: rtl8188eu: Correct two coding style errors
Correct two errors reported by checkpatch.pl because space prohibited
before ','.
Also split both lines into multiple lines as they are longer than
80 characters

Signed-off-by: Iban Rodriguez <iban.rodriguez@ono.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-02 11:48:15 +02:00
Bryan Paul
a57ace1281 staging:rtl8188eu style fix
Fixed style issue if comparison should place constant on right of test

Signed-off-by: Bryan Paul <bryan.paul@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-02 11:48:15 +02:00
Larry Finger
b890d00e84 staging: rtl8188eu: Add missing include
In commit 0a0796eb16, there is no include to mon.h, a newly created
header file. This omission leads to the following Sparse warnings:

  CHECK   drivers/staging/rtl8188eu/os_dep/mon.c
drivers/staging/rtl8188eu/os_dep/mon.c:81:6: warning: symbol 'rtl88eu_mon_recv_hook' was not declared. Should it be static?
drivers/staging/rtl8188eu/os_dep/mon.c:113:6: warning: symbol 'rtl88eu_mon_xmit_hook' was not declared. Should it be static?
drivers/staging/rtl8188eu/os_dep/mon.c:167:19: warning: symbol 'rtl88eu_mon_init' was not declared. Should it be static?
drivers/staging/rtl8188eu/os_dep/mon.c:188:6: warning: symbol 'rtl88eu_mon_deinit' was not declared. Should it be static?

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-02 11:48:15 +02:00
Jakub Sitnicki
9da4aa48d0 staging: rtl8188eu: Fix build error when CFG80211 is not selected
The kbuild test robot reports the following build error for
i386-randconfig-c0-09230740:

>> ERROR: "ieee80211_hdrlen" [drivers/staging/rtl8188eu/r8188eu.ko] undefined!

Add a dependency on CFG80211 to fix it.

Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 04:27:22 +02:00
Luca Ceresoli
f62cd2cd95 staging: rtl8188eu: issue_action_BA(): extract ADDBA_req pointer
pmlmeinfo->ADDBA_req is accessed three times in this function, but it
contributes to generating lines above 80 characters that are not easy to
split in a nice way.

Extract a pointer to it to make code slightly more concise and fix some
lines over 80 characters.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 04:27:22 +02:00
Luca Ceresoli
3e4e8e025c staging: rtl8188eu: don't cast when calling rtw_set_fixed_ie()
The 'pbuf' and 'source' arguments to rtw_set_fixed_ie() are (void *), the
explicit typecasts are not needed. They just make code less readable.

Also fix checkpatch issues in the lines touched:
  ERROR: space prohibited before that ',' (ctx:WxW)
  WARNING: line over 80 characters
  CHECK: Unnecessary parentheses around <var>

Note: some of the modified lines are still over 80 characters because they
are not fixable by just adding newlines. They will be fixed in a later
patch.

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-09-29 04:27:22 +02:00
Luca Ceresoli
3441d08ca2 staging: rtl8188eu: rtw_set_fixed_ie(): accept void* parameters
rtw_set_ie() is a memcpy-like function, taking addresses of memory buffers
among its parameters. Similarly to memcpy, change the parameters to be
void*. This will allow to get rid of typecasts whenever it is called.

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-09-29 04:27:22 +02:00
Luca Ceresoli
f22c2468b6 staging: rtl8188eu: remove useless comment
This comment gives pretty much the same information as the name of the
function that it immediately precedes.

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-09-29 04:27:21 +02:00