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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>