Commit graph

6 commits

Author SHA1 Message Date
Rasmus Villemoes 57fc3b7c4d staging: rtl8821ae: Pass large struct by const reference
struct rtl_stats is rather huge (152 bytes), and since
rtl8812ae_rx_command_packet_handler() does not modify it, it might as
well be passed by const reference.

Reported by Coverity: CID 1167285

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-08 16:51:48 -07:00
Anders Darander 4ada11147e staging/rtl8821ae: fix sparse address space warning
Change the definition of pci_mem_start|end from correct from pci_io(un)map's
point of view.

Signed-off-by: Anders Darander <anders.darander@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25 16:02:01 -07:00
Masanari Iida da4d20162c staging: rtl8821ae: Fix typo in comment and printk in rtl8821ae
Fix spelling typo in comment and printk within rtl8821ae.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-27 12:44:26 -08:00
Surendra Patil 8f1e98a329 drivers:staging:rtl8821ae: Fixed few coding style erors and warnings
Fixed multiple coding style errors and warnings
wifi.h:1077: WARNING: please, no space before tabs
wifi.h:762: WARNING: missing space after struct definition
wifi.h:972: WARNING: please, no spaces at the start of a line
wifi.h:1825: WARNING: Unnecessary space after function pointer name
wifi.h:1826: ERROR: "foo * bar" should be "foo *bar"
wifi.h:1099: WARNING: missing space after return type
wifi.h:1320: ERROR: Macros with complex values should be enclosed in parenthesis
wifi.h:1758: WARNING: Multiple spaces after return type
wifi.h:1855: ERROR: code indent should use tabs where possible
wifi.h:2303: ERROR: space prohibited after that open parenthesis '('
wifi.h:2408: ERROR: spaces required around that '=' (ctx:VxV)

Signed-off-by: Surendra Patil <surendra.tux@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-11 12:15:05 -08:00
Surendra Patil fdf2f40c6c staging: rtl8821ae: Fixed the size of array to macro as discussed by Linus
Linus Torvalds writes:

It causes an interesting warning for me:

drivers/staging/rtl8821ae/rtl8821ae/dm.c: In function
‘rtl8821ae_dm_clear_txpower_tracking_state’:
drivers/staging/rtl8821ae/rtl8821ae/dm.c:487:31: warning: iteration 2u
invokes undefined behavior [-Waggressive-loop-optimizations]
   rtldm->bb_swing_idx_ofdm[p] = rtldm->default_ofdm_index;
                               ^
drivers/staging/rtl8821ae/rtl8821ae/dm.c:485:2: note: containing loop
  for (p = RF90_PATH_A; p < MAX_RF_PATH; ++p) {
  ^

and gcc is entirely correct: that loop iterates from 0 to 3, and does this:

                rtldm->bb_swing_idx_ofdm[p] = rtldm->default_ofdm_index;

but the bb_swing_idx_ofdm[] array only has two members. So the last
two iterations will overwrite bb_swing_idx_ofdm_current and the first
entry in bb_swing_idx_ofdm_base[].

Now, the bug does seem to be benign: bb_swing_idx_ofdm_current isn't
actually ever *used* as far as I can tell, and the first entry of
bb_swing_idx_ofdm_base[] will have been written with that same
"rtldm->default_ofdm_index" value.

But gcc is absolutely correct, and that driver needs fixing.

I've pulled it and will let it be because it doesn't seem to be an
issue in practice, but please fix it. The obvious fix would seem to
change the size of "2" to be "MAX_RF_PATH", but I'll abstain from
doing those kinds of changes in the merge when it doesn't seem to
affect the build or functionality).

Reported-By: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Surendra Patil <surendra.tux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-07 09:15:35 -08:00
Greg Kroah-Hartman 3c05bedb5f Staging: rtl8812ae: Add Realtek 8821 PCI WIFI driver
This comes directly from the Realtek tarball, filename:
	wifi_driver_8821ae_0018.1129.2013.tar.gz

I mushed the three modules (btcoexist, rtlwifi and rtl8821ae) together
into one, in order to make it all build as one stand-alone module.
After the btcoexist driver gets merged upstream, I'll pull it out of
here, and will continue to work on removing this version of rtlwifi in
order to use the in-kernel one.

Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-23 09:37:23 -08:00