1
0
Fork 0
Commit Graph

636 Commits (redonkable)

Author SHA1 Message Date
Derek Robson 875f3a6bce Staging: rtl8712: rtl871x_mlme.h - style fix
Fixed style of block comments
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06 09:17:03 +01:00
Derek Robson a81ad0da85 Staging: rtl8712: rtl871x_io.h - style fix
Fixed style of block comments.
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06 09:17:03 +01:00
Derek Robson 404da57fe9 Staging: rtl8712: rtl871x_event.h - style fix
Fixed style of block comments
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06 09:17:03 +01:00
Derek Robson 50b75bd5ba Staging: rtl8712: rtl871x_cmd.h - block comments
Fixed style of block comments
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06 09:17:03 +01:00
Alexander Mikhalevich 3cbd227956 staging: rtl8712: Fix checkpatch.pl warning
WARNING: Avoid multiple line dereference - prefer 'param->u.crypt.key'

Signed-off-by: Alexander Mikhalevich <alex.mikhalevich@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06 09:17:03 +01:00
Varsha Rao 1b59ea8424 staging: rtl8712: Remove space after a cast.
This patch fixes the following checkpatch issue:

CHECK: No space is necessary after a cast

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06 09:17:03 +01:00
Varsha Rao eafe040b9d staging: rtl8712: Removes the FSF mailing address.
This patch fixes the checkpatch issue by removing the Free Software
Foundation's mailing address from the sample GPL notice. Because the FSF
has changed address in the past, and may change again. Linux already
includes a copy of the GPL.

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06 09:17:03 +01:00
Varsha Rao 95ee706e9a staging: rtl8712: Moved logical OR operator to previous line.
Moved logical OR operator to previous line to fix the following
checkpatch issue:

CHECK: Logical continuations should be on the previous line.

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06 09:17:01 +01:00
Varsha Rao 6e3a0785ea staging: rtl8712: Remove unnecessary parentheses.
Removed unnecessary parentheses around pointers to fix the following
checkpatch issues:

CHECK: Unnecessary parentheses around padapter->xmitpriv
CHECK: Unnecessary parentheses around padapter->recvpriv

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06 09:17:01 +01:00
Varsha Rao 9de60ba959 staging: rtl8712: Match alignment with open parenthesis.
Matched function arguments alignment with its open parenthesis. This patch
fixes the following checkpatch issue:

CHECK: Alignment should match open parenthesis

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06 09:17:01 +01:00
Ingo Molnar 3f07c01441 sched/headers: Prepare for new header dependencies before moving code to <linux/sched/signal.h>
We are going to split <linux/sched/signal.h> out of <linux/sched.h>, which
will have to be picked up from other headers and a couple of .c files.

Create a trivial placeholder <linux/sched/signal.h> file that just
maps to <linux/sched.h> to make this patch obviously correct and
bisectable.

Include the new header in the files that are going to need it.

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-03-02 08:42:29 +01:00
Larry Finger 415a8e0e77 staging: r8712u: Fix Sparse warnings in rtl871x_mlme.c
Sparse reports the following:
  CHECK   drivers/staging/rtl8712/rtl871x_mlme.c
drivers/staging/rtl8712/rtl871x_mlme.c:1653:46: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8712/rtl871x_mlme.c:1653:46:    expected unsigned int [unsigned] [usertype] DSConfig
drivers/staging/rtl8712/rtl871x_mlme.c:1653:46:    got restricted __le32 [usertype] <noident>
drivers/staging/rtl8712/rtl871x_mlme.c:1656:56: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8712/rtl871x_mlme.c:1656:56:    expected unsigned int [unsigned] [usertype] ATIMWindow
drivers/staging/rtl8712/rtl871x_mlme.c:1656:56:    got restricted __le32 [usertype] <noident>
drivers/staging/rtl8712/rtl871x_mlme.c:1712:35: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8712/rtl871x_mlme.c:1712:35:    expected restricted __le16 [addressable] [usertype] cap_info
drivers/staging/rtl8712/rtl871x_mlme.c:1712:35:    got int

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:26:55 +01:00
Larry Finger fc5c13ccd9 staging: r8712u: Fix Sparse warnings in rtl871x_ioctl_linux.c
Sparse reports the following:
  CHECK   drivers/staging/rtl8712/rtl871x_ioctl_linux.c
drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1422:46: warning: restricted __le16 degrades to integer
drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1424:46: warning: restricted __le16 degrades to integer

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:26:55 +01:00
Larry Finger 43d60f9b7f staging: r8712u: Fix Sparse endian warning in rtl871x_recv.c
Sparse reports the following:
  CHECK   drivers/staging/rtl8712/rtl871x_recv.c
drivers/staging/rtl8712/rtl871x_recv.c:657:21: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8712/rtl871x_recv.c:657:21:    expected unsigned short [unsigned] [assigned] [usertype] len
drivers/staging/rtl8712/rtl871x_recv.c:657:21:    got restricted __be16 [usertype] <noident>

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:26:55 +01:00
Larry Finger 07222e5358 staging: r8712u: Fix Sparse warning in rtl871x_xmit.c
Sparse reports the following:
  CHECK   drivers/staging/rtl8712/rtl871x_xmit.c
drivers/staging/rtl8712/rtl871x_xmit.c:350:44: warning: restricted __le32 degrades to integer
drivers/staging/rtl8712/rtl871x_xmit.c:491:23: warning: incorrect type in initializer (different base types)
drivers/staging/rtl8712/rtl871x_xmit.c:491:23:    expected unsigned short [usertype] *fctrl
drivers/staging/rtl8712/rtl871x_xmit.c:491:23:    got restricted __le16 *<noident>
drivers/staging/rtl8712/rtl871x_xmit.c:580:36: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8712/rtl871x_xmit.c:580:36:    expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/staging/rtl8712/rtl871x_xmit.c:580:36:    got restricted __be16 [usertype] <noident>

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:26:55 +01:00
Larry Finger dc223652c6 staging: r8712u: Fix macros used to read/write the TX/RX descriptors
Although the driver works on big-endian hardware, Sparse generates a lot
of warnings. Many of these are the result of incorrect coding of these
macros.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:26:55 +01:00
Larry Finger 221c46d289 staging: rtl8712u: Fix endian settings for structs describing network packets
The headers describing a number of network packets do not have the
correct endian settings for several types of data.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:26:55 +01:00
Larry Finger e2288bce8e staging: rtl8712: Fix some Sparse endian messages
Sparse reports the following:

  CHECK   drivers/staging/rtl8712/rtl8712_xmit.c
drivers/staging/rtl8712/rtl8712_xmit.c:564:42: warning: cast from restricted __le32
drivers/staging/rtl8712/rtl8712_xmit.c:569:42: warning: cast from restricted __le32
drivers/staging/rtl8712/rtl8712_xmit.c:571:42: warning: cast from restricted __le32

Each of these cases is transferring a quantity that is little-endian. There
is no need for conversion.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12 13:26:55 +01:00
Carlos Palminha 70cb11622c staging: rtl8712: rtl8712: fixed missing conversion to le32
Fixed missing conversion to le32, detected by sparse
(invalid assignment from int to __le32)

Signed-off-by: Carlos Palminha <palminha@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:21:26 +01:00
Joseph Wright dec9fcd032 Staging: rtl8712: fix spelling errors
Found by checkpatch:
- s/cacluated/calculated/
- s/convertor/converter/
- s/psudo/pseudo/
- s/halfs/halves/

Signed-off-by: Joseph Wright <rjosephwright@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-25 11:33:21 +01:00
Arnd Bergmann 6e01700602 staging: rtl: fix possible NULL pointer dereference
gcc-7 detects that wlanhdr_to_ethhdr() in two drivers calls memcpy() with
a destination argument that an earlier function call may have set to NULL:

staging/rtl8188eu/core/rtw_recv.c: In function 'wlanhdr_to_ethhdr':
staging/rtl8188eu/core/rtw_recv.c:1318:2: warning: argument 1 null where non-null expected [-Wnonnull]
staging/rtl8712/rtl871x_recv.c: In function 'r8712_wlanhdr_to_ethhdr':
staging/rtl8712/rtl871x_recv.c:649:2: warning: argument 1 null where non-null expected [-Wnonnull]

I'm fixing this by adding a NULL pointer check and returning failure
from the function, which is hopefully already handled properly.

This seems to date back to when the drivers were originally added,
so backporting the fix to stable seems appropriate. There are other
related realtek drivers in the kernel, but none of them contain a
function with a similar name or produce this warning.

Cc: stable@vger.kernel.org
Fixes: 1cc18a22b9 ("staging: r8188eu: Add files for new driver - part 5")
Fixes: 2865d42c78 ("staging: r8712u: Add the new driver to the mainline kernel")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-16 18:08:57 +01:00
Scott Matheina 015ae42838 staging:rtl8712 Aligned code with open parenthesis
Aligned code with open parenthesis to fix a checkpatch warning

Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-07 17:04:04 +01:00
Scott Matheina 5d04ac5412 staging:rtl8712: Removed unnecessary parentheses
Removed unnecessary parentheses identified by checkpatch

Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-07 17:04:04 +01:00
Jannik Becher ce02320224 staging: rtl8712: used a better macro
Fixed a sparse warning.
Using be16_to_cpus() to avoid double assignment.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03 16:51:17 +01:00
Jannik Becher 16b8852fa3 staging: rtl8712: changed u16 to __be16
Fixed sparse warning.
Just changed u16 to __be16 and typecasts.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03 16:51:17 +01:00
Jannik Becher 56384ad6d0 staging: rtl8712: changed cast to __le16
Fixed sparse warning.
Changed u16 to __le16

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03 16:51:17 +01:00
Jannik Becher 78a9bc7304 staging: rtl8712: changed u32 to __le32
Fixed sparse warnings.
Deleted cpu_to_le32() for enum. I'm not sure why it was there.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03 16:51:17 +01:00
Jannik Becher 502c80744f staging: rtl8712: fixed little endian problem
Fixed a sparse warning.
Using function le16_to_cpus() to avoid double assignment.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03 16:51:16 +01:00
Jannik Becher 6839bc8147 staging: rtl8712: changed uint to __le32
Fixed a sparse warning.
Just changed uint to __le32.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03 16:51:16 +01:00
Jannik Becher b596f54834 staging: rtl8712: changed u32 to __le32
Fixed sparse warning.
Just changed u32 to __le32.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03 16:51:16 +01:00
Jannik Becher aa2e04bcdd staging: rtl8712: changed typecast to __le
Fixed sparse warning.
Changed uint to __le16 and __le32.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03 16:51:16 +01:00
Jannik Becher 3d7164c379 staging: rtl8712: changed GetFrameSubType macro
Fixed a sparse warning.
GetFrameSubType and GetFrameType should cast to __le16. Furthermore
GetFramSubType should use le16_to_cpu instead of cpu_to_le16.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03 16:51:16 +01:00
Jannik Becher dd9161483f staging: rtl8712: casted variables to __le32
Fixed a sparse warning.
Casting __le32 variables to the right type.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03 16:51:16 +01:00
Jannik Becher bcb91a5cfe staging: rtl8712: changed function argument to __le32
Fixed a sparse warning "cast to restricted __le32".
Function argument is of type __le32.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03 16:51:16 +01:00
Jannik Becher e8cd841bee staging: rtl8712: changed variables to __le32
Fixed sparse warning "cast to restricted __le32".
Changed struct tx_desc members to __le32 and pcmdbuf to __le32.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03 16:51:16 +01:00
Jannik Becher 8c3af8f0de staging: rtl8712: changed struct members to __le32
Fixed sparse warning "cast to restricted __le32".
struct sitesurvey_parm uses little endian members.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03 16:51:16 +01:00
Jannik Becher 3e588e3afb staging: rtl8712: changed struct members to __le32
Fixed sparse warning "cast to restricted __le32".
struct recv_stat and struct phy_stat have always little endian members.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03 16:49:19 +01:00
Harsh Jain 30c39a6507 Staging:rtl8712: Fixed coding style issue
Fixes following checkpatch.pl warning
	Block comments should align the * on each line

Signed-off-by: Harsh Jain <harshjain32@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-12-06 10:18:07 +01:00
Shiva Kerdel 08711b876d Staging: rtl8712: rtl871x_*: Removed unnecessary else statements after a break or return
The indent code blocks of the else statements were unnecessary
and are better written without them.

Signed-off-by: Shiva Kerdel <shiva@exdev.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-21 11:25:41 +01:00
Vijai Kumar K 09b080f73a staging: rtl8712: Fix coding style warnings on Block comments
Fixed checkpatch.pl warnings related to Block comments in
staging/rtl8712/*.c files.

Signed-off-by: Vijai Kumar K <vijaikumar.kanagarajan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-21 11:15:18 +01:00
Yamanappagouda Patil 20a035e2d8 Staging: rtl8712: Fixed 'tabstop' coding style warnings.
Fixed checkpatch warning "Statements should start on a tabstop" in
rtl8712 module.

Signed-off-by: Yamanappagouda Patil <goudapatilk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-17 16:32:33 +01:00
Souptick Joarder bd4fcdaddc staging : rtl8712: Free memory when kmalloc fails
There are few functions where we need to free previously allocated
memory when kmalloc fails. Else it may lead to memory leakage. In
_init_cmd_priv() and _r8712_init_xmit_priv(), in few places we are
not freeing previously allocated memory when kmalloc fails.

Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-07 11:24:52 +01:00
Bhumika Goyal 340c046991 Staging: rtl8712: remove unused functions
Remove the functions sleep_schedulable, down_scanned_network,
up_scanned_network and get_free_xmit_queue as they are not used anywhere
in the kernel. Functions detected using coccinelle but changes done by
hand.
Script:

@initialize:python@
@@
def display(name,p):
        print(name,p[0].file)

@r1@
identifier func;
type T;
position p;
@@
static T func@p(...)
{
...
}

@r@
identifier r1.func;
@@
func

@script:python depends on !r@
func << r1.func;
p << r1.p;
@@
display(func,p)

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:24:51 +02:00
Zach Brown 0c1d83c495 staging: rtl8712: Change _LED_STATE enum in rtl871x driver to avoid conflicts with LED namespace
Adding led support for phy causes namespace conflicts for some
phy drivers.

The rtl871 driver declared an enum for representing LED states. The enum
contains constant LED_OFF which conflicted with declaration found in
linux/leds.h. LED_OFF changed to LED_STATE_OFF
In order to avoid a possible future collision LED_ON was changed to
LED_STATE_ON as well.

Signed-off-by: Zach Brown <zach.brown@ni.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-28 11:36:45 +02:00
Matthew Kilgore 8681a1d47b Fixes: 3d44a78f0d ("staging: rtl8712: Remove unnecessary 'else'")
An "unnecessary" 'else' was removed due to complains from checkpatch.pl
as it is preceded by a 'return', however the 'else' branch is necessary
as an earlier branch of the 'if' falls through. By removing the 'else',
that route now hits the 'break' and the 'while' loop exits prematurely.

This commit reverts that change and puts the original 'else' back in
place.

Signed-off-by: Matthew Kilgore <mattkilgore12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-28 08:10:36 +02:00
Namrata A Shettar 3d44a78f0d staging: rtl8712: Remove unnecessary 'else'
Remove unnecessary 'else' after 'return' to resolve checkpatch issue.

Signed-off-by: Namrata A Shettar <namrataashettar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-27 13:08:05 +02:00
Gonçalo Salazar 1140c8a61a staging: rtl8172: usb_intf.c: Fixed block comment coding style
Fixed a block comment indentation in the rtl8712 usb_intf.c file.

Signed-off-by: Gonçalo Salazar <glbsalazar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-26 22:22:13 +02:00
Sandhya Bankar 11975c56b6 Staging: rtl8712: rtl871x_cmd: Use !x instead of x == NULL.
Use !x instead of x == NULL. This patch was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20 13:38:00 +02:00
Sandhya Bankar 78f70e6dfe Staging: rtl8712: rtl8712_xmit: Use !x instead of x == NULL
Use !x instead of x == NULL. This patch was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20 13:38:00 +02:00
Sandhya Bankar a667dbce78 Staging: rtl8712: rtl8712_recv: Use !x instead of x == NULL
Use !x instead of x == NULL. This patch was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20 13:38:00 +02:00
Sandhya Bankar c43fcdd443 Staging: rtl8712: rtl8712_efuse: Use !x instead of x == NULL.
Use !x instead of x == NULL. This patch was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20 13:37:59 +02:00
Namrata A Shettar 9fa1f943d6 staging: rtl8712: Rename misspelt macro
Correct the word 'success' being misspelt in the macro:
- LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA => LED_BLINK_WPS_SUCCESS_INTERVAL_ALPHA

Signed-off-by: Namrata A Shettar <namrataashettar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-17 23:36:53 +02:00
Wei Yongjun 4db7c0bebd staging: rtl8712: fix double lock bug in SetPSModeWorkItemCallback()
Fix a double lock bug in SetPSModeWorkItemCallback().

Fixes: 5c2ba8b85e ("rtl8712: pwrctrl_priv: Replace semaphore lock with mutex")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16 10:05:13 +02:00
Shaily Sangwan 4a2a867f5b staging: rtl8712: fix block comments
This patch fixes the following checkpatch.pl warning:
Block comments use * on subsequent lines

Signed-off-by: Shaily Sangwan <shaily15297@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 14:51:53 +02:00
Omri Arad 12bc1d1e9c staging: rtl8712: fix coding style error reported from checkpatch
removed the following:
ERROR: code indent should use tabs where possible
WARNING: please, no spaces at the start of a line
WARNING: Statements should start on a tabstop

Signed-off-by: Omri Arad <omriarad3@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 14:51:53 +02:00
Raphaël Beamonte bef611a92e staging: rtl8712: checkpatch cleanup: block comments using a trailing */
Fix checkpatch.pl warning "Block comments use a trailing */ on
a separate line" on multiple files of the driver by editing the
affected comments.

Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12 11:43:52 +02:00
Louie Lu 8292b4de4e staging: rtl8172: fixed comment style in rts871x_cmd.c
Fixed comment style warning by checkpatch:

* Block comments use * on subsequent lines
* Block comments use a trailing */ on a separate line

Signed-off-by: Louie Lu <louie.lu@hopebaytech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-02 14:55:54 +02:00
Louie Lu 8f8064e4cc staging: rtl8712: delete one space before if statement
This patch fixed minor checkpatch warning:

WARNING: Statements should start on a tabstop

Signed-off-by: Louie Lu <louie.lu@hopebaytech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-02 14:55:54 +02:00
Binoy Jayan 5c2ba8b85e rtl8712: pwrctrl_priv: Replace semaphore lock with mutex
The semaphore 'lock' in 'pwrctrl_priv' is used as a simple mutex, so it
should be written as one. Semaphores are going away in the future.
_enter_pwrlock was using down_interruptible(), so the lock could be broken
by sending a signal. This could be a bug, because nothing checks the return
code here. Hence, using mutex_lock instead of the interruptible version.
Removing the now unused _enter_pwrlock and _down_sema.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:44:01 +02:00
Larry Finger 580b410553 staging: r8712u: Handle some false positives from kmemleak
When this driver preallocates some URBs, kmemleak is unable to find that
allocated memory when it scans. When the driver is unloaded, that memory
is reclaimed, therefore, the report is a false positive.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:28:49 +02:00
Larry Finger 78ece0b945 staging: r8712u: Fix leak of skb
There are two types of messages queued for RX. The major type, which does
I/O on the device, was being handled properly. The skbs that communicated
with the firmware were being leaked.

While rewriting the code that sets up the skb, it was possible to remove
the private variable indicating that the old skb could be reused.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:28:49 +02:00
Larry Finger 74a3b060bc staging: r8712u: Check pointer before use
Routine r8712_usb_read_port() dereferences "precvbuf" before testing it
for NULL.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:28:49 +02:00
Parth Sane d25f658df2 staging: rtl8712: Fixed multiple parenthesis alignment warnings in ieee80211.c
Multiple parenthesis alignment warnings were thrown by checkpatch in ieee80211.c
This patch effectively fixes that.

Signed-off-by: Parth Sane <laerdevstudios@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:26:45 +02:00
Anuradha Weeraman af07477f59 Staging: rtl8712: Fixed brace and comment style issue
Fixed issues with coding style.

Signed-off-by: Anuradha Weeraman <anuradha@weeraman.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:26:45 +02:00
Binoy Jayan 7c2bb7aff9 rtl8712: intf_priv: Replace semaphore lock with completion
The semaphore 'lock' in 'intf_priv' is used as completion,
so convert it to a struct completion type.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:25:47 +02:00
Binoy Jayan 204a8ac1db rtl8712: Replace semaphore terminate_cmdthread_sema with completion
The semaphore 'terminate_cmdthread_sema' is used as completion,
so convert it to a struct completion type.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:25:47 +02:00
Binoy Jayan 0f89054a0f rtl8712: Replace semaphore cmd_queue_sema with completion
The semaphore 'cmd_queue_sema' is used as completion,
so convert it to a struct completion type.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:25:47 +02:00
Parth Sane e7d992d8b6 rtl8712: Fixed alignment to match open parenthesis
Fixed alignment to match open parenthesis.

Signed-off-by: Parth Sane <laerdevstudios@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 13:57:12 -07:00
Geliang Tang fcc2cf12a3 staging: rtl8712: use container_of() instead of LIST_CONTAINOR()
This patch drops the local definition of LIST_CONTAINOR(), and uses
container_of() instead of it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:53:47 -07:00
Bhaktipriya Shridhar 4d97b69147 staging: rtl8712: mlme_linux: Clean up tests if NULL returned on failure
Some functions like kzalloc return NULL on failure.
When NULL represents failure, !x is commonly used.

This was done using Coccinelle:

@@
expression *e;
identifier l1;
@@

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

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Parth Sane 5ab2ce4305 staging: rtl8712: Fixed FSF address warning in ieee80211.c
Fixed checkpatch warning after removing FSF address block as per guidelines.

Signed-off-by: Parth Sane <laerdevstudios@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Parth Sane e8aad70c97 staging: rtl8712: Fixed FSF address warning in hal_init.c
Fixed checkpatch warning after removing FSF address block as per guidelines.

Signed-off-by: Parth Sane <laerdevstudios@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Parth Sane c7838db04d staging: rtl8712: Fixed FSF address warning in ethernet.h
Fixed checkpatch warning after removing FSF address block as per guidelines.

Signed-off-by: Parth Sane <laerdevstudios@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Parth Sane 501ef12a74 staging: rtl8712: Fixed FSF address warning in drv_types.h
Fixed checkpatch warning after removing FSF address block as per guidelines.

Signed-off-by: Parth Sane <laerdevstudios@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Parth Sane b2def44cf0 staging: rtl8712: Fixed FSF address warning in basic_types.h
Fixed checkpatch warning after removing FSF address paragraph as per guidelines.

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

This was done using Coccinelle:

@@
expression *e;
identifier l1;
@@

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

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

This was done using Coccinelle:

@@
expression *e;
identifier l1;
@@

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

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

This was done using Coccinelle:

@@
expression *e;
identifier l1;
@@

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

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

This was done using Coccinelle:

@@
expression *e;
identifier l1;
@@

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

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Bhaktipriya Shridhar b7af4e6cc7 staging: rtl8712: os_intfs: Change form of NULL comparisons
Change null comparisons of the form x == NULL to !x.
This was done using Coccinelle.
@@ expression e;
@@
- e == NULL
+ !e

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Bhaktipriya Shridhar d08073d924 staging: rtl8712: rtl871x_ioctl_set: Remove unused macro
Removed Unused macro IS_MAC_ADDRESS_BROADCAST.
Grep'd to find occurences.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Juliana Rodrigues 7fcf92c0a4 staging: rtl8712: rtl8712_cmd.c: fixed comparison to null
This patch fixes multiple "comparison to NULL"
checkpatch.pl issues:

CHECK: Comparison to NULL could be written "!pcmd"
+               if (pcmd == NULL)

Signed-off-by: Juliana Rodrigues <juliana.orod@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Juliana Rodrigues 4dadfb97b7 staging: rtl8712: hal_init.c: fix comment block code style
This patch fixes several warnings caused by
malformed comments on hal_init.c and found by
checkpatch.pl.

Signed-off-by: Juliana Rodrigues <juliana.orod@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Xose Vazquez Perez 586add48d4 staging: refresh TODO for rtl8712
People should not waste time and energy working on this staging driver.
At least four drivers were written for this hardware:
 https://marc.info/?l=linux-wireless&m=138358275410975
And there is a replacement using the kernel wireless stack at:
 https://github.com/chunkeey/rtl8192su
Also a fullmac/cfg80211 driver(r92su) is available.

Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Cc: Christian Lamparter <chunkeey@googlemail.com>
Cc: Joshua Roys <Joshua.Roys@gtri.gatech.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linux Driver Project Developer List <driverdev-devel@linuxdriverproject.org>
Cc: Linux Wireless <linux-wireless@vger.kernel.org>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-22 22:22:13 -04:00
Bhumika Goyal 0df56d78d2 Staging: rtl8712: Remove function r8712_setptm_cmd and r8712_gettssi_cmd
The function r8712_setptm_cmd and r8712_gettssi_cmd are not used
anywhere in the kernel so remove them. Also, remove their function
prototypes.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar 336e8320e9 staging: rtl8712: Remove unnecessary else after return
This patch fixes the checkpatch warning that else is not generally
useful after a break or return.

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

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Sandhya Bankar 8558ace8b7 Staging: rtl8712: Avoid multiple assignments.
Avoid multiple assignments.This isssue is found by checkpatch.pl script.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
G Pooja Shamili 1d1b7e87a3 staging: rtl8712: Remove the unnecessary parantheses
The unnecessary parantheses on the right side of assignments were removed,
as in most cases (expect for ==, >=, <=, !=), they are futile.

This was done using Coccinelle, the semantic patch being:

@@
expression E1,E2,E3;
binary operator bin_op = {==,>=,<=,!=};
@@

E1 =
(
  (
   E2 bin_op E3
  )
|
-(
E2
-)
)
;

Signed-off-by: G Pooja Shamili <poojashamili@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Amitoj Kaur Chawla bce2fc58b7 staging: rtl8712: rtl871x_mp_ioctl: Remove exceptional & on function name
In this file, function names are otherwise used as pointers without
&.

The Coccinelle semantic patch that is used to make this change is as
follows:

// <smpl>
@r@
identifier f;
@@
f(...) { ... }
@@
identifier r.f;
@@
- &f
+ f
@m@
type T;
identifier f;
@@
T f(...);
@@
identifier m.f;
@@
- &f
+ f
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar 6806be3184 drivers: staging: rtl8712: Change form of NULL comparisons
Change null comparisons of the form x == NULL to !x.
This was done using Coccinelle.

@@
expression e;
@@
- e == NULL
+ !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 40430f0ce2 staging: rtl8712: Make return of 0 explicit
Delete unnecessary local variable whose value is always 0 and
return 0 as the result.

The following Coccinelle script was used:

@@
identifier ret; expression E;
type T;
@@
(
- T ret;
|
- T ret = 0;
)

... when != \(ret=E
\|ret--\|ret++\|--ret\|++ret\|ret-=E\|ret+=E\|ret|=E\|ret&=E\)
(
?-ret = 0;
)
... when != \(ret=E
\|ret--\|ret++\|--ret\|++ret\|ret-=E\|ret+=E\|ret|=E\|ret&=E\)
(
return
- ret
+ 0
;
)

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
Bhumika Goyal 9155c92463 Staging: rtl8712: Clean up tests if NULL returned on failure
Some functions like kmalloc/usb_alloc_urb/kmalloc_array returns NULL as
their return value on failure. !x is generally preferred over x==NULL
or NULL==x so make use of !x if the value returned on failure
by these functions is NULL.
Done using coccinelle:

@@
expression e;
statement S;
@@
e = \(kmalloc\|devm_kzalloc\|kmalloc_array
     \|devm_ioremap\|usb_alloc_urb\|alloc_netdev\)(...);
- if(e==NULL)
+ if(!e)
  S

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar bb106dc0e2 staging: rtl8712: 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
Bhaktipriya Shridhar 6e4eb86913 staging: rtl8712: Simplify return
Simplified the multiline check to a single return statement.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Amitoj Kaur Chawla ecf2e02cd4 staging: rtl8712: Remove exceptional & on function name
Remove exceptional '&' operator in front of a function name.

The Coccinelle semantic patch that is used to make this change is as
follows:

// <smpl>
@r@
identifier f;
@@
f(...) { ... }
@@
identifier r.f;
@@
- &f
+ f
@m@
type T;
identifier f;
@@
T f(...);
@@
identifier m.f;
@@
- &f
+ f
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar fe5e5e3a16 staging: rtl8712: Remove unnecessary cast on void pointer
The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T*)x)->f
|
- (T*)
  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 56238e456c staging: rtl8712: Remove cast on void pointer
The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  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
Tapan Prakash T 7fe8bd047b drivers: staging: rtl8712: rtl871x_xmit.c: Fix Comparisons should place the constant on the right side of the test warning
Fixed checkpatch.pl warning 'Comparisons should place the constant on the
right side of the test'

Signed-off-by: Tapan Prakash T <tapanprakasht@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-05 14:48:04 -08:00
Alan 0c68423556 rtl871x: avoid running off end of buffer
If 32 bytes of non zero are passed in pdata->pointer then the mac_pton
function will run off the end of the buffer. Make sure we always have a
terminated string kernel side.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-05 14:48:04 -08:00
Bhaktipriya Shridhar 7cb07dc4e4 staging: rtl8712: Replace explicit NULL comparison
Replace explicit NULL comparison with ! operator.
Found with Coccinelle.

@@
expression e;
@@
- e == NULL
+ !e

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:18:33 -08:00
Arnd Bergmann 8c5af16f79 staging: rtl8712: reduce stack usage
The "translate_scan" function in rtl8712 uses a lot of stack, and
gets inlined into its single caller, r8711_wx_get_scan, which
in some configurations now blows the 1024 byte stack warning
limit:

drivers/staging/rtl8712/rtl871x_ioctl_linux.c: In function 'r8711_wx_get_scan':
drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1227:1: error: the frame size of 1032 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

This somewhat reduces the stack usage by moving the translate_scan
function out of line with the noinline_for_stack annotation.
It might be possible to modify translate_scan() a little further
to reduce the stack usage, but with this patch, we can build without
the warning, the the call chain to get here is rather predictable
(sys_ioctl->vfs_ioctl->sock_ioctl->dev_ioctl->wext_ioctl->
r8711_wx_get_scan).

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:18:33 -08:00
Hemmo Nieminen b900d57937 staging: rtl8712: Improve suspend/resume functionality.
Fix a driver hang caused by earlier suspend/resume cycles. By handling a
ENODEV error during suspend as a real error we eventually end up stopping
the whole driver.

Fix this by handling the ENODEV error (during suspend) essentially by
retrying.

Signed-off-by: Hemmo Nieminen <hemmo.nieminen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:18:33 -08:00
Amitoj Kaur Chawla f99ca86646 staging: rtl8712: Declare function as static
Declare rtl871x_intf_resume() function static since it is defined and called
in this file only.

This fixes the following sparse warning:
warning: symbol 'rtl871x_intf_resume' was not declared. Should it be static?

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:18:33 -08:00
Joseph Bisch af09054958 staging: rtl8712: Remove unnecessary ret variable
Since the variable ret is set at the beginning of the function and
never changes its value, we can just return the value it was set to.

Found using coccinelle with misc/returnvar.cocci.

Signed-off-by: Joseph Bisch <joseph.bisch@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:49:09 -08:00
Rakhi Sharma f7099ad7bd staging: rtl8712: Fixed a comparision coding style warning.
WARNING: Comparisons should place the constant on the right side of the test
Fixed this warning by placing the constant on right side.

Signed-off-by: Rakhi Sharma <rakhish1994@gmail.com>-
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:49:09 -08:00
Geliang Tang 818ff7b28b staging: rtl8712: use list_first_entry_or_null()
Use list_first_entry_or_null() instead of list_empty() + LIST_CONTAINOR()
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:53:04 -08:00
Rakhi Sharma 97e2ba90fc Staging: rtl8712: rtl8712_cmd: Fixed a warning.
Warning:Comparisons should place the constant on the right side of the test
Fixed by placing the comparisions constant on right side of the test.

Signed-off-by: Rakhi Sharma <rakhish1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:53:04 -08:00
Dan Carpenter aea48157ce staging: rtl8712: memory corruption in wpa_set_encryption()
->KeyMaterial is declared as a 16 byte array, but we only ever allocate
either 5 or 13 bytes of it.  The problem is that we memset() all 16
bytes to zero so we're memsetting past the end of the allocated memory.

I fixed this in slightly lazy way, by just allocating 16 bytes.  This
works but there is a lot more cleanup you could do to this code if you
wanted.  Which is why this code is in staging.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:52:30 -08:00
Lucas Tanure eaf0e7966d Staging: rtl8712: Remove unnecessary cast on void pointer
The conversion from void pointer to any other pointer type is guaranteed
by the C programming language.

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
)

Signed-off-by: Lucas Tanure <tanure@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:52:30 -08:00
Nicholas Mc Guire 7c2a2017e5 staging: rtl8712: consolidate kmalloc + memset 0 to kzalloc
This is an API consolidation only. The use of kmalloc + memset to 0
here is equivalent to kzalloc.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:52:30 -08:00
Hemmo Nieminen 39e9526cec staging: rtl8712: Improve suspend/resume functionality.
Cancel pending URBs during suspend operation to avoid receiving ESHUTDOWN
in read/write completion callbacks while the device is suspended.

Receiving ESHUTDOWN in read/write completion callbacks will cause the
driver to enter a non-functioning "stopped" state from which the driver is
unable to recover without reloading the module.

Signed-off-by: Hemmo Nieminen <hemmo.nieminen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:52:30 -08:00
Mauro Dreissig 549d33d278 staging: rtl8712: Cleanup _io_ops wrappers
This removes ugly and unnecessary declarations.

Signed-off-by: Mauro Dreissig <mukadr@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:50:09 -08:00
Michael Hornung 1d282c3100 staging: rtl8712: Remove unused CamelCase define
* Remove unused CamelCase in order to get rid of the corresponding
  checkpatch.pl "CHECK: Avoid CamelCase: <IEEE80211_QoS_DATAGRP>"

Signed-off-by: Michael Hornung <mhornung.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:50:09 -08:00
Michael Hornung b18025a841 staging: rtl8712: Coding style: Fix alignment
* Fix alignment which did not match open parenthesis

Signed-off-by: Michael Hornung <mhornung.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:50:09 -08:00
Michael Hornung da20958454 staging: rtl8712: Replace FSF mailing address by URL
* Fix checkpatch.pl output about not including the paragraph
  about writing to the Free Software Foundation's mailing address

Signed-off-by: Michael Hornung <mhornung.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:50:09 -08:00
Michael Hornung 7e68f50a9b staging: rtl8712: Coding style: Fix missing spaces
* Add missing spaces around bitwise OR operation in order to get
  rid of checkpatch.pl's "CHECK: spaces preferred around that '|'"

Signed-off-by: Michael Hornung <mhornung.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:50:09 -08:00
Michael Hornung 364cdb3f57 staging: rtl8712: Coding style: Make use of BIT macro
* Replace all occurences of (1<<x) by BIT(x) in order to get rid
  of checkpatch.pl "CHECK" output "Prefer using the BIT macro"

Signed-off-by: Michael Hornung <mhornung.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:50:09 -08:00
Michael Hornung 3ce780f004 staging: rtl8712: Coding style: Remove multiple blank lines
* Remove multiple blank lines in order to get rid of checkpatch.pl
  "CHECK" output

Signed-off-by: Michael Hornung <mhornung.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:50:09 -08:00
Amitoj Kaur Chawla ec85e8c47b staging: rtl8712: rtl871x_sta_mgt: Remove wrapper function
Remove wrapper function mfree_sta_priv_lock() that can be replaced by a
direct call to mfree_all_stainfo().

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:50:09 -08:00
Amitoj Kaur Chawla d48df5b37e staging: rtl8712: rtl871x_mlme: Remove wrapper function
Remove wrapper function free_network_nolock() that can be replaced by a single line of code.

This patch renames _free_network_nolock() function to free_network_nolock().

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 657ff36ff5 staging: rtl8712: rtl871x_io: Remove unused function
Drop 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-10-29 07:55:17 +09:00
Amitoj Kaur Chawla d743db9f05 staging: rtl8712: rtl871x_mp: Remove unused function
Drop unused function that is defined but is not called anywhere.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 16:58:00 +09:00
Amitoj Kaur Chawla b85f3d4e58 staging: rtl8712: Remove unnecessary variables
Remove unnecessary variables 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 16:58:00 +09:00
Cristina Moraru ada40ba4e5 staging: rtl8712: Replace kmalloc with kmalloc_array
Replace kmalloc with specialized function kmalloc_array
when the size is a multiplication of:
	number_of_elements * size_of_element

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:38:48 -07:00
Luis de Bethencourt 4ef2de5ae0 staging: rtl8712: spaces preferred around operands
Clean up all instances of checkpatch.pl checks:
CHECK: spaces preferred around that '+'
(and other operands)

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:26:59 -07:00
Luis de Bethencourt 168a2c1028 staging: rtl8712: braces should be used on all arms
Fix all instances of the following checkpatch.pl check:
CHECK: braces {} should be used on all arms of this statement

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:26:59 -07:00
Luis de Bethencourt 1ca96884b1 staging: rtl8712: Remove boolean comparisons
Boolean tests do not need explicit comparison to true or false.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:26:59 -07:00
Larry Finger 1e6e632836 staging: rtl8712: Add device ID for Sitecom WLA2100
This adds the USB ID for the Sitecom WLA2100. The Windows 10 inf file
was checked to verify that the addition is correct.

Reported-by: Frans van de Wiel <fvdw@fvdw.eu>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Frans van de Wiel <fvdw@fvdw.eu>
Cc: Stable <stable@vger.kernel.org> [All stable versions]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:12:48 -07:00
Punit Vara d32c16d2fc Staging: rtl8712: Coding style warnings fix for block comments
This patch is to the rtl871x_ioctl_linux.c file that fixes up following
warnings reported by checkpatch.pl :

-Block comments use * on subsequent lines
-Block comments use a trailing */ on a separate line

Signed-off-by: Punit Vara <punitvara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:15:57 -07:00
Punit Vara a1b42bef0a Staging: rtl8712: Use ether_addr_equal() over memcmp()
This patch is to the rtl871x_ioctl_linux.c file that fixes up following
warning reported by checkpatch.pl :

-Prefer ether_addr_equal() or ether_addr_equal_unaligned() over memcmp()

bssid and pnetwork->network.MacAddress both are 6 byte
array which aligned with u16

Signed-off-by: Punit Vara <punitvara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:15:57 -07:00
Punit Vara e904cc8f57 Staging: rtl8712: Fix warning prefer eth_broadcast_addr() over memset()
This patch is to the rtl871x_ioctl_linux.c that fixes up following
warning by checkpatch.pl:

-Prefer eth_broadcast_addr() over memset()

Signed-off-by: Punit Vara <punitvara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:15:57 -07:00
Amitoj Kaur Chawla a90391e4c1 staging: rtl8712: rtl8712_recv: 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:15:57 -07:00
Shivani Bhardwaj 28aba50013 Staging: rtl8712: usb_ops_linux: Remove useless 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:12:30 -07:00
Shivani Bhardwaj 0b2ea2c7ad Staging: rtl8712: rtl871x_io: Remove explicit cast
Explicit typecasting 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:12:30 -07:00
Shivani Bhardwaj 993c307eb4 Staging: rtl8712: rtl8712_xmit: Remove useless cast
Explicit typecasting of variables 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:12:30 -07:00
Shivani Bhardwaj 7074ed3df1 Staging: rtl8712: rtl8712_io: Remove unnecessary cast
Typecasting should be removed from variables as it is not required.
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:12:30 -07:00
Shivani Bhardwaj adc08cc4c9 Staging: rtl8712: rtl8712_cmd: Remove useless cast
Explicit type conversions are not required so, remove them.
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:12:30 -07:00
Shivani Bhardwaj adc6b375aa Staging: rtl8712: os_intfs: Remove unnecessary cast
Explicit type conversions are not required and so, they 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:12:30 -07:00
Luis de Bethencourt 681cd988d3 staging: rtl8712: fix negative level value
range->avg_qual.level is of type uint8, so it shouldn't be assigned a
negative number. Assigning it 0x100 - 78, which is the equivalent
to (20 + -98) dBm when IW_QUAL_DBM is set.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 20:43:20 -07:00
Amitoj Kaur Chawla 942eaa867f staging: rtl8712: usleep_range is preferred over udelay
Fix checkpatch.pl issue: "CHECK: usleep_range is preferred over
udelay;
see Documentation/timers/timers-howto.txt".
Replace `udelay()` with a call to `usleep_range()` with a reasonable
upper limit determined by the other sleeping functions present.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 20:43:20 -07:00
Amitoj Kaur Chawla b33fc72291 staging: rtl8712: Replace GFP_ATOMIC with GFP_KERNEL
Replace GFP_ATOMIC with GFP_KERNEL since GFP_ATOMIC is used in
atomic context and only needed when functions are not allowed to sleep
whereas the function is later calling msleep().

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 20:43:20 -07:00
Shraddha Barke eef6c808d3 Staging: rtl8712: 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:43:20 -07:00
Punit Vara cbe396fbac Staging: rtl8712: rtl8712_hal.h: Coding style warnings fix for block comments
This is patch to the rtl8712_hal.h file that fixes up following warning
reported by checkpatch.pl :

-Block comments use a trailing */ on a separate line

Signed-off-by: Punit Vara <punitvara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 10:34:50 +01:00
Punit Vara 3d228d87fc Staging: rtl8712: rtl8712_gp_bitdef.h: Coding style warning fix for block comment
This is patch to the rtl8712_gp_bitdef.h file that fixes up following
 warning reported by checkpatch.pl :

-Block comments use a trailing */ on a separate line

Signed-off-by: Punit Vara <punitvara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 10:34:50 +01:00
Punit Vara 602cac56dd Staging: rtl8712: rtl8712_cmdctrl_bitdef.h: Coding style warning fix for block comment
This is patch to the rtl8712_cmdctrl_bitdef.h file that fixes up following
 warning reported by checkpatch.pl :

-Block comments use a trailing */ on a separate line

Signed-off-by: Punit Vara <punitvara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 10:34:50 +01:00
Punit Vara ed9c838a5d Staging: rtl8712: rtl8712_cmd.c: Coding style warnings fix for block comments
This is patch to the rtl8712_cmd.c file that fixes up following warning
reported by checkpatch.pl :

-Block comments use a trailing */ on a separate line

Signed-off-by: Punit Vara <punitvara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 10:34:50 +01:00
Punit Vara 61172e0c88 Staging: rtl8712: recv_linux.c: Coding style warning fix for block comment
This is patch to the recv_linux.c file that fixes up following warning
reported by checkpatch.pl :

-Block comments use a trailing */ on a separate line

Signed-off-by: Punit Vara <punitvara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 10:34:50 +01:00
Punit Vara 852681eb4a Staging: rtl8712: os_intfs.c : Coding style warning fix for block comment
This is patch to the os_intfs.c file that fixes up following warning
reported by checkpatch.pl :

-Block comments use a trailing */ on a separate line

Signed-off-by: Punit Vara <punitvara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 10:34:50 +01:00
Punit Vara 652199cc28 Staging: rtl8712: ieee80211.h: Coding style warnings fix for block comments
This is patch to the ieee80211.h file that fixes up following warning
reported by checkpatch.pl :

-Block comments use * on subsequent lines
-Block comments use a trailing */ on a separate line

Signed-off-by: Punit Vara <punitvara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 10:34:50 +01:00
Punit Vara 4fd8cba140 Staging: rtl8712: ieee80211.c: Coding style warnings fix for block comments
This is patch to the ieee80211.c file that fixes up following warning
reported by checkpatch.pl :

-Block comments use * on subsequent lines
-Block comments use a trailing */ on a separate line

Signed-off-by: Punit Vara <punitvara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 10:34:50 +01:00
Punit Vara 0c9968ef9b Staging: rtl8712: drv_types.h:Coding style warnings fix for block comments
This is patch to the drv_types.h file that fixes up following warning
reported by checkpatch.pl :

-Block comments use * on subsequent lines
-Block comments use a trailing */ on a separate line

Signed-off-by: Punit Vara <punitvara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 10:34:46 +01:00
Amitoj Kaur Chawla 8d2884ace7 staging: rtl8712: Remove NULL comparison
Remove NULL comparison by using '!' operator. Problem found using
checkpatch.pl
CHECK: Comparison to NULL could be written "!padapter->halpriv.hal_bus_init"

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 10:25:32 +01:00
Amitoj Kaur Chawla 2a1283606f staging: rtl8712: Remove NULL comparison
Remove NULL comparison by using '!' operator. Problem found
using checkpatch.pl
CHECK: Comparison to NULL could be written "!ptmpchar"

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 10:25:32 +01:00
Alison Schofield 29b1b61435 staging: rtl8712: Move constant to right of test or replace with "!"
Move constant to the right side of comparison operator or replace
equality operator (==) with the unary negation operator (!) if the
comparison is to zero.

Addesses multiple instances of the checkpatch.pl warning:
WARNING: Comparisons should place the constant on the right side of the
test

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 10:25:32 +01:00
Amitoj Kaur Chawla 335b9efa72 staging: rtl8712: Add space around '&'
Add space around operator '&'. Problem found using
checkpatch.pl
CHECK: spaces preferred around that '&' (ctx:VxV)

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 10:25:32 +01:00
Amitoj Kaur Chawla 7ab4609a5d staging: rtl8712: Add spaces around '|'
Add space around operator '|'. Problem found using
checkpatch.pl
CHECK: spaces preferred around that '|' (ctx:VxV)

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 10:25:32 +01:00
Amitoj Kaur Chawla b3845d0239 staging: rtl8712: Add space around '+'
Add space around operator '+'. Problem found using
checkpatch.pl
CHECK: spaces preferred around that '+' (ctx:VxV)

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 10:25:32 +01:00
Andy Shevchenko 3fe1be87ab staging: rtl8712: re-use mac_pton()
...instead of custom approach

Cc: Joshua Clayton <stillcompiling@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-02 11:48:15 +02:00
Luis de Bethencourt 96a384a7ed staging: rtl8712: remove dead code
The while() loop will only exit in a return or a goto ask_for_joinbss,
which means it will never break and execute the return after it.
Removing return _FAIL since it is dead code.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 04:30:07 +02:00
Punit Vara 98a5248316 Staging: rtl8712: Coding style warning fix for block comment
This is a patch to mlme_linux.c that fixes up following warning
reported by checkpatch.pl :

-Block comments use a trailing */ on a separate line

Signed-off-by: Punit Vara <punitvara@gmailc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-20 19:16:13 -07:00
Samuel Dominguez Lorenzo 4579ec9af0 staging: rtl8712: usb_ops_linux: fixed a comparison coding style issue
Fixed a coding style issue where a comparison had the constant on the
left side of the test instead of being on the right side of it.

Signed-off-by: Samuel Dominguez Lorenzo <yysamueldominguez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14 08:50:44 -07:00
Anish Bhatt 4c021dc0b8 staging/rtl8712 : Remove duplicated BIT() definitions
The BIT() macro is already defined in bitops.h,
remove duplicate definitions.

Signed-off-by: Anish Bhatt <anish@chelsio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:56 -07:00
Anish Bhatt 27934f362a staging/rtl8712 : Remove unused macro definitions.
WLAN_ETHHDR_LEN/WLAN_ETHADDR_LEN/WLAN_ADDR_LEN
 are unused, duplicate or unnecessary, remove.

Signed-off-by: Anish Bhatt <anish@chelsio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:56 -07:00
Joe Perches a5ee4695ec staging: rtl8712: Remove unnecessary externs
Using 'extern' is not necessary for function prototypes.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14 18:51:56 -07:00
Joshua Clayton 7fb539eda2 staging: rtl8712: change SupportedRates to rates
Change the value to a name that conforms to Linux coding style.

"rates" is equally expressive in this context, and I have left alone
a comment and function name that describe the rates as supported rates.

Signed-off-by: Joshua Clayton <stillcompiling@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:14:04 -07:00
Joshua Clayton db55b1652e staging: rtl8712: remove typedefs
Coding style fix.
Get rid of typedefs NDIS_802_11_RATES and NDIS_802_11_RATES_EX
Undo any casting that was done as a result of the typedef.

Signed-off-by: Joshua Clayton <stillcompiling@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:14:04 -07:00
Joshua Clayton 986fc8e741 staging: rtl8712: rename function
Rename r8712_get_ndis_wlan_bssid_ex_sz() to r8712_get_wlan_bssid_ex_sz(),
which corresponds to the struct whose size it measures.

Signed-off-by: Joshua Clayton <stillcompiling@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:14:03 -07:00
Joshua Clayton 44367877c6 staging: rtl8712: remove duplicate struct
struct ndis_wlan_bssid_ex is a doppelganger of struct wlan_bssid_ex,
and is used about a third as often.

Switch all instances to wlan_bssid_ex, and remove ndis_wlan_bssid_ex

This also gets rid of a use of typedef NDIS_802_11_RATES_EX

Signed-off-by: Joshua Clayton <stillcompiling@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:14:03 -07:00
Joshua Clayton ebe92393ca staging: rtl8712: removed unused wrapper structs
Remove wrapper structs that just wrap struct ndis_wlan_bssid_ex,
and are unused.

Signed-off-by: Joshua Clayton <stillcompiling@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:14:03 -07:00
Joshua Clayton 9bdb70ecdd staging: rtl8712: fix comment
The old comment refers to a typedef name which is being removed,
and to a style of calculation which is no longer being used.
It falsely states that IELength is variable length, instead of IEs.

Change comment to simply state that the IEs field is a buffer of
variable size and that IELength refers to the current size.

Signed-off-by: Joshua Clayton <stillcompiling@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:14:03 -07:00
Joshua Clayton 881edf67b2 staging: rtl8712: simplify size calculation
replace item-by-item  size calculation of a struct
with the size of the struct.

This gets rid of a use of typedef NDIS_802_11_RATES_EX

Signed-off-by: Joshua Clayton <stillcompiling@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:14:03 -07:00
Joshua Clayton 5dab10f444 staging: rtl8712: fix buggy size calculation
r8712_get_ndis_wlan_bssid_ex_sz has a "6 * sizeof(unsigned long)"
where the underlying struct has a 6 * unsigned char.
Simplify the calculation by just subtracting the variable part from
the size of the struct.

This also gets rid of a use of typedef NDIS_802_11_RATES_EX

Signed-off-by: Joshua Clayton <stillcompiling@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:12:40 -07:00
Ravi Teja Darbha 5eafbb0c52 rtl8712:Fix checkpatch warning
Fix line over 80 characters warning.

Signed-off-by: Ravi Teja Darbha <ravi2j@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 19:54:37 -07:00
Sunil Shahu a732152c76 staging: rtl8712: rtl871x_security.c: remove unnecessary variable initialization
Variable "u32 c" always re-initialize in for loop.
Initialized value of "u32 c" is not used in function
and is redundant, hence removed.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sunil Shahu <shshahu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 19:54:37 -07:00
Sunil Shahu 8027b33321 drivers: staging: rtl8712: remove unnecessary else statement
"else" statement after "if" is unnecessary, hence removed.

Signed-off-by: Sunil Shahu <shshahu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 19:54:37 -07:00
Dogukan Ergun 07e9e619db staging: rtl8712: fix else after break or return warning
This patch fixes checkpatch.pl warning.
WARNING: else is not generally useful after a break or return

Signed-off-by: Dogukan Ergun <dogukan.ergun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13 14:45:51 -07:00
Fabian Frederick 8781d5b349 staging: rtl8712: use swap() in dequeue_xframe_ex()
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:19:47 -07:00
Prasanna Karthik 05871f994e staging:rtl8712:Fix compressed return statement
Fix reported by coccinelle compressing last two lines with single return
call

Signed-off-by: Prasanna Karthik <mkarthi3@visteon.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:38:56 -07:00
Hari Prasath Gujulan Elango 7eea766ad7 staging: rtl8712: fix indentation issue
Fixed indentation issue in few lines

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:33:40 -07:00
Luca Ceresoli 73b4276365 staging: rtl8712: 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 <greg@kroah.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:49:58 +09:00
Luca Ceresoli a0825db8d1 staging: rtl8712: remove unneeded forward declaration
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Greg Kroah-Hartman <greg@kroah.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:49:57 +09:00
Luca Ceresoli 2ede90f996 staging: rtl8712: remove useless comment
"step 2" does mean much as there is no "step 1" stated anywhere...

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Greg Kroah-Hartman <greg@kroah.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:49:57 +09:00
Haggai Eran cab462140f staging: rtl8712: prevent buffer overrun in recvbuf2recvframe
With an RTL8191SU USB adaptor, sometimes the hints for a fragmented
packet are set, but the packet length is too large. Allocate enough
space to prevent memory corruption and a resulting kernel panic [1].

[1] http://www.spinics.net/lists/linux-wireless/msg136546.html

Cc: <stable@vger.kernel.org>
Signed-off-by: Haggai Eran <haggai.eran@gmail.com>
ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:49:57 +09:00
Sudip Mukherjee a1471eb9da staging: rtl8712: fix stack dump
del_timer_sync() is not to be called in the interrupt context unless
the timer is irqsafe. but most of the functions where commits
6501c8e7d8 and 382d020f44 touched were called in interrupt
context. And as a result the WARN_ON was getting triggered. Changed
to del_timer() in places which were called from interrupt.

Fixes: 382d020f44 ("Staging: rtl8712: Eliminate use of _cancel_timer"
Fixes: 6501c8e7d8 ("Staging: rtl8712: Eliminate use of _cancel_timer_ex")
Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=97711
Reported-by: Arek Rusniak <arek.rusi@gmail.com>
Tested-by: Arek Rusniak <arek.rusi@gmail.com>
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:49:57 +09:00
Jagan Teki 71d667b800 staging: rtl8712: Use ether_addr_copy() instead of memcpy()
Fixes Warning encounter this by applying checkpatch.pl against this file:
Prefer ether_addr_copy() over memcpy() if the Ethernet addresses
are __aligned(2)

pahole output for respective structures:
- addr->sa_data
struct sockaddr {
	sa_family_t                sa_family;            /*     0     2 */
	char                       sa_data[14];          /*     2    14 */

	/* size: 16, cachelines: 1, members: 2 */
	/* last cacheline: 16 bytes */
};

- pnetdev->dev_addr
dev_addr is interface address infor from generic net_device structure
which is properly aligned and have some patches with this change as well.
"staging: rtl8712: fix Prefer ether_addr_copy() over memcpy()"
(sha1: 36e4d8826b)

Signed-off-by: Jagan Teki <jteki@openedev.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:47:56 +09:00
Greg Kroah-Hartman 936a0cd52a Merge 4.1-rc4 into staging-next
We want the fixes in here for testing and merge issues.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-18 13:52:44 -07:00
Paul Gortmaker f9c40f143c rtl8712: 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.

It seems that ieee80211 was already included everywhere it was needed,
since no explicit include <...> were needed to be added in order to
preserve getting a successful compile.

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
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
Dan Carpenter b5eed730bd staging: rtl8712: freeing an ERR_PTR
If memdup_user() fails then "pparmbuf" is an error pointer and we can't
pass it to kfree().  I changed the "goto _r871x_mp_ioctl_hdl_exit" to a
direct return.

I changed the earlier goto to a direct return as well for consistency
and removed the "pparmbuf = NULL" initializer since it's no longer
needed.

Fixes: 45de432775 ('Staging: rtl8712: Use memdup_user() instead of copy_from_user()')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 01:58:04 +02:00
Julia Lawall 8f47c28b5a staging: rtl8712: Drop unneeded cast on netdev_priv
The result of netdev_priv is already implicitly cast to the type of the
left side of the assignment.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
type T;
T *x;
@@

x =
- (T *)
  netdev_priv(...)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:15:40 +02:00
Amitoj Kaur Chawla 5c7d08c32d Staging: rtl8712: Remove zero-testing pointer typed value
Removes variable comparison with 0 by using !. Done using following
coccinelle script.

@ disable is_zero,isnt_zero @
expression *E;
expression E1,f;
@@

E = f(...)
<...
(
- E == 0
+ !E
|
- E != 0
+ E
|
- 0 == E
+ !E
|
- 0 != E
+ E
)
...>
?E = E1

@ disable is_zero,isnt_zero @
expression *E;
@@

(
  E ==
- 0
+ NULL
|
  E !=
- 0
+ NULL
|
- 0
+ NULL
  == E
|
- 0
+ NULL
  != E
)

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-01 17:26:58 +02:00
Cristina Opriceana b6955a8f43 Staging: rtl8712: Remove duplicated argument to |
Delete duplicated argument to | for the state argument in
the _clr_fwstate_() function call as it is redundant.
Detected with coccinelle.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-01 17:26:58 +02:00
Cristina Opriceana 45de432775 Staging: rtl8712: Use memdup_user() instead of copy_from_user()
Use memdup_user() to avoid its duplicated implementation and simplify
code. memdup_user() uses GFP_KERNEL instead of GFP_ATOMIC,
which is valid because copy_from_user() might sleep and it's useless
to make the allocation atomic. Found with coccinelle.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-01 17:26:58 +02:00
Haneen Mohammed e0e982b436 Staging: rtl8712: replace memcpy with ether_addr_copy
This patch replace memcpy with ethe_addr_copy to address the following
warning generated by checkpatch.pl: ""Prefer ether_addr_copy over memcpy
if the Ethernet addresses are __aligned(2)"

Follwoing is the output of pahole for the relevant datastructures:
1- for  "iwe.u.ap_addr.sa_data" and "wrqu->ap_addr.sa_data"

struct sockaddr {
        sa_family_t                sa_family;            /*     0     2 */
        char                       sa_data[14];          /*     2    14 */

        /* size: 16, cachelines: 1, members: 2 */
        /* last cacheline: 16 bytes */
};

struct iw_event {
        __u16                      len;                  /*     0     2 */
        __u16                      cmd;                  /*     2     2 */

        /* XXX 4 bytes hole, try to pack */

        union iwreq_data           u;                    /*     8    16 */

        /* size: 24, cachelines: 1, members: 3 */
        /* sum members: 20, holes: 1, sum holes: 4 */
        /* last cacheline: 24 bytes */
};

2- for  "pnetwork->network.MacAddress" and "pcur_bss->MacAddress"

struct wlan_network {
        struct list_head           list;                 /*     0    16 */
        int                        network_type;         /*    16     4 */
        int                        fixed;                /*    20     4 */
        unsigned int               last_scanned;         /*    24     4 */
        int                        aid;                  /*    28     4 */
        int                        join_res;             /*    32     4 */
        struct ndis_wlan_bssid_ex  network;              /*    36   884 */
        /* --- cacheline 14 boundary (896 bytes) was 24 bytes ago ---   */

        /* size: 920, cachelines: 15, members: 7 */
        /* last cacheline: 24 bytes */
};

struct ndis_wlan_bssid_ex {
        u32                        Length;               /*     0     4 */
        unsigned char              MacAddress[6];        /*     4     6 */
        u8                         Reserved[2];          /*    10     2 */
        struct ndis_802_11_ssid    Ssid;                 /*    12    36 */
        u32                        Privacy;              /*    48     4 */
        s32                        Rssi;                 /*    52     4 */
        enum NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;  /*    56     4 */
        struct NDIS_802_11_CONFIGURATION Configuration;  /*    60    32 */
        /* --- cacheline 1 boundary (64 bytes) was 28 bytes ago --- */
        enum NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode; /* 92     4 */
        NDIS_802_11_RATES_EX       SupportedRates;       /*    96    16 */
        u32                        IELength;             /*   112     4 */
        u8                         IEs[768];             /*   116   768 */
        /* --- cacheline 13 boundary (832 bytes) was 52 bytes ago --- */

        /* size: 884, cachelines: 14, members: 12 */
        /* last cacheline: 52 bytes */
};

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-18 10:32:39 +01:00
Dilek Uzulmez 58662d9f1e Staging: rtl8712: Replace __constant_cpu_to_le16
This fixes the following checkpatch.pl warning:
WARNING: __constant_cpu_to_le16 should be cpu_to_le16

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:48:20 +01:00
Matteo Semenzato 66faa441a6 Staging: rtl8712: fix potential null pointer dereference
Check if kmalloc succeded before using the pointer in memcpy.

Signed-off-by: Matteo Semenzato <mattew8898@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:48:20 +01:00
Haneen Mohammed 819ef63815 Staging: rtl8712: remove else after return statement
else after return generally is not useful. This patch removes else after return
statement. Issue addressed by checkpatch.pl.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:48:20 +01:00
Vaishali Thakkar 382d020f44 Staging: rtl8712: Eliminate use of _cancel_timer
Use timer API function del_timer_sync instead of driver
specific function _cancel_timer as besides deactivating
a timer, it also ensures that the timer is stopped on all
CPUs before the driver exists. Also, variables
timer_cancelled and bool are removed as they are no longer
needed.

@a@
expression x;
identifier y;
@@

- _cancel_timer (&x, &y);
+ del_timer_sync (&x);

@@type T; identifier a.y;@@

- T y;
...when != y

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:46:07 +01:00
Vaishali Thakkar 6501c8e7d8 Staging: rtl8712: Eliminate use of _cancel_timer_ex
Use timer API function del_timer_sync instead of driver
specific function _cancel_timer_ex as besides deactivating
a timer, it ensures that the timer is stopped on all
CPUs before the driver exists. Also, definition of function
_cancel_timer_ex is removed as it is no longer needed after
this change.

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

@@ expression x; @@

- _cancel_timer_ex (&x);
+ del_timer_sync (&x);

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:46:07 +01:00
Vatika Harlalka 8d0514d563 Staging rtl8172: Remove unnecessary typecast
Using addressof and then casting to the original type is unneeded.
So these casts can be removed.
Issue detected via Coccinelle script.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09 13:37:22 +01:00
Tina Johnson 69e2b47fa0 drivers: staging: rtl8712: 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
Aya Mahfouz 22905b8594 staging: rtl8712: 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 defines 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 2597864233 staging: rtl8712: remove extra parentheses around right bit shift operation
Removes extra parentheses around bitwise right shift operation.
The cases handled are  when the resultant value is assigned to
a variable or when a shift operation is carried out for a function
argument. The issues were 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:43 -08:00
Vaishali Thakkar e922df7d3e Staging: rtl8712: 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 setup and set the timer.
To be compatible with the change, argument types of
referenced functions are changed. Also, definition of
function _init_timer is removed as it is no longer needed
after this change.

This is done 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-06 09:54:34 -08:00
Vaishali Thakkar 4eef520d24 Staging: rtl8712: Use del_timer
Use timer API function del_timer instead of driver
specific function _cancel_timer_ex as it is a standard
way for deactivating a timer.

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

@@ expression x; @@
- _cancel_timer_ex (&x);
+ del_timer (&x);

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 17:07:05 -08:00
Vaishali Thakkar c703c750cc Staging: rtl8712: 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-01 17:02:11 -08:00
Aya Mahfouz ae52e527c9 staging: rtl8712: 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:23:47 -08:00
Aya Mahfouz 5c7c5d800e staging: rtl8712: 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:23:47 -08:00
Aya Mahfouz bc5b749a46 staging: rtl8712: 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:23:47 -08:00
Aya Mahfouz cb329d837d staging: rtl8712: 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:23:47 -08:00
Vaishali Thakkar 875b7dec47 Staging: rtl8712: Use mod_timer
This patch introduces the use of API function mod_timer
instead of driver specific function as it is a more
efficient and standard way to update the expire field of
an active timer.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 15:11:22 -08:00
Katie Dunne a6c6e29817 Staging: rtl8712: Remove unused macros
Removes several macro definitions that are unused
Patch 2 will remove the same definitions in rtl8188eu/include/wifi.h

Signed-off-by: Katie Dunne <kdunne@mail.ccsf.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 15:11:22 -08:00
Melike Yurtoglu d55519ab9b Staging: rtl8712: replace memcpy() by ether_addr_copy() using coccinelle and pack variable
This patch focuses on fixing the following warning generated
by checkpatch.pl for the file rtl871x_cmd.c

Prefer ether_addr_copy() over memcpy() if the Ethernet addresses
are __aligned(2)

@@ expression e1, e2; @@

- memcpy(e1, e2, ETH_ALEN);
+ ether_addr_copy(e1, e2);

struct _adapter {
        struct dvobj_priv          dvobjpriv;            /*     0    40*/
        struct mlme_priv           mlmepriv;             /*    40  1560*/
        /* --- cacheline 25 boundary (1600 bytes) --- */
        struct cmd_priv            cmdpriv;              /*  1600   136*/
        /* --- cacheline 27 boundary (1728 bytes) was 8 bytes ago --- */
        struct evt_priv            evtpriv;              /*  1736    96*/
        /* --- cacheline 28 boundary (1792 bytes) was 40 bytes ago --- * */
        struct io_queue *          pio_queue;            /*  1832     8*/
        struct xmit_priv           xmitpriv;             /*  1840   912*/
        /* --- cacheline 43 boundary (2752 bytes) --- */
        struct recv_priv           recvpriv;             /*  2752  1088*/
        /* --- cacheline 60 boundary (3840 bytes) --- */
        struct sta_priv            stapriv;              /*  3840   672*/
        /* --- cacheline 70 boundary (4480 bytes) was 32 bytes ago --- * */
        struct security_priv       securitypriv;         /*  4512  4816*/
        /* --- cacheline 145 boundary (9280 bytes) was 48 bytes ago --- * */
        struct registry_priv       registrypriv;         /*  9328   968*/
        /* --- cacheline 160 boundary (10240 bytes) was 56 bytes ago --- * */
        struct wlan_acl_pool       acl_list;             /* 10296  1536*/
        /* --- cacheline 184 boundary (11776 bytes) was 56 bytes ago --- * */
        struct pwrctrl_priv        pwrctrlpriv;          /* 11832   224*/
        /* --- cacheline 188 boundary (12032 bytes) was 24 bytes ago --- * */
        struct eeprom_priv         eeprompriv;           /* 12056   508*/

        /* XXX 4 bytes hole, try to pack */

        /* --- cacheline 196 boundary (12544 bytes) was 24 bytes ago --- * */
        struct hal_priv            halpriv;              /* 12568    88*/
        /* --- cacheline 197 boundary (12608 bytes) was 48 bytes ago --- * */
        struct led_priv            ledpriv;              /* 12656   304*/
        /* --- cacheline 202 boundary (12928 bytes) was 32 bytes ago --- * */
        struct mp_priv             mppriv;               /* 12960  1080*/
	 /* --- cacheline 219 boundary (14016 bytes) was 24 bytes ago * --- */
        s32                        bDriverStopped;       /* 14040     4*/
        s32                        bSurpriseRemoved;     /* 14044     4*/
        u32                        IsrContent;           /* 14048     4*/
        u32                        ImrContent;           /* 14052     4*/
        u8                         EepromAddressSize;    /* 14056     1*/
        u8                         hw_init_completed;    /* 14057     1*/

        /* XXX 6 bytes hole, try to pack */

        struct task_struct *       cmdThread;            /* 14064     8*/
        pid_t                      evtThread;            /* 14072     4*/

        /* XXX 4 bytes hole, try to pack */

        /* --- cacheline 220 boundary (14080 bytes) --- */
        struct task_struct *       xmitThread;           /* 14080     8*/
        pid_t                      recvThread;           /* 14088     4*/

        /* XXX 4 bytes hole, try to pack */

        uint                       (*dvobj_init)(struct _adapter *); /*14096     8 */
        void                       (*dvobj_deinit)(struct _adapter *);/* 14104     8 */
        struct net_device *        pnetdev;              /* 14112     8*/
        int                        bup;                  /* 14120     4*/

        /* XXX 4 bytes hole, try to pack */

        struct net_device_stats    stats;                /* 14128   184*/
        /* --- cacheline 223 boundary (14272 bytes) was 40 bytes ago --- * */
	 struct iw_statistics       iwstats;              /* 14312    32*/
        /* --- cacheline 224 boundary (14336 bytes) was 8 bytes ago --- * */
        int                        pid;                  /* 14344     4*/

        /* XXX 4 bytes hole, try to pack */

        struct work_struct         wkFilterRxFF0;        /* 14352    32*/
        u8                         blnEnableRxFF0Filter; /* 14384     1*/

        /* XXX 3 bytes hole, try to pack */

        spinlock_t                 lockRxFF0Filter;      /* 14388     4*/
        const struct firmware  *   fw;                   /* 14392     8*/
        /* --- cacheline 225 boundary (14400 bytes) --- */
        struct usb_interface *     pusb_intf;            /* 14400     8*/
        struct mutex               mutex_start;          /* 14408    40*/

        /* XXX last struct has 4 bytes of padding */

        struct completion          rtl8712_fw_ready;     /* 14448    32*/
        /* --- cacheline 226 boundary (14464 bytes) was 16 bytes ago --- * */

        /* size: 14480, cachelines: 227, members: 40 */
        /* sum members: 14451, holes: 7, sum holes: 29 */
        /* paddings: 1, sum paddings: 4 */
        /* last cacheline: 16 bytes */
};

Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 15:08:36 -08:00
Melike Yurtoglu c7c42826f9 Staging: rtl8712: replace memcpy() by ether_addr_copy() using coccinelle and pack variable
This patch focuses on fixing the following warning generated
by checkpatch.pl for the file rxtx.c

Prefer ether_addr_copy() over memcpy() if the Ethernet addresses
are __aligned(2)

@@ expression e1, e2; @@

- memcpy(e1, e2, ETH_ALEN);
+ ether_addr_copy(e1, e2);

struct _adapter {
        struct dvobj_priv          dvobjpriv;            /*     0    40*/
        struct mlme_priv           mlmepriv;             /*    40  1560*/
        /* --- cacheline 25 boundary (1600 bytes) --- */
        struct cmd_priv            cmdpriv;              /*  1600   136*/
        /* --- cacheline 27 boundary (1728 bytes) was 8 bytes ago --- */
        struct evt_priv            evtpriv;              /*  1736    96*/
        /* --- cacheline 28 boundary (1792 bytes) was 40 bytes ago --- * */
        struct io_queue *          pio_queue;            /*  1832     8*/
        struct xmit_priv           xmitpriv;             /*  1840   912*/
        /* --- cacheline 43 boundary (2752 bytes) --- */
        struct recv_priv           recvpriv;             /*  2752  1088*/
        /* --- cacheline 60 boundary (3840 bytes) --- */
        struct sta_priv            stapriv;              /*  3840   672*/
        /* --- cacheline 70 boundary (4480 bytes) was 32 bytes ago --- * */
        struct security_priv       securitypriv;         /*  4512  4816*/
        /* --- cacheline 145 boundary (9280 bytes) was 48 bytes ago --- * */
        struct registry_priv       registrypriv;         /*  9328   968*/
        /* --- cacheline 160 boundary (10240 bytes) was 56 bytes ago --- * */
        struct wlan_acl_pool       acl_list;             /* 10296  1536*/
        /* --- cacheline 184 boundary (11776 bytes) was 56 bytes ago --- * */
        struct pwrctrl_priv        pwrctrlpriv;          /* 11832   224*/
        /* --- cacheline 188 boundary (12032 bytes) was 24 bytes ago --- * */
        struct eeprom_priv         eeprompriv;           /* 12056   508*/

        /* XXX 4 bytes hole, try to pack */

        /* --- cacheline 196 boundary (12544 bytes) was 24 bytes ago --- * */
        struct hal_priv            halpriv;              /* 12568    88*/
        /* --- cacheline 197 boundary (12608 bytes) was 48 bytes ago --- * */
        struct led_priv            ledpriv;              /* 12656   304*/
        /* --- cacheline 202 boundary (12928 bytes) was 32 bytes ago --- * */
        struct mp_priv             mppriv;               /* 12960  1080*/
        /* --- cacheline 219 boundary (14016 bytes) was 24 bytes ago --- * */
        s32                        bDriverStopped;       /* 14040     4*/
        s32                        bSurpriseRemoved;     /* 14044     4*/
        u32                        IsrContent;           /* 14048     4*/
        u32                        ImrContent;           /* 14052     4*/
	 u8                         EepromAddressSize;    /* 14056     1*/
        u8                         hw_init_completed;    /* 14057     1*/

        /* XXX 6 bytes hole, try to pack */

        struct task_struct *       cmdThread;            /* 14064     8*/
        pid_t                      evtThread;            /* 14072     4*/

        /* XXX 4 bytes hole, try to pack */

        /* --- cacheline 220 boundary (14080 bytes) --- */
        struct task_struct *       xmitThread;           /* 14080     8*/
        pid_t                      recvThread;           /* 14088     4*/

        /* XXX 4 bytes hole, try to pack */

        uint                       (*dvobj_init)(struct _adapter *); /*14096     8 */
        void                       (*dvobj_deinit)(struct _adapter *);/* 14104     8 */
        struct net_device *        pnetdev;              /* 14112     8*/
        int                        bup;                  /* 14120     4*/

        /* XXX 4 bytes hole, try to pack */

        struct net_device_stats    stats;                /* 14128   184*/
        /* --- cacheline 223 boundary (14272 bytes) was 40 bytes ago --- * */
        struct iw_statistics       iwstats;              /* 14312    32*/
        /* --- cacheline 224 boundary (14336 bytes) was 8 bytes ago --- * */
        int                        pid;                  /* 14344     4*/

        /* XXX 4 bytes hole, try to pack */

        struct work_struct         wkFilterRxFF0;        /* 14352    32*/
        u8                         blnEnableRxFF0Filter; /* 14384     1*/

        /* XXX 3 bytes hole, try to pack */

        spinlock_t                 lockRxFF0Filter;      /* 14388     4*/
        const struct firmware  *   fw;                   /* 14392     8*/
	 u8                         EepromAddressSize;    /* 14056     1*/
        u8                         hw_init_completed;    /* 14057     1*/

        /* XXX 6 bytes hole, try to pack */

        struct task_struct *       cmdThread;            /* 14064     8*/
        pid_t                      evtThread;            /* 14072     4*/

        /* XXX 4 bytes hole, try to pack */

        /* --- cacheline 220 boundary (14080 bytes) --- */
        struct task_struct *       xmitThread;           /* 14080     8*/
        pid_t                      recvThread;           /* 14088     4*/

        /* XXX 4 bytes hole, try to pack */

        uint                       (*dvobj_init)(struct _adapter *); /*14096     8 */
        void                       (*dvobj_deinit)(struct _adapter *);/* 14104     8 */
        struct net_device *        pnetdev;              /* 14112     8*/
        int                        bup;                  /* 14120     4*/

        /* XXX 4 bytes hole, try to pack */

        struct net_device_stats    stats;                /* 14128   184*/
        /* --- cacheline 223 boundary (14272 bytes) was 40 bytes ago --- * */
        struct iw_statistics       iwstats;              /* 14312    32*/
        /* --- cacheline 224 boundary (14336 bytes) was 8 bytes ago --- * */
        int                        pid;                  /* 14344     4*/

        /* XXX 4 bytes hole, try to pack */

        struct work_struct         wkFilterRxFF0;        /* 14352    32*/
        u8                         blnEnableRxFF0Filter; /* 14384     1*/

        /* XXX 3 bytes hole, try to pack */

        spinlock_t                 lockRxFF0Filter;      /* 14388     4*/
        const struct firmware  *   fw;                   /* 14392     8*/
	/* --- cacheline 225 boundary (14400 bytes) --- */
        struct usb_interface *     pusb_intf;            /* 14400     8*/
        struct mutex               mutex_start;          /* 14408    40*/

        /* XXX last struct has 4 bytes of padding */

        struct completion          rtl8712_fw_ready;     /* 14448    32*/
        /* --- cacheline 226 boundary (14464 bytes) was 16 bytes ago --- * */

        /* size: 14480, cachelines: 227, members: 40 */
        /* sum members: 14451, holes: 7, sum holes: 29 */
        /* paddings: 1, sum paddings: 4 */
        /* last cacheline: 16 bytes */
};

Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 15:08:36 -08:00
Gamze POLAT da07768909 staing: rtl8712: else after return or break warning
This patch fixes checkpatch.pl warning.
WARNING: else is not generally useful after a break or return

Signed-off-by: Gamze POLAT <gamzepolat94@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 15:08:36 -08:00
Michael Hornung 21fa7be013 staging: rtl8712: Do coding style cleanup
* Fix checkpatch.pl warnings "Fix missing space after return type warning".

Signed-off-by: Michael Hornung <mhornung.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07 17:39:50 +08:00
Nicholas Mc Guire 1ba2c5a808 staging: rtl8712: condition with no effect removed
The check for return of schedule_timeout() has no effect on the
effective control flow of sleep_schedulable() so it can be dropped.

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07 17:24:59 +08:00
Nicholas Mc Guire 7dfb6d2ec4 staging: rtl8712: cleanup of timeout conversions
This is only an API consolidation to make things more readable.
Instances of  var * HZ / 1000  are replaced by  msecs_to_jiffies(var).
As msecs_to_jiffies will return > 0 if it is passed a value > 0 the
== 0 check is not needed.

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07 17:24:11 +08:00
Heba Aamer 36e4d8826b staging: rtl8712: fix Prefer ether_addr_copy() over memcpy()
This patch fixes the following checkpatch.pl warning:
Prefer ether_addr_copy() over memcpy()
if the Ethernet addresses are __aligned(2)

pahole showed that the struct used pnetdev->dev_addr
is aligned to u16.

Moreover mac is a simple array, pdata is a pointer that
starts from an even offset.

Signed-off-by: Heba Aamer <heba93aamer@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07 17:15:43 +08:00
Heba Aamer 1007c69226 staging: rtl8712: remove useless printing line
This patch removes an unneeded call to printk.

Signed-off-by: Heba Aamer <heba93aamer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-28 10:56:49 -08:00
Sudip Mukherjee 7046808627 staging: rtl8712: remove unused function
mp_query_drv_var() was only being used by
oid_rt_pro_query_dr_variable_hdl() but after commit
<f4f5a59ff2e746885be3c1c06c1d0e8861a10ce8> mp_query_drv_var() became
unused. so it is safe to remove it.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:19 +08:00
Rickard Strandqvist b086d02b44 staging: rtl8712: recv_linux: Remove unused function
Remove the function r8712_os_read_port() 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-25 19:59:18 +08:00
Max Perepelitsyn 0636b4603f staging: rtl8712: remove spaces before commas
checkpatch.pl fix for
ERROR: space prohibited before that ',' (ctx:WxE)

Signed-off-by: Max Perepelitsyn <mperepelitsyn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:20:25 -08:00
Rickard Strandqvist f4f5a59ff2 staging: rtl8712: rtl871x_mp_ioctl.c: Remove some unused functions
Removes some functions that are not used anywhere:
oid_rt_pro_h2c_get_rate_table_hdl() oid_rt_pro_h2c_set_rate_table_hdl()
oid_rt_pro_set_pwrstate_hdl() oid_rt_pro_qry_pwrstate_hdl()
oid_rt_pro_set_basic_rate_hdl() oid_rt_pro_set_power_tracking_hdl()
oid_rt_pro_set_data_rate_ex_hdl() oid_rt_pro_cfg_debug_message_hdl()
oid_rt_poll_rx_status_hdl() oid_rt_pro_set_rf_intfs_hdl()
oid_rt_wr_attrib_mem_hdl() oid_rt_rd_attrib_mem_hdl()
oid_rt_pro8711_pkt_loss_hdl() oid_rt_pro8711_wi_poll_hdl()
oid_rt_pro_write16_eeprom_hdl() oid_rt_pro_read16_eeprom_hdl()
oid_rt_pro_write_txcmd_hdl() oid_rt_pro_burst_write_register_hdl()
oid_rt_pro_burst_read_register_hdl() oid_rt_pro8711_join_bss_hdl()
oid_rt_pro_set_pkt_test_mode_hdl() oid_rt_pro_set_tx_agc_offset_hdl()
oid_rt_set_crystal_cap_hdl() oid_rt_pro_rw_efuse_pgpkt_hdl()
oid_rt_pro_rx_packet_type_hdl() oid_rt_pro_query_dr_variable_hdl()
oid_rt_pro_dele_sta_info_hdl() oid_rt_pro_add_sta_info_hdl()
oid_rt_pro_encryption_ctrl_hdl()

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
Paul Hedman 3002b1a601 Staging: rtl8712: Fixes brace coding style in rtl871x_sta_mgt.c
This patch fixes a brace warning in rtl871x_sta_mgt.c found
by the checkpatch.pl tool.

Signed-off-by: Paul Hedman <paul@mybb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-12 19:54:17 -08:00
Mike Krinkin 68de8d6734 staging: rtl8712: remove unnecessary else after return
Fixes checkpatch warning:
WARNING: else is not generally useful after a break or return

Signed-off-by: Mike Krinkin <krinkin.m.u@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02 16:54:43 -08:00
Sudip Mukherjee e29d3ebcda staging: rtl8712: remove unused variables
unused variables are removed. These variables were only assigned some
values and after that they were never being used. So they are safe to
be removed , and it has been build tested.

I left a call to r8712_read32(padapter, TCR) and
r8712_read8(padapter, SDIO_HCPWM) .

r8712_read32() and r8712_read8() is ultimately calling usb_read32()
and usb_read8() respectively. and they are again calling
r8712_usbctrl_vendorreq().
this r8712_usbctrl_vendorreq() is communicating through the usb bus
and is sending and receiving the control msg.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 17:37:26 +08:00
Rasmus Villemoes eecc515a1b staging: rtl8712: Remove redundant cast
struct firmware::data has type const u8*, as does *ppmappedfw, so the
cast to u8* is unnecessary and slightly confusing.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 17:32:41 +08:00
Esra Altintas 3ad96c140d staging: rtl8712: Fix unnecessary parentheses style warning in rtl871x_xmit.c
This fixes the following checkpatch.pl warning:
WARNING: Unnecessary parentheses - maybe == should be = ?

Signed-off-by: Esra Altintas <es.altintas@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:28 +08:00
Serguey Parkhomovsky a15522c0a4 staging: rtl8712: fix unnecessary elses after return/break in rtl8712_efuse.c
This patch fixes two unnecessary else conditions that were found by checkpatch.pl.

Signed-off-by: Serguey Parkhomovsky <sergueyparkhomovsky@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:26 +08:00
Nitin Kuppelur e92c3511b9 Staging: rtl8712:ieee80211 remove unnecessary else
Removed unnecessary else after return/break to solve
checkpatch.pl warning

Signed-off-by: Nitin Kuppelur <nitinkuppelur@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:26 +08:00
Tapasweni Pathak 646da830fd staging: rtl8712: Remove unnecessary cast for argument of kfree
This patch removes all occurrences of unnecessary cast on the
argument to kfree, all over in rtl8712.

There is no need of the cast on the argument to kfree.

Greped to find occurrences.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:19 +08:00
Tapasweni Pathak 366ba42703 staging: rtl8712: Delete explicit comparison with false and NULL
This patch delete explicit comparison to false and NULL in files of
rtl8712.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:11 +08:00
Sarah Khan 14ad732c2d staging: rtl8712: Fixed else not required after return
WARNING: else is generally not required after return
checkpatch.pl warning in osdep_service.h

Signed-off-by: Sarah Khan <sarahjmi07@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:11 +08:00
Tapasweni Pathak f44b902adf staging: rtl8712: 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:11 +08:00
Sarah Khan bc394a39cb staging: rtl8712: Fixed else not required after return
WARNING: Else generally not required after return
checkpatch.pl warning in hal_init.c
Fixed by removing else

Signed-off-by: Sarah Khan <sarahjmi07@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 11:59:40 -07:00
Melike Yurtoglu 4eaef85670 staging: rtl8712: Fix missing blank line warning
Fixes "Missing a blank line after declarations" checkpatch.pl warning in
usb_ops_linux.c

Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 11:59:40 -07:00
Yeliz Taneroglu 12636551a2 staging: rtl8712: Fix unnecessary parentheses style warning
This fixes the following checkpatch.pl warning:

drivers/staging/rtl8712/rtl871x_recv.c:634 warning: Unnecessary parentheses - maybe == should be = ?

Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 10:15:12 -07:00
Tapasweni Pathak 02a29d2d92 staging: rtl8712: add new line after declarations
This patch fixes checkpatch.pl warning in hal_init.c file
WARNING : Missing a blank line after declarations

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 22:41:23 -04:00
Sarah Khan 6a7cbc38ad staging: rtl8712: fixed missing blank line
WARNING : Missing a blank line after declaration
checkpatch.pl warning in hal_init.c

Signed-off-by: Sarah Khan <sarahjmi07@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 20:33:23 -07:00
Tapasweni Pathak ddcb81e741 staging: rtl8712: merge lines and remove unused variable for immediate return
This patch merge two lines in a single line if immediate return is found.
Unused variables in each case were removed manually as they are no longer
needed.

This is done using Coccinelle. Semantic patch used for this is as
follows :
@@
expression ret;
identifier f;
@@

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

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 08:14:37 -07:00
Tapasweni Pathak a988265c61 Staging: rtl8712: Add space after return type
This patch fixes checkpatch.pl warning in file rtl871x_ioctl.h
WARNING : Missing space after return type

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 08:14:36 -07:00
Tapasweni Pathak c08242008a Staging: rtl8712: Remove unnecessary parentheses
This patch fixes checkpatch.pl warning in files of rel8712
WARNING : Unnecessary parentheses - maybe == should be = ?

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 08:14:36 -07:00
Tapasweni Pathak 57b6686ebb Staging: rtl8712 : Fix line over 80 characters
This patch fixes checkpatch.pl warning in files of rtl8712
WARNING : line over 80 characters

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 08:14:36 -07:00
Tapasweni Pathak 9d76a7e4dc Staging: rtl8712: use kmalloc_array over kmalloc
This patch fixes checkpatch.pl warning in file rtl871x_xmit.c
WARNING : prefer kmalloc_array over kmalloc with multiply

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 08:11:56 -07:00
Tapasweni Pathak 15a4db9268 Staging: rtl8712: remove unnecessary 'out of memory' message
This patch fixes checkpatch.pl warning in file usb_ops_linux.c
WARNING : possible unecessary 'out of memory' message

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 08:08:58 -07:00
Tapasweni Pathak b105374c51 Staging: rtl8712: fixed space prohibition
This patch fixes checkpatch.pl warning in file rtl871x_io.h
WARNING : space prohibited before semicolon

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 08:08:58 -07:00
Tapasweni Pathak fbdba9c10b Staging: rtl8712: remove void function return; statement
This patch fixes checkpatch.pl warning in files of rtl8712
WARNING : void function return statement are not generally useful

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 08:04:57 -07:00
Tapasweni Pathak a2955b144b Staging: rtl8712: remove semicolon after macro
This patch fixes checkpatch.pl warning in rtl871x_mp.h file
WARNING : Macro should not use a trailing semicolon

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 08:04:57 -07:00
Aybuke Ozdemir c5861b738a Staging: rtl8712: Missing a blank line after declarations
This patch fixes these warning messages found by checkpatch.pl:
WARNING : Missing a blank line after declarations.

Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 08:02:31 -07:00