Commit Graph

729 Commits

Author SHA1 Message Date
Sean MacLennan 9326c5ca09 staging: r8192e_pci: fix htons error
A sparse error fixup removed a htons() which is required for the driver
to function. This patch puts the htons() back and fixes the sparse
warning correctly by changing the left side cast.

Signed-off-by: Sean MacLennan <seanm@seanm.ca>
Cc: stable <stable@vger.kernel.org> # 3.14
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-28 14:46:51 -07:00
Peter Senna Tschudin 4764ca981b drivers/staging: Remove useless return variables
This patch remove variables that are initialized with a constant,
are never updated, and are only used as parameter of return.
Return the constant instead of using a variable.

Verified by compilation only.

The coccinelle script that find and fixes this issue is:
// <smpl>
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
    when strict
return
- ret
+ C
;
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-26 10:32:15 -07:00
Julia Lawall 26e2fa765c staging: rtl8192e: make return of 0 explicit
Delete unnecessary use of a local variable to immediately return 0.

A simplified version of the semantic patch that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
local idexpression ret;
expression e;
position p;
@@

-ret = 0;
... when != ret = e
return
- ret
+ 0
  ;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24 02:14:30 +09:00
Dominique van den Broeck db4d7173c1 staging/rtl8192e: userspace ptr deref + incorrect declarations
. userspace pointer dereference ;

These issues have been fixed by a concurrent patch:
. missing inclusions of needed header files (fixed by concurrent patch);
. unrequired static function declaration (confusing another *.c file).

Signed-off-by: Dominique van den Broeck <domdevlin@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 20:25:54 +09:00
Dominique van den Broeck 7626e3d0d4 staging/rtl8192e: Erroneous return codes (types and values)
This function returns a bool, that is supposed to be false when something
goes wrong. It's assumed this way by its lone calling function (which is
SetRFPowerState8190(), line 1445 of rtl8192e/rtl8192e/r8192E_phy.c)

Despite of this, this procedure returns non-null enumerations values or
negative codes instead. This patch fixes this.

Signed-off-by: Dominique van den Broeck <domdevlin@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03 20:21:59 -04:00
Ben Hutchings 84fcb4b3a3 Staging: rtl8192e: Remove built-in firmware images
The driver can already use request_firmware() to load firmware, and
always does so.  There is code in init_firmware() to use the static
firmware images, but it's unreachable!  Remove the data and simplify
init_firmware() accordingly.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25 16:02:01 -07:00
Masanari Iida 430fb25090 staging: rtl8192e: Fix typo in rtl8192e
Fix spelling typo in comments within rtl8192e.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Reviewed-by: James Cameron <quozl@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25 16:02:00 -07:00
Masanari Iida 8659596730 staging: rtl8192e: A word in printk is split into 2 lines
A word in printk is split into two lines.
Change it into one line.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Reviewed-by: James Cameron <quozl@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25 16:02:00 -07:00
Joel Pelaez Jorge 5169af2309 Staging: rtl8192e: Fix declaration of symbols
The two declarations with issues in rtl_wx.h:

  * function: struct iw_statistics *r8192_get_wireless_stats();
  * variable: extern struct iw_handler_def r8192_wx_handlers_def;

The symbol 'r8192_get_wireless_stats' is declared as 'extern'
but it is only used in the local scope. The declaration is deleted
of rtl_wx.h, fixing the conflict with the 'extern' and 'static' scope.

The symbol 'r8192_wx_handlers_def' was fixed of some issues related
to variable declaration marked as 'extern' implicitly,
causing this sparse warning:

drivers/staging/rtl8192e/rtl8192e/rtl_wx.c:1323:24: warning: symbol
'r8192_wx_handlers_def' was not declared. Should it be static?

Resolved incluing the fixed header to rtl_wx.c

Also, isn't declared as constant variable, so it declared as such.
And delete unnecessary cast in rtl_core.c.

Signed-off-by: Joel Pelaez Jorge <joelpelaez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25 15:45:49 -07:00
Paul McQuade 82671db89c Staging:rtl8192e:rtl819x_BAProc:Remove whitespaces
ERROR: spaces required around that '=' (ctx:OxW)

Signed-off-by: Paul McQuade <paulmcquad@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25 15:45:24 -07:00
Linus Torvalds 159d8133d0 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
Pull trivial tree updates from Jiri Kosina:
 "Usual rocket science -- mostly documentation and comment updates"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial:
  sparse: fix comment
  doc: fix double words
  isdn: capi: fix "CAPI_VERSION" comment
  doc: DocBook: Fix typos in xml and template file
  Bluetooth: add module name for btwilink
  driver core: unexport static function create_syslog_header
  mmc: core: typo fix in printk specifier
  ARM: spear: clean up editing mistake
  net-sysfs: fix comment typo 'CONFIG_SYFS'
  doc: Insert MODULE_ in module-signing macros
  Documentation: update URL to hfsplus Technote 1150
  gpio: update path to documentation
  ixgbe: Fix format string in ixgbe_fcoe.
  Kconfig: Remove useless "default N" lines
  user_namespace.c: Remove duplicated word in comment
  CREDITS: fix formatting
  treewide: Fix typo in Documentation/DocBook
  mm: Fix warning on make htmldocs caused by slab.c
  ata: ata-samsung_cf: cleanup in header file
  idr: remove unused prototype of idr_free()
2014-04-02 16:23:38 -07:00
Gulsah Kose 91f14c855a staging: rtl8192e: Fix quoted string split across lines
Fix checkpatch.pl issues with quoted string split across lines in
dot11d.c

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-18 12:19:32 -07:00
Monam Agarwal 83efd52983 Staging: rtl8192e: Fix Sparse Warning of invalid assignment in rtllib_tx.c
This patch fixes following sparse warnings:
drivers/staging/rtl8192e/rtllib_tx.c:942:45: warning: invalid assignment: +=
drivers/staging/rtl8192e/rtllib_tx.c:942:45:    left side has type unsigned long
drivers/staging/rtl8192e/rtllib_tx.c:942:45:    right side has type restricted __le16
drivers/staging/rtl8192e/rtllib_tx.c:947:49: warning: invalid assignment: +=
drivers/staging/rtl8192e/rtllib_tx.c:947:49:    left side has type unsigned long
drivers/staging/rtl8192e/rtllib_tx.c:947:49:    right side has type restricted __le16

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-07 16:13:39 -08:00
Silvan Jegen ffb8cc92a7 Staging: rtl8192e: Replace min macro with min_t
Instead of an explicit cast the min_t macro should be used.

Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-27 12:16:50 -08:00
Jon Mason 4c6978d304 staging/rtl8192e: Remove unused code
Remove unused #defines, structure, and inlined functions for the
rtl8192e driver.  Compile tested only.

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-24 16:52:43 -08:00
Jiri Kosina d4263348f7 Merge branch 'master' into for-next 2014-02-20 14:54:28 +01:00
Paul Bolle c7dcec7dd4 Kconfig: Remove useless "default N" lines
A number of Kconfig entries default to (uppercase) "N". It was clearly
intended to use "default n". But since (lowercase) "n" is the default
anyway, these lines might as well be removed.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-02-20 14:38:06 +01:00
Andreas Frembs 41ad3d5fde Staging rtl8192e: Correcting wrong usage of macro in r8192E_phy.c and removing corresponding warning in rtllib_debug.h
We fixed in rtllib_debug.h the following checkpatch warning:
	WARNING: do {} while (0) macros should not be semicolon terminated.

After deleting this semicolon we also had to fix the wrong use of this macro in rtl8192e/r8192E_phy.c

Signed-off-by: Andreas Frembs <andreas.frembs@studium.uni-erlangen.de>
Signed-off-by: Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-09 10:32:18 -08:00
Andreas Frembs f9ce4fa329 Staging rtl8192e: Fixing checkpatch error in rtllib_debug.h
In rtllib_debug.h we fixed the following checkpatch error:
	ERROR: Macros with complex values should be enclosed in parenthesis

We fixed this with a do {} while (0), because otherwise the compiler complained.

Signed-off-by: Andreas Frembs <andreas.frembs@studium.uni-erlangen.de>
Signed-off-by: Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-09 10:32:18 -08:00
Andreas Frembs b93ae9e5d9 Staging rtl8192e: Fixing checkpatch error in rtllib_crypt_tkip.c
In rtllib_crypt_tkip.c we fixed the following checkpatch error:
	ERROR: space required after that ','

Signed-off-by: Andreas Frembs <andreas.frembs@studium.uni-erlangen.de>
Signed-off-by: Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-09 10:32:18 -08:00
Matthias Schoepe a0711c4da3 Staging rtl8192e: Fixing checkpatch errors
We fixed checkpatch errors of the following type:
	ERROR: "foo * bar" should be "foo *bar"

The error was fixed in the following files of the rtl8192e staging driver:
	rtllib_softmac.c
	rtllib_rx.c
	rtllib_crypt.c
	rtllib.h

There are no functional changes in this patch.

Signed-off-by: Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>
Signed-off-by: Andreas Frembs <andreas.frembs@studium.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-09 10:29:37 -08:00
Andreas Frembs a3c383c5c3 rlt8192e: Removing unused defines in rltlib_endianfree.h
Checkpatch mentioned that these macros should be defined with a 'do {...} while(0)' statement.
So we used grep to find all files using these macros and we found out that these macros were only used
in rtl819x_Qos.h, in the defines we removed before.
Since the macros are not used anywhere else we decided to remove them from the driver.

Signed-off-by: Andreas Frembs <andreas.frembs@studium.uni-erlangen.de>
Signed-off-by: Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 11:41:28 -08:00
Andreas Frembs a1ca601aa2 rtl8192e: Removing unused defines in rtl819x_Qos.h
In rtl819x_Qos.h there were several macros defined but never used.
So we removed this macros.

Signed-off-by: Andreas Frembs <andreas.frembs@studium.uni-erlangen.de>
Signed-off-by: Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 11:41:28 -08:00
Andreas Frembs 6e925e1991 rtl8192e: Fixing checkpatch errors
This patch fixes the following checkpatch errors from rtllib_endianfree.h:
 - ERROR: Macros with complex values should be enclosed in parenthesis

Signed-off-by: Andreas Frembs <andreas.frembs@studium.uni-erlangen.de>
Signed-off-by: Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 11:41:28 -08:00
Paul Gortmaker 885a947e5b staging: delete non-required instances of include <linux/init.h>
None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>.  Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 10:08:14 -08:00
Archana kumari f249da27e3 staging: rtl8192e: Fixed space prohibited warning in dot11d.c
This patch fixes space prohibited before semicolon warning in dot11d.c

Signed-off-by: Archana kumari <archanakumari959@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:06:18 -08:00
Himangi Saraogi fa7b3d0288 staging:rtl8192e: Rewrite macro definition as static inline function.
This patch removes the checkpatch.pl error Macros "with complex values
should be enclosed in parenthesis" in dot11d.h by rewriting it as a
static inline function.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:05:47 -08:00
Rashika Kheria 466bc7f230 Staging: rtl8192e: Fix Sparse warning of cast to restricted __le32 in rtl_core.c
This patch fixes the following sparse warnings in rtl8192e/rtl_core.c-

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1846:46: warning: cast to restricted __le32
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1951:46: warning: cast to restricted __le32
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2199:50: warning: cast to restricted __le32

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:02:23 -08:00
Rashika Kheria 34e987e6ff Staging: rtl8192e: Fix incorrect type in assignment in rtl_core.c
This patch fixes the following sparse warning in rtl8192e/rtl_core.c-

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:10: warning: incorrect type in initializer (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:10:    expected  restricted __le16
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:10:    got int

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:13: warning: incorrect type in initializer (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:13:    expected restricted __le16
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:13:    got int

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:16: warning: incorrect type in initializer (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:16:    expected restricted __le16
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:16:    got int

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:19: warning: incorrect type in initializer (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:19:        expected restricted __le16
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:565:19:    got int

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:10: warning: incorrect type in initializer (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:10:    expected restricted __le16
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:10:    got int

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:13: warning: incorrect type in initializer (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:13:         expected restricted __le16
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:13:         got int

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:16: warning: incorrect type in initializer (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:16:    expected restricted __le16
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:16:    got int

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:19: warning: incorrect type in initializer (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:19:    expected restricted __le16
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:566:19:    got int

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2012:12: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2012:12:        expected unsigned short [unsigned] [usertype] fc
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2012:12:        got restricted __le16 [usertype] frame_ctl

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2102:46: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2102:46:   expected unsigned int [unsigned] [usertype] BufferAddress
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2102:46:   got restricted __le32 [usertype] <noident>

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2137:41: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2137:41:   expected unsigned int [unsigned] [usertype] NextDescAddress
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2137:41:         got restricted __le32 [usertype] <noident>

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2401:38: warning: incorrect type in assignment rtllib_softmac.c(different base types)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2401:38:         expected unsigned int [unsigned] [usertype] BufferAddress
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2401:38:   got restricted __le32 [usertype] <noident>

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:02:22 -08:00
Rashika Kheria fa63c9ce86 Staging: rtl8192e: Fix Sparse Warning for Static Declarations in rtl_core.c
This patch fixes the following sparse warning in rtl8192e/rtl_core.c-

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:58:5: warning: symbol 'hwwep' was not declared. Should it be static?
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:588:5: warning: symbol 'WDCAPARA_ADD' was not declared. Should it be static?
drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2695:13: warning: symbol 'rtl8192_interrupt' was not declared. Should it be static?

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:02:22 -08:00
Rashika Kheria 285cce0560 Staging: rtl8192e: Fix incorrect type in assignment in r8192E_dev.c
This patch fixes the following sparse warning in rtl8192e/r8192E_dev.c-

drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c:1275:27: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c:1275:27:    expected unsigned int [unsigned] [usertype] TxBuffAddr
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c:1275:27:    got restricted __le32 [usertype] <noident>

drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c:1305:27: warning:  incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c:1305:27:    expected  unsigned int [unsigned] [usertype] TxBuffAddr
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c:1305:27:    got  restricted __le32 [usertype] <noident>

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:02:22 -08:00
Rashika Kheria d95cb1c774 Staging: rtl8192e: Fix Sparse warning of cast from restricted __le16 in r8192E_dev.c
This patch fixes the following Sparse warning in rtl8192e/r8192E_dev.c-

drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c:196:34: warning: cast from restricted __le16
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c:198:33: warning: cast from restricted __le16
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c:200:33: warning: cast from restricted __le16

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:02:22 -08:00
Rashika Kheria 20fc5afc32 Staging: rtl8192e: Fix Sparse Warning for Static Declarations in rtllib_crypt_wep.c
This patch fixes the following Sparse warnings in rtllib_crypt_wep.c-

drivers/staging/rtl8192e/rtllib_crypt_wep.c:273:12: warning: symbol 'rtllib_crypto_wep_init' was not declared. Should it be static?
drivers/staging/rtl8192e/rtllib_crypt_wep.c:279:13: warning: symbol 'rtllib_crypto_wep_exit' was not declared. Should it be static?

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:02:22 -08:00
Rashika Kheria 316de3cabb Staging: rtl8192e: Fix Sparse Warning for Static Declarations in rtllib_crypt_tkip.c
This patch fixes the following Sparse warnings in rtllib_crypt_tkip.c-

drivers/staging/rtl8192e/rtllib_crypt_tkip.c:755:12: warning: symbol 'rtllib_crypto_tkip_init' was not declared. Should it be static?
drivers/staging/rtl8192e/rtllib_crypt_tkip.c:761:13: warning: symbol 'rtllib_crypto_tkip_exit' was not declared. Should it be static?

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:02:22 -08:00
Rashika Kheria 99277c1f99 Staging: rtl8192e: Fix Sparse warning of cast to restricted __le16 in rtllib_crypt_tkip.c
This patch fixes the following Sparse warnings in rtllib_crypt_tkip.c-
drivers/staging/rtl8192e/rtllib_crypt_tkip.c:176:16: warning: cast to restricted __le16

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:02:22 -08:00
Rashika Kheria 327ca222ae Staging: rtl8192e: Fix Sparse Warning for Static Declarations in rtllib_crypt_ccmp.c
This patch fixes the following Sparse warnings in rtllib_crypt_ccmp.c-

drivers/staging/rtl8192e/rtllib_crypt_ccmp.c:446:12: warning: symbol 'rtllib_crypto_ccmp_init' was not declared. Should it be static?
drivers/staging/rtl8192e/rtllib_crypt_ccmp.c:452:13: warning: symbol 'rtllib_crypto_ccmp_exit' was not declared. Should it be static?

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:02:22 -08:00
Rashika Kheria 450246465a Staging: rtl8192e: Fix incorrect type in assignment in rtl819x_BAProc.c
This patch fixes the following Sparse warnings in
rtl819x_BAProc.c-

drivers/staging/rtl8192e/rtl819x_BAProc.c:118:21: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtl819x_BAProc.c:118:21:    expected   unsigned short [unsigned] [usertype] tmp
drivers/staging/rtl8192e/rtl819x_BAProc.c:118:21:    got restricted __le16 [usertype] <noident>

drivers/staging/rtl8192e/rtl819x_BAProc.c:122:13: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtl819x_BAProc.c:122:13:    expected unsigned short [unsigned] [addressable] [usertype] tmp
drivers/staging/rtl8192e/rtl819x_BAProc.c:122:13:    got restricted __le16 [usertype] <noident>

drivers/staging/rtl8192e/rtl819x_BAProc.c:125:13: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtl819x_BAProc.c:125:13:    expected unsigned short [unsigned] [addressable] [usertype] tmp
drivers/staging/rtl8192e/rtl819x_BAProc.c:125:13:    got restricted __le16 [usertype] <noident>

drivers/staging/rtl8192e/rtl819x_BAProc.c:181:13: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtl819x_BAProc.c:181:13:    expected unsigned short [unsigned] [usertype] tmp
drivers/staging/rtl8192e/rtl819x_BAProc.c:181:13:    got restricted __le16 [usertype] <noident>

drivers/staging/rtl8192e/rtl819x_BAProc.c:184:13: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtl819x_BAProc.c:184:13:    expected unsigned short [unsigned] [addressable] [usertype] tmp
drivers/staging/rtl8192e/rtl819x_BAProc.c:184:13:    got restricted __le16 [usertype] <noident>

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:02:22 -08:00
Rashika Kheria c5654c0bf9 Staging: rtl8192e: Fix Sparse Warning for Static Declarations in rtllib_softmac.c
This patch fixes the following Sparse warnings in rtllib_softmac.c-

drivers/staging/rtl8192e/rtllib_softmac.c:3636:12: warning: symbol 'rtllib_MgntDisconnectIBSS' was not declared. Should it be static?
drivers/staging/rtl8192e/rtllib_softmac.c:3661:13: warning: symbol 'rtllib_MlmeDisassociateRequest' was not declared. Should it be static?
drivers/staging/rtl8192e/rtllib_softmac.c:3687:13: warning: symbol 'rtllib_MgntDisconnectAP' was not declared. Should it be static?

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:01:35 -08:00
Rashika Kheria 1830a6d840 Staging: rtl8192e: Fix incorrect type in assignment in rtllib_softmac.c
This patch fixes the following Sparse warning in rtllib_softmac.c-

drivers/staging/rtl8192e/rtllib_softmac.c:298:12: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_softmac.c:298:12:    expected unsigned short [unsigned] [usertype] fc
drivers/staging/rtl8192e/rtllib_softmac.c:298:12:    got restricted __le16 [usertype] frame_ctl

drivers/staging/rtl8192e/rtllib_softmac.c:810:32: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_softmac.c:810:32:    expected restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192e/rtllib_softmac.c:810:32:    got int

drivers/staging/rtl8192e/rtllib_softmac.c:814:34: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_softmac.c:814:34:    expected restricted __le16 [usertype] duration_id
drivers/staging/rtl8192e/rtllib_softmac.c:814:34:    got int

drivers/staging/rtl8192e/rtllib_softmac.c:821:33: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_softmac.c:821:33:    expected restricted __le16 [usertype] algorithm
drivers/staging/rtl8192e/rtllib_softmac.c:821:33:    got int

drivers/staging/rtl8192e/rtllib_softmac.c:955:24: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_softmac.c:955:24:    expected unsigned short [unsigned] [usertype] val16
drivers/staging/rtl8192e/rtllib_softmac.c:955:24:    got restricted __le16 [usertype] <noident>

drivers/staging/rtl8192e/rtllib_softmac.c:1263:33: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_softmac.c:1263:33:    expected restricted __le16 [usertype] duration_id
drivers/staging/rtl8192e/rtllib_softmac.c:1263:33:    got int

drivers/staging/rtl8192e/rtllib_softmac.c:1282:30: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_softmac.c:1282:30:    expected restricted __le16 [usertype] listen_interval
drivers/staging/rtl8192e/rtllib_softmac.c:1282:30:    got unsigned short [unsigned] [usertype] listen_interval

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:01:35 -08:00
Rashika Kheria 7fe30a7d4a Staging: rtl8192e: Fix Sparse Warning of invalid assignment '|=' in rtllib_softmac.c
This patch fixes the following Sparse warning in rtllib_softmac.c-

drivers/staging/rtl8192e/rtllib_softmac.c:812:40: warning: invalid assignment: |=
drivers/staging/rtl8192e/rtllib_softmac.c:812:40:    left side has  type restricted __le16
drivers/staging/rtl8192e/rtllib_softmac.c:812:40:    right side has type int

drivers/staging/rtl8192e/rtllib_softmac.c:924:17: warning: invalid assignment: |=
drivers/staging/rtl8192e/rtllib_softmac.c:924:17:    left side has type restricted __le16
drivers/staging/rtl8192e/rtllib_softmac.c:924:17:    right side has type int
drivers/staging/rtl8192e/rtllib_softmac.c:924:17: error: cast from unknown type

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:01:35 -08:00
Rashika Kheria f7df1918b5 Staging: rtl8192e: Fix Sparse warning of restricted __le16 degrades to integer in rtllib_softmac.c
This patch fixes the following Sparse warning in rtllib_softmac.c-
drivers/staging/rtl8192e/rtllib_softmac.c:230:19: warning: restricted __le16 degrades to integer

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 12:01:35 -08:00
Rashika Kheria 86005e169b Staging: rtl8192e: Fix Sparse Warning of restricted __le16 degrades to integer in rtllib_tx.c
This patch fixes the following sparse warning in rtllib_tx.c-
warning: restricted __le16 degrades to integer

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 11:58:25 -08:00
Rashika Kheria 198e0d17c2 Staging: rtl8192e: Fix incorrect type in assignment in rtllib_tx.c
This patch fixes the following sparse warning in rtllib_tx.c-

drivers/staging/rtl8192e/rtllib_tx.c:234:24: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_tx.c:234:24:    expected restricted __le16 [usertype] frag_size
drivers/staging/rtl8192e/rtllib_tx.c:234:24:    got int [signed] txb_size
drivers/staging/rtl8192e/rtllib_tx.c:613:43: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_tx.c:613:43:    expected restricted __le16 [usertype] payload_size
drivers/staging/rtl8192e/rtllib_tx.c:613:43:    got unsigned int [unsigned] len
drivers/staging/rtl8192e/rtllib_tx.c:767:35: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_tx.c:767:35:    expected restricted __le16 [usertype] payload_size
drivers/staging/rtl8192e/rtllib_tx.c:767:35:    got int [signed] [assigned] bytes
drivers/staging/rtl8192e/rtllib_tx.c:814:51: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_tx.c:814:51:    expected restricted __le16 [usertype] seq_ctl
drivers/staging/rtl8192e/rtllib_tx.c:814:51:    got unsigned short
drivers/staging/rtl8192e/rtllib_tx.c:174:36: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_tx.c:174:36:    expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/staging/rtl8192e/rtllib_tx.c:174:36:    got restricted __be16 [usertype] <noident>
drivers/staging/rtl8192e/rtllib_tx.c:873:35: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_tx.c:873:35:    expected restricted __le16 [usertype] payload_size
drivers/staging/rtl8192e/rtllib_tx.c:873:35:    got unsigned int [unsigned] len

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 11:58:25 -08:00
Rashika Kheria cf8ab8cf99 Staging: rtl8192e: Fix Sparse Warning for Static Declarations in rtllib_module.c
This patch fixes the following sparse warning in rtllib_module.c-

drivers/staging/rtl8192e/rtllib_module.c:240:12: warning: symbol 'rtllib_init' was not declared. Should it be static?
drivers/staging/rtl8192e/rtllib_module.c:260:13: warning: symbol 'rtllib_exit' was not declared. Should it be static?

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 11:58:25 -08:00
Rashika Kheria e0b1ca6055 Staging: rtl8192e: Fix incorrect casting in rtllib_rx.c
This patch fixes the following sparse warning in rtllib_rx.c-

drivers/staging/rtl8192e/rtllib_rx.c:2267:34: warning: cast to restricted __le32
drivers/staging/rtl8192e/rtllib_rx.c:2268:34: warning: cast to restricted __le32
drivers/staging/rtl8192e/rtllib_rx.c:2269:36: warning: cast to restricted __le32
drivers/staging/rtl8192e/rtllib_rx.c:2269:36: warning: cast from restricted __le16

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 11:58:25 -08:00
Rashika Kheria 26a6b07497 Staging: rtl8192e: Fix Sparse warning of restricted __le16 degrades to integer in rtllib_rx.c
This patch fixes the following sparse warning in rtllib_rx.c-
warning: restricted __le16 degrades to integer

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 11:58:25 -08:00
Rashika Kheria 1f5a0d0cd4 Staging: rtl8192e: Fix incorrect type in assignment in rtllib_rx.c
This patch fixes the following Sparse warning in rtllib_rx.c-

drivers/staging/rtl8192e/rtllib_rx.c:493:37: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_rx.c:493:37:    expected unsigned short [unsigned] [usertype] len
drivers/staging/rtl8192e/rtllib_rx.c:493:37:    got restricted __be16 [usertype] <noident>

drivers/staging/rtl8192e/rtllib_rx.c:1227:37: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_rx.c:1227:37:    expected unsigned short [unsigned] [usertype] len
drivers/staging/rtl8192e/rtllib_rx.c:1227:37:    got restricted __be16 [usertype] <noident>

drivers/staging/rtl8192e/rtllib_rx.c:1635:40: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_rx.c:1635:40:    expected restricted __le16 <noident>
drivers/staging/rtl8192e/rtllib_rx.c:1635:40:    got int

drivers/staging/rtl8192e/rtllib_rx.c:1637:40: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_rx.c:1637:40:    expected restricted __le16 <noident>
drivers/staging/rtl8192e/rtllib_rx.c:1637:40:    got int

drivers/staging/rtl8192e/rtllib_rx.c:1641:45: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_rx.c:1641:45:    expected restricted __le16 <noident>
drivers/staging/rtl8192e/rtllib_rx.c:1641:45:    got unsigned short [unsigned] [usertype] <noident>

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 11:58:25 -08:00
Valentina Manea cf975772ad staging: rtl8192e: remove unneeded semicolons
This fixes coccinelle errors regarding unneeded
semicolons.

Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-30 09:08:45 -07:00
Valentina Manea 014e4c27c6 staging: rtl8192e: use true and false for bool variables
This patch fixes coccinelle errors for bool variables
initialized with 1 or 0 instead of true and false.

Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-30 09:08:45 -07:00
Teodora Baluta 216249819f staging: rtl8192e: use memdup_user to simplify code
Use memdup_user rather than duplicating its implementation. This patch
fixes the following coccinelle warnings:

drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2598:8-15: WARNING opportunity for memdup_user
drivers/staging/rtl8192e/rtllib_softmac.c:3594:9-16: WARNING opportunity for memdup_user

Signed-off-by: Teodora Baluta <teobaluta@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-28 14:47:07 -07:00
Valentina Manea 4bb01423ab staging: rtl8192e: do not use comparisons on bool tests
This patch fixes coccinelle errors regarding comparisons
used in bool tests.

Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com>
Reviewed-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-28 14:28:35 -07:00
Ashvini Varatharaj f222c70ccf Staging: rtl8192e: Replacing (u8*) with (u8 *)
Fix checkpatch error: ERROR: "(foo*)" should be "(foo *)"

Signed-off-by: Ashvini Varatharaj <ashvinivaratharaj@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-15 08:46:10 -07:00
Joe Perches a22526e48d staging: Remove unnecessary semicolons
These aren't necessary after switch, if and while statements.

Also remove some unnecessary braces where these
semicolons were removed around single statement
and some unnecessary blank lines.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 15:47:06 -07:00
Sachin Kamat 28432995fc staging: rtl8192e: Remove redundant pci_set_drvdata
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25 16:45:19 -07:00
Masanari Iida e0e2615af2 staging: rtl8192e: Fix typo in rtl8192e/dot11d.h
Correct spelling typo in comment

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25 16:25:40 -07:00
Joe Perches 8329419a29 Staging: Convert uses of compare_ether_addr to ether_addr_equal
Preliminary to removing compare_ether_addr altogether:

Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.

Additionally:

Used is_zero_ether_addr, removed now unused variable
Converted uses of &foo[0] to foo

Done via cocci script: (and a little typing)

$ cat compare_ether_addr.cocci
@@
expression a,b;
@@
-	!compare_ether_addr(a, b)
+	ether_addr_equal(a, b)

@@
expression a,b;
@@
-	compare_ether_addr(a, b)
+	!ether_addr_equal(a, b)

@@
expression a,b;
@@
-	!ether_addr_equal(a, b) == 0
+	ether_addr_equal(a, b)

@@
expression a,b;
@@
-	!ether_addr_equal(a, b) != 0
+	!ether_addr_equal(a, b)

@@
expression a,b;
@@
-	ether_addr_equal(a, b) == 0
+	!ether_addr_equal(a, b)

@@
expression a,b;
@@
-	ether_addr_equal(a, b) != 0
+	ether_addr_equal(a, b)

@@
expression a,b;
@@
-	!!ether_addr_equal(a, b)
+	ether_addr_equal(a, b)

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-17 07:47:44 -07:00
Andrea Merello 559a4c318c staging: Update e-mail address for Andrea Merello
A lot of files contain reference to my old e-mail address.
Now I'm going not to read mail from it anymore, so update it
with my current address everywhere.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-27 22:03:53 -07:00
navin patidar 30224b5e0b staging: rtl8192e: Remove pt_regs * irq handler parameter
struct pt_regs pointer is no longer passed as a irq handler
argument. and also remove unnecessary macros.

Signed-off-by: navin patidar <navinp@cdac.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-26 06:29:09 -07:00
Iker Pedrosa 59aabd6a22 Staging: rtl8192e: rtllib_rx: checking NULL value after doing dev_alloc_skb
Checking the return of dev_alloc_skb as stated in the following bug:
https://bugzilla.kernel.org/show_bug.cgi?id=60401

Reported-by: RUC_Soft_Sec rucsoftsec@gmail.com
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-12 15:20:25 -07:00
Li Zefan 1c9962b434 Staging: rtl8192e: add missing single_release()
The debug file is opened with single_open(), but there's no
single_release().

Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:33:36 -07:00
Dan Carpenter 71c8d893aa Staging: rtl8192e: fix an endian bug
Passing the high bits of "ratr_value" to rtl8192_config_rate() only
works on little endian systems.  We should be passing a u16 value.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 20:46:29 +09:00
Dan Carpenter 03e71d6b91 Staging: rtl8192e: printing the wrong array
Smatch complained that there is an array overflow here.  It looks
like we are supposed to be printing the ->rates_ex[] array which is
slightly larger than the ->rates[] array.  This is a cut and paste
error.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 20:46:28 +09:00
Dan Carpenter 1c8103f7c6 Staging: rtl8192e: delete some dead cruft
I have removed some unneeded comments, some blank lines and some
unused macros.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 20:46:27 +09:00
Hema Prathaban 6dea0da1ff staging: rtl8192e: Use kmemdup for duplicating memory
Instead of allocating memory (kmalloc) and copying (memcpy)
from source, memory can be duplicated using kmemdup

Signed-off-by: Hema Prathaban <hemaklnce@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-15 14:23:41 -04:00
Hema Prathaban ae053253a7 staging: rtl8192e: Fix potential null dereference
check memory is allocated in '*challenge' before using it.

Signed-off-by: Hema Prathaban <hemaklnce@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-15 14:23:40 -04:00
David Howells 6bbefe8679 hostap: Don't use create_proc_read_entry()
Don't use create_proc_read_entry() as that is deprecated, but rather use
proc_create_data() and seq_file instead.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: Jouni Malinen <j@w1.fi>
cc: John W. Linville <linville@tuxdriver.com>
cc: Johannes Berg <johannes@sipsolutions.net>
cc: linux-wireless@vger.kernel.org
cc: netdev@vger.kernel.org
cc: devel@driverdev.osuosl.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:56 -04:00
Sean MacLennan f56e2947be The rtl8192e procfs-based debug interface seems very broken
The procfs debug code in rtl_debug.c is, ironically, very buggy: it lacks proper locking.
Since the most useful part of the code (the stats) are available through more
standard APIs, I think it is best to just delete the whole mess.

Signed-off-by: Sean MacLennan <seanm@seanm.ca>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:13:06 -04:00
Al Viro c037773cc7 rtl8192e: switch to proc_create()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:13:06 -04:00
Al Viro e3e7b40c19 rtl8192e: don't use create_proc_entry() for directories
proc_mkdir() is there for purpose...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:13:06 -04:00
David S. Miller 4b87f92259 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
	Documentation/networking/ip-sysctl.txt
	drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c

Both conflicts were simply overlapping context.

A build fix for qlcnic is in here too, simply removing the added
devinit annotations which no longer exist.

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-15 15:05:59 -05:00
Larry Finger 2dcb4a298c staging: rtl8192e: Fix failure to check pci_map_single()
Beginning with kernel 3.8, the DMA mapping routines issue a warning
for the first call to pci_map_single() that is not checked with a
pci_dma_mapping_error() call.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 12:57:27 -08:00
Jiri Pirko 7826d43f2d ethtool: fix drvinfo strings set in drivers
Use strlcpy where possible to ensure the string is \0 terminated.
Use always sizeof(string) instead of 32, ETHTOOL_BUSINFO_LEN
and custom defines.
Use snprintf instead of sprint.
Remove unnecessary inits of ->fw_version
Remove unnecessary inits of drvinfo struct.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-06 21:06:31 -08:00
Bill Pemberton 1387b461af staging: rtl8192e: remove use of __devexit
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 14:07:42 -08:00
Bill Pemberton 83f5789c10 staging: rtl8192e: remove use of __devinitdata
CONFIG_HOTPLUG is going away as an option so __devinitdata is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 14:07:42 -08:00
Bill Pemberton c506fff1ff staging: rtl8192e: remove use of __devinit
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 14:07:42 -08:00
Bill Pemberton c08561c5cf staging: rtl8192e: remove use of __devexit_p
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 14:07:42 -08:00
Kumar Amit Mehta 4087641b25 staging: rtl8192e: rtl8192e: rtl_core.c: Audit the return value of register_netdev()
Inspect the return value of register_netdev() in the driver probe routine and
return -ENODEV in case of error.

Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15 15:26:14 -08:00
Edgar Neukirchner 4d0c8ee859 Staging: rtl8192e: rtllib_tx.c: fixed an asterisk coding style issue
Fixed coding style issue

Signed-off-by: Edgar Neukirchner <edgar.neukirchner@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31 15:14:41 -07:00
Peter Huewe 9d8a20a52c staging/rtl8192e: Fix compile warning 'is static but declared in .. which is not static'
When compiling this driver I get these compile warnings:

rtllib.h:2573:2: warning: '______f' is static but declared in inline
function 'rtllib_is_empty_essid' which is not static [enabled by
default]
rtllib.h:2579:3: warning: '______f' is static but declared in inline
function 'rtllib_is_empty_essid' which is not static [enabled by
default]
rtllib.h:2594:2: warning: '______f' is static but declared in inline
function 'rtllib_is_valid_mode' which is not static [enabled by default]
rtllib.h:2599:2: warning: '______f' is static but declared in inline
function 'rtllib_is_valid_mode' which is not static [enabled by default]
rtllib.h:2604:2: warning: '______f' is static but declared in inline
function 'rtllib_is_valid_mode' which is not static [enabled by default]
rtllib.h:2618:3: warning: '______f' is static but declared in inline
function 'rtllib_get_hdrlen' which is not static [enabled by default]
rtllib.h:2620:3: warning: '______f' is static but declared in inline
function 'rtllib_get_hdrlen' which is not static [enabled by default]

These functions are declared as extern inline but not 'overloaded'
anywhere so we can declare them static inline and get rid of the
warnings.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-29 15:01:01 -07:00
Linus Torvalds def7cb8cd4 Staging tree update for 3.7-rc1
Here is the big staging tree update for the 3.7-rc1 merge window.
 
 There are a few patches in here that are outside of the staging area,
 namely HID and IIO patches, but all of them have been acked by the
 relevant subsystem maintainers.  The IIO stuff is still coming in
 through this tree as it hasn't entirely moved out of the staging tree,
 but is almost there.
 
 Other than that, there wa a ton of work on the comedi drivers to make
 them more readable and the correct style.  Doing that removed a lot of
 code, but we added a new driver to the staging tree, so we didn't end up
 with a net reduction this time around:
  662 files changed, 51649 insertions(+), 26582 deletions(-)
 
 All of these patches have been in the linux-next tree already.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iEYEABECAAYFAlBp32YACgkQMUfUDdst+ymU5QCgm8KWB+dAO8ZFbmzhhm3C0VFl
 wB0AoKbDj/tCiUHkJ70u/i3OHueKkpet
 =ut2/
 -----END PGP SIGNATURE-----

Merge tag 'staging-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging tree update from Greg Kroah-Hartman:
 "Here is the big staging tree update for the 3.7-rc1 merge window.

  There are a few patches in here that are outside of the staging area,
  namely HID and IIO patches, but all of them have been acked by the
  relevant subsystem maintainers.  The IIO stuff is still coming in
  through this tree as it hasn't entirely moved out of the staging tree,
  but is almost there.

  Other than that, there wa a ton of work on the comedi drivers to make
  them more readable and the correct style.  Doing that removed a lot of
  code, but we added a new driver to the staging tree, so we didn't end
  up with a net reduction this time around:

   662 files changed, 51649 insertions(+), 26582 deletions(-)

  All of these patches have been in the linux-next tree already.

  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"

* tag 'staging-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1094 commits)
  staging: comedi: jr3_pci: fix iomem dereference
  staging: comedi: drivers: use comedi_fc.h cmdtest helpers
  Staging: winbond: usb_free_urb(NULL) is safe
  Staging: winbond: checkpatch cleanup
  Staging: winbond: Removed undesired spaces, lines and tabs
  Staging: winbond: Typo corrections in comments
  Staging: winbond: Changed c99 comments to c89 comments
  staging: r8712u: Do not queue cloned skb
  staging: comedi: ni_mio_common: always lock in ni_ai_poll()
  staging: comedi: s626: add FIXME comment
  staging: comedi: s626: don't dereference insn->data
  staging: comedi: s526: fix if() check in s526_gpct_winsn()
  staging: comedi: s626: cleanup comments in s626_initialize()
  staging: comedi: s626: remove clear of kzalloc'ed data
  staging: comedi: s626: remove 'WDInterval' from private data
  staging: comedi: s626: remove 'ChargeEnabled' from private data
  staging: comedi: s626: remove 'IsBoardRevA' comment
  staging: comedi: s626: #if 0 out the "SAA7146 BUG WORKAROUND"
  staging: comedi: s626: remove 'allocatedBuf' from private data
  staging: comedi: s626: add final attach message
  ...
2012-10-01 12:11:39 -07:00
Adam Buchbinder f2635894e8 staging: Fix misspellings of "whether".
"Whether" is spelled "wether" in several places. This fixes those that
are in the staging tree.

Signed-off-by: Adam Buchbinder <adam.buchbinder@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21 08:56:40 -07:00
Wei Yongjun 71cd7913cb staging: rtl8192e: using random_ether_addr() to generate random MAC
Using random_ether_addr() to generate a random Ethernet
address (MAC) that is not multicast and has the local
assigned bit set. Not need to duplicating its implementation.

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04 14:11:28 -07:00
Devendra Naga b4797fef98 staging: rtl8192e: remove casting of returned pointer from kmalloc
as per Documentation/CodingStyle we dont need to cast the return of
kmalloc

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04 14:09:02 -07:00
Wei Yongjun 085b50186d staging: rtl8192e: remove pointless conditional before kfree_skb()
Remove pointless conditional before kfree_skb().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04 14:09:02 -07:00
Wei Yongjun efe13d868f staging: rtl8192e: use is_zero_ether_addr() instead of memcmp()
Using is_zero_ether_addr() instead of directly use
memcmp() to determine if the ethernet address is all
zeros.

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04 14:09:01 -07:00
Wei Yongjun 0c43e56c30 staging: rtl8192e: use is_broadcast_ether_addr() instead of memcmp()
Using is_broadcast_ether_addr() instead of directly use
memcmp() to determine if the ethernet address is broadcast
address.

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04 14:03:40 -07:00
Jiang Liu 479e0d485e rtl8192e: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify rtl8192e driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:16 -06:00
Masanari Iida db2c8da02a staging: rtl8192e: Fix typo in staging/rtl8192e
Correct spelling typo in staging/rtl8192e.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-13 19:32:13 -07:00
Tim Gardner 7f34f41289 staging rtl8192e: Declare MODULE_FIRMWARE usage
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Mike McCormack <mikem@ring3k.org>
Cc: wlanfae <wlanfae@realtek.com>
Cc: Sean MacLennan <seanm@seanm.ca>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Sean MacLennan <seanm@seanm.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-13 19:23:19 -07:00
Dan Carpenter 6fe864409b Staging: rtl8187se, rtl8192e: fix '&' vs '|' bugs
The original code is equivalent to:

	wrqu->retry.flags = 0x1000 & 0x0002;

so it just sets .flags to zero.  We should be ORing the values together
like r8192_wx_get_retry() does in drivers/staging/rtl8192u/r8192U_wx.c.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-12 10:52:32 -07:00
Joe Perches 14fc42355f staging: Remove test of is_broadcast with is_multicast
A broadcast packet is a multicast packet, no need to test twice.

Reorder one defective test in rtl_core of is_multi_ether_addr
before is_broadcast_ether_addr as the is_multi returns true for
broadcast frames.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-09 13:52:23 -07:00
Justin P. Mattock 4c234ebcf4 staging: "rtl8192e/r8192u" typo change ContiuneDiffCount.
As mentioned by jesper juhl, we should probably change ContiuneDiffCount
to ContinueDiffCount. Below you will find the changes to do so.  I have
compile tested this and everything builds with the changes, as for
testing on the hardware I am unable to do.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-01 21:52:12 -07:00
Justin P. Mattock cd01712397 staging: rtl8192e: Fix typos.
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
ACKed-by: Larry Finger <Larry.finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24 11:28:24 -07:00
Larry Finger ea9f10f2fd staging: r8192e_pci: Change memcpy to memcmp
Routine rtllib_MlmeDisassociateRequest() has a comparison of memcpy()
with NULL, which makes no sense. Analysis of the code suggests that
memcmp() was intended.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-20 15:12:12 -07:00
Larry Finger e0e3daddad staging: r8192e: Fix possible error in configuration
It is possible to misconfigure a kernel by selecting the rtllib crypto
routines without enabling the underlying support from the crypto library.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Acked-by: Sean MacLennan <seanm@seanm.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18 16:58:16 -07:00
Dan Carpenter 6b56d2459b Staging: rtl8192e: remove some dead code
We don't use the rxcmdpkt[] counters at all and we can remove them.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18 16:58:16 -07:00
Jim Cromie b330f606ed staging: replace open-coded ARRAY_SIZEs
spatch http://coccinelle.lip6.fr/rules/array.cocci did these.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 15:25:55 -07:00
Masanari Iida 73e2918990 staging: Fix typo in multiple files
Collect spelling typo in multiple files within staging directory.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 10:31:01 -07:00
Axel Köllhofer 96ddcd4398 staging/rtl8192e - fix typo in printk message
In drivers/staging/rtl8192e/rtl8192e/rtl_core.c the follwing printk-message can be found:

printk(KERN_ERR "rtl8193e: Unable to allocate space "

This is quite obviously just a typo, all other similar messages use
"rtl8192e" and the string "rtl8193e" does not occur anywhere else in the
source of the driver.

Signed-off-by:	Axel Koellhofer <AxelKoellhofer@web.de>

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 09:24:34 -07:00
Oleg Nesterov 70834d3070 usermodehelper: use UMH_WAIT_PROC consistently
A few call_usermodehelper() callers use the hardcoded constant instead of
the proper UMH_WAIT_PROC, fix them.

Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Lars Ellenberg <drbd-dev@lists.linbit.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Michal Januszewski <spock@gentoo.org>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Kentaro Takeda <takedakn@nttdata.co.jp>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: James Morris <jmorris@namei.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-03-23 16:58:41 -07:00