Commit Graph

1142 Commits

Author SHA1 Message Date
Bhaktipriya Shridhar bfb7ff2c0b staging: rtl8723au: hal: Use macro ARRAY_SIZE
The macro ARRAY_SIZE is more concise to use instead of dividing
size of the array by the size of its type.

Changes were made using Coccinelle.

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

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

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:04:11 -08:00
Janani Ravichandran 382f00561c staging: rtl8723au: Remove unnecessary else following return
Remove unnecessary else when there is a return statement in the
corresponding if block.
Coccinelle patch used:

@rule1@
expression e1;
@@

	if (e1) { ... return ...; }
-       else{
	        ...
-            }

@rule2@
expression e2;
statement s1;
@@

	if(e2) { ... return ...; }
-       else
		s1

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:04:11 -08:00
Geliang Tang f0eba5167b staging: rtl8723au: whitespace and blank line cleaning
This patch cleans whitespaces and blank lines involved with
previous two patchs in this patch set.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:04:11 -08:00
Geliang Tang 703a7604db staging: rtl8723au: core: rtw_recv: remove useless codes
There are some useless codes in rtw_free_recvframe23a_queue() and
recvframe_defrag(), so remove them.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:04:11 -08:00
Geliang Tang e280d71bea staging: rtl8723au: use list_for_each_entry*()
Use list_for_each_entry*() instead of list_for_each*() to simplify
the code.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:04:11 -08:00
Bhumika Goyal 338e471619 Staging: rtl8723au: hal: Remove unused macros
The macros PlatformProcessHCICommands and PlatformTxBTQueuedPackets
are not used anywhere in the kernel so remove them.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:03:59 -08:00
Bhumika Goyal 26462869a6 Staging: rtl8723au: Replace header files
The headers <asm/uaccess.h>,<asm/atomic.h>,<asm/atomic.h> should not be
directly included so replace them.
Warning generated by checkpatch.pl.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:49:09 -08:00
Bhumika Goyal c6d609cfe7 Staging: rtl8723au: Remove unused macros
The macros PlatformAcquireSpinLock and PlatformReleaseSpinLock are
not used anywhere so remove them. Used grep to find occurences.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:49:09 -08:00
Janani Ravichandran 993c0a0ea0 staging: rtl8723au: Use ARRAY_SIZE macro for sizes of arrays
Use ARRAY_SIZE to calculate the size of an array to make code concise.
The semantic patch used can be found here:
9cbab452a3

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
Bhaktipriya Shridhar 432f5633b6 staging: rtl8723au: Fixes unnecessary return warning
This patch fixes checkpatch.pl warning in rtw_mlme_ext.c file.
WARNING: void function return statements are not generally useful

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:45:30 -08:00
Daniil Leshchev 78f73d92fc staging: rtl8723au: use %pM and %ph formatting
use %pM and %ph specifiers instead of placing each byte on stack.
(staging/rtl8723au/TODO)

Signed-off-by: Daniil Leshchev <meleodr@gmail.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:45:30 -08:00
Anatoly Stepanov 485b099ad8 staging: rtl8723au: change parameter type in rtl8723a_set_rssi_cmd declaration
Previosly the function had the following prototype:
int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u8 *param)

My suggestion here is to modify the prototype this way:
int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u32 param)

We can do this based on the following considerations:
1. rtl8723a_set_rssi_cmd is used only with 32-bit "param" values
2. There's no point in using "u8 *param" until we pass param length
3. As we just read "param", it's ok to pass it by value

Signed-off-by: Anatoly Stepanov <drivengroove@gmail.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:45:30 -08:00
Jiading Gai 3d7a84776a staging: rtl8723au: hal: rtl8723a_hal_init: fixed 4 spelling errors.
Fixed four spelling errors.

Signed-off-by: Jiading Gai <jiading.gai.github@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:45:30 -08:00
Ksenija Stanojevic 84295526a5 Staging: rtl8723au: Declare function static
Declare function Efuse_ReadAllMap as static since it's defined and used
only in this file.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Ksenija Stanojevic 165483c633 Staging: rtl8723au: Remove unused EFUSE_Write1Byte function
Function is defined but not used, so remove it.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Amitoj Kaur Chawla f386ee1737 staging: rtl8723au: core: Remove unnecessary functions
Drop functions that are declared but are not being used anywhere.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 07:55:17 +09:00
Alison Schofield fe821aad9c staging: r8723au: remove unneeded forward function declarations
Remove unneeded forward function declarations.

Addresses checkpatch.pl:
WARNING: externs should be avoided in .c files

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:02:56 +09:00
Alison Schofield 0e4427f46b staging: r8723au: move function type in line with function name
Move function types to be adjacent to the function names in
declarations to improve readability.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:02:56 +09:00
Alison Schofield 5e3144c1d6 staging: r8723au: insert correct spacing around operands
Adds required spacing around operands to improve readability.
Corrects checkpatch.pl ERROR: spaces required *

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:02:56 +09:00
Alison Schofield 159b023da8 staging: r8723au: use kernel preferred style for commenting
Reworked comments per kernel coding style to improve readability.

Corrects checkpatch.pl:
WARNING: Block comments use * on subsequent lines
WARNING: line over 80 characters

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:02:56 +09:00
Alison Schofield 575ff198f5 staging: r8723au: remove externs and include needed header file
Remove extern declaration and add include of header file to get same.

Addresses checkpatch.pl:
WARNING: externs should be avoided in .c files

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:45:43 -07:00
Alison Schofield 48c9578c1c staging: r8723au: replace explicit NULL comparisons with !
Replace explicit NULL comparison with ! operator to simplify code.

Addresses checkpatch.pl:
WARNING: Comparisons should place the constant on the right side of the
test

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:45:43 -07:00
Alison Schofield e9cd7afaf1 staging: r8723au: use kernel preferred style for commenting
Reworked comments per kernel coding style to improve readability.

Corrects checkpatch.pl:
WARNING: Block comments use * on subsequent lines
WARNING: line over 80 characters

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:45:41 -07:00
Shraddha Barke 11d7e632e3 Staging: rtl8723au: Use put_unaligned_le32
Introduce the use of function put_unaligned_le32.

A simplified version of Coccinelle semantic patch used -

@@ 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: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:44:30 -07:00
Alison Schofield 164e265b63 staging: r8723au: add & use local variable to simplify references
Add local variable scanned_queue to rtw_createbss_cmd23a_callback()
and use it (5x) to simplify references.

Addresses checkpatch.pl WARNING: line over 80 characters

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:41:27 -07:00
Alison Schofield c12e8dba0e staging: r8723au: move constant to right of comparison test
Move constant to right of comparison test to improve readability.

Addresses checkpatch.pl:
	WARNING: Comparisons should place the constant on the
	right side of the test

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:41:27 -07:00
Alison Schofield 0d07fc1b02 staging: r8723au: replace printk() with netdev_err()
Replace printk() with netdev_err() for uniform error reporting.
Issue found by checkpatch.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:41:27 -07:00
Luis de Bethencourt 8c182ae207 staging: rtl8723au: core: rtw_wlan_util: fix misleading indentation
For loop is outside of the else branch of the above conditional statement.
Fixing misleading indentation.

Fix a smatch warning:
drivers/staging/rtl8723au/core/rtw_wlan_util.c:528
WMMOnAssocRsp23a() warn: curly braces intended?

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:38:48 -07:00
Alison Schofield e405f0e45e staging: r8723au: move * to be adjacent to pointer name
Move * in pointer types to be adjacent to pointer names per Linux
coding style.

Addresses checkpatch.pl: ERROR: "foo*    bar" should be "foo *bar"

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17 20:16:37 -07:00
Alison Schofield 2f31c4b418 staging: r8723au: replace NULL and zero comparison tests with ! operator
Replace explicit NULL comparison and zero comparison test with ! operator
to simplify code.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 23:06:38 -07:00
Amitoj Kaur Chawla d538ae34be staging: rtl8723au: core: rtw_ap: Remove useless intialisation
Remove intialisation of a variable that is immediately reassigned.

The semantic patch used to find this is:

// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@

T x
- = C
 ;
x = e;
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:10:37 -07:00
Amitoj Kaur Chawla e847655a29 staging: rtl8723au: core: rtw_recv: Remove useless initialisation
Remove intialisation of a variable that is immediately reassigned.

The semantic patch used to find this is:

// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@

T x
- = C
 ;
x = e;
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:10:37 -07:00
Amitoj Kaur Chawla fcf7f33866 staging: rtl8723au: core: rtw_wlan_util: Remove useless intialisation
Remove intialisation of a variable that is immediately reassigned.

The semantic patch used to find this is:

// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@

T x
- = C
 ;
x = e;
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:10:37 -07:00
Amitoj Kaur Chawla d26a752e19 staging: rtl8723au: hal: Remove useless intialisation
Remove intialisation of a variable that is immediately reassigned. The
problem was found using coccinelle semantic patch and further
opportunities were identified by hand.

The semantic patch used to find this is:

// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@

T x
- = C
 ;
x = e;
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:10:37 -07:00
Shivani Bhardwaj 5aebea5590 Staging: rtl8723au: rtw_mlme_ext: Remove unnecessary test expression
Logical and-ing of a struct and its member should be replaced by the
member only as the struct has already been NULL tested before.

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:09:59 -07:00
Shivani Bhardwaj ad942cb19b Staging: rtl8723au: rtl8723a_bt-coexist: Remove unused variable
A variable is initialized and then assigned values in the code but is
never used and therefore, should be removed.
Semantic patch used:
@@
type T;
identifier i;
constant C;
position p != e.p;
@@

- T i@p;
  <+... when != i
- i = C;
  ...+>

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:09:59 -07:00
Ksenija Stanojevic 3fd624b37d Staging: rtl8723au: Use snprintf instead rsprintf
Macro rsprintf is useless, remove it and use existing function
snprintf instead.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-13 10:16:23 -07:00
Mateusz Kulikowski 7d76173d40 staging: rtl8723au: Fix resource leak
Firmware was not released properly if kmemdup fails.

Addresses-Coverity-Id: 1269118
Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 04:29:02 +02:00
Jes Sorensen b3083eb8fd staging: rtl8723au: Clean up getPowerBase()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-16 21:50:05 -07:00
Jes Sorensen 784e36838a staging: rtl8723au: TurboScanOff is always true
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-16 21:50:05 -07:00
Jes Sorensen 36708d00b1 staging: rtl8723au: Tidy up SetTxPowerLevel8723A()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-16 21:50:05 -07:00
Jes Sorensen e5241dc019 staging: rtl8723au: Fold getTxPowerIndex() into PHY_SetTxPowerLevel8723A()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-16 21:50:04 -07:00
Jes Sorensen 8b9283234e staging: rtl8723au: Eliminate dummy ccxPowerIndexCheck()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-16 21:50:04 -07:00
Jes Sorensen 96a98aa1fc staging: rtl8723au: Simplify eeprom content checking
This eliminates the ugly Hal_EEValueCheck() function

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-16 21:50:04 -07:00
Shraddha Barke 12d273767a Staging: rtl8723au: hal: Remove braces for single statement blocks
The linux kernel coding style discourages use of braces for single
statement blocks. This patch removes the unnecessary braces.

The error was detected using checkpatch.pl. Coccinelle was used
to make the change.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:53 -07:00
Michał Bartoszkiewicz 9c76f01270 staging: rtl8723au: remove unnecessary le32_to_cpu
The values passed to le32_to_cpu are already in the correct byte order.
This fixes four "cast to restricted __le32" sparse warnings.

Signed-off-by: Michał Bartoszkiewicz <mbartoszkiewicz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:38 -07:00
Luca Ceresoli 2f0c1424f0 staging: rtl8723au: remove unimplemented function declarations
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:38 -07:00
Shraddha Barke afeeff0744 Staging: rtl8723au: core: Remove unused variable
This patch discards the variable as it is not used anywhere throughout
the kernel.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:37 -07:00
Alexander Kuleshov 0c74210509 staging/rtl8723au: Use %pM format specifier to print mac address
printk() supports %pM format specifier for printing 6-byte MAC/FDDI
addresses in hex notation small buffers, let's use it intead of %x:%x...

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:30 -07:00