Commit graph

346 commits

Author SHA1 Message Date
Xenia Ragiadakou 08a4cdea19 staging: rtl8192u: replace __FUNCTION__ in r819xU_phy.c
This patch fixes the following checkpatch warning:
WARNING: __func__ should be used instead of gcc specific __FUNCTION__

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-24 16:08:33 -07:00
Xenia Ragiadakou 1db5aa0562 staging: rtl8192u: limit line size in r819xU_phy.c
This patch limits the line size below 80 characters,
when possible without producing new checkpatch errors.

This is done by adjusting identation, replacing hardcoded
function names in messages with __func__, merging some
trailing comments with the header comments when they both
refer to the same line and removing some unnecessary
parenthesis.

Also, changes slightly some RT_TRACE messages to make
them shorter without altering their content.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-24 16:08:32 -07:00
Xenia Ragiadakou 5f2392b865 staging: rtl8192u: fix comments in r819xU_phy.c
This patch fixes the comments in r819xU_phy.c by:
- replacing "// ..." with "/* .... */"
- removing unnecessary comments, the dates and names of
  developers from comments
- fixing some inconsistent comments
- fixing some typos
- fixing alignment issues

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-19 09:41:40 -07:00
Xenia Ragiadakou 83e6d9e262 staging: rtl8192u: fix spaces around ',' in r819xU_phy.c
This patch fixes the whitespace around ',' to meet the
linux kernel coding style.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-19 09:41:40 -07:00
Xenia Ragiadakou c4b5eb8c01 staging: rtl8192u: remove variable 'Ret' in r819xU_phy.c
This patch removes variable 'Ret' from rtl8192_QueryBBReg()
since its value is returned immediately after it is
assigned. The name 'Ret', anyway, does not give any
insight and the function description comment is sufficiently
informative regarding the returned value.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-19 09:41:39 -07:00
Xenia Ragiadakou 7993163901 staging: rtl8192u: rename general variables in r819xU_phy.c
This patch renames the following variables:
- dwRegAddr and RegAddr into reg_addr
- dwData and Data       into data
- BitShift              into bitshift
- Offset                into offset
- NewOffset             into new_offset
- Bandwidth             into bandwidth

The renaming was done to remove camel case and
unnecessary 'dw' prefix from the above variable names.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-18 11:32:39 -07:00
Xenia Ragiadakou 9f66ddb5f7 staging: rtl8192u: rename *BitMask variables in r819xU_phy.c
This patch renames BitMask and dwBitMask variables into
bitmask to remove camel case.
dwBitMask in the given context can be renamed into simply
bitmask since its number of bits (dw->32) can be deduced
by its type which is u32.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-18 11:32:39 -07:00
Xenia Ragiadakou 07ecbbf1a3 staging: rtl8192u: replace *Value variables in r819xU_phy.c
This patch renames the variables OriginalValue, NewValue,
Original_Value, New_Value and retValue to reg, and
the variables bRegValue and dwRegValue to reg_u8 and
reg_u32, respectively. This is done primarily in
order to reduce the variable name length and consequently
line length.

Also, it replaces the pair of Original and New variables
with one variable.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-18 11:32:39 -07:00
Xenia Ragiadakou 9d8e79ed32 staging: rtl8192u: fix spaces around relational operators in r819xU_phy.c
This patch fixes the whitespace around relational operators
to meet the linux kernel coding style.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-18 11:32:39 -07:00
Xenia Ragiadakou 111857c983 staging: rtl8192u: fix spaces around ';' in r819xU_phy.c
This patch fixes the whitespace around ';' to meet the
linux kernel coding style.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-18 11:32:38 -07:00
Xenia Ragiadakou ec5d319bbf staging: rtl8192u: fix spaces around '=' in r819xU_phy.c
This patch fixes the whitespace around the assignment
operator to meet linux kernel coding style.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-18 11:32:38 -07:00
Dave Jones 0c29359252 staging/rtl8192u: remove commented out __list_for_each usage
Also remove another commented out open-coded list manipulation while we're there.

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-18 11:22:58 -07:00
Isaku Yamahata a267a6041f staging/rtl8192u: convert skb->tail into skb_tail_pointer(skb)
The change set of 7a884dc "[SK_BUFF]: Convert skb->tail to sk_buff_data_t"
converted skb->tail from pointer into sk_buff_data_t.
Thus skb->tail is not always pointer, the area pointed by skb->tail
should be accessed via skb_tail_pointer().

Found by inspection. Compile tested only.

Cc: Simon Horman <horms@verge.net.au>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-06-17 17:12:21 -07:00
Xenia Ragiadakou 442543d78c staging: rtl8192u: fix function arguments position in r819xU_phy.c
This patch fixes the alignment of function arguments to make
it uniform across the driver trying to keep the line size
below 80 characters.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17 15:45:44 -07:00
Xenia Ragiadakou ceb5659758 staging: rtl8192u: fix spaces around ( and ) in r819xU_phy.c
This patch removes whitespace after ')' and before ')'
following the linux kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17 15:45:44 -07:00
Xenia Ragiadakou d75340eb05 staging: rtl8192u: remove commented-out code in r819xU_phy.c
This patch removes commented-out code to improve code
readability.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17 15:45:44 -07:00
Xenia Ragiadakou eadb188c78 staging: rtl8192u: fix spaces around for and while in r819xU_phy.c
This patch fixes whitespace around 'for' and 'while'
following the linux kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17 15:45:44 -07:00
Xenia Ragiadakou 1111b8769a staging: rtl8192u: fix spaces around 'if' in r819xU_phy.c
This patch fixes whitepace around 'if' following the linux
kernel coding style convention.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17 15:45:44 -07:00
Xenia Ragiadakou 4c8dd92620 staging: rtl8192u: fix return statements in r819xU_phy.c
This patch fixes the following checkpatch error:
ERROR: return is not a function, parentheses are not required

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17 15:45:43 -07:00
Xenia Ragiadakou 4a6094c317 staging: rtl8192u: fix braces in r819xU_phy.c
This patch fixes the brace position and the whitespace
around braces.

That corrects the following checkpatch errors:
ERROR: that open brace { should be on the previous line
ERROR: else should follow close brace '}'
ERROR: space required after that close brace '}'

Also, it removes completely an if(0) statement,
instead of correcting its braces.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17 15:45:43 -07:00
Xenia Ragiadakou 391c72a30b staging: rtl8192u: fix bitshift calculation in r819xU_phy.c
This patch uses the ffs linux built-in routine in the
computation of the bitshift to take advantage of
architecture specific instructions that implement this
computation more efficiently.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17 15:45:43 -07:00
Xenia Ragiadakou 4a8d113554 staging: rtl8192u: fix macros in r8192U.h
This patch fixes the macros in r8192U.h.
More specifically:

1) removes the ';' from the end of the macro definition
   and changes according the files that are affected by
   this change by adding ';' at the end of the macro call
2) replaces printk with pr_debug, when applicable
3) replaces __FUNCTION__ with __func__
4) fixes the framing when the macro contains complex expressions
5) renames macro 'assert' as 'RTL9192U_ASSERT', so that it
   cannot be confused with the c function assert(), and changes
   accordingly the files affected by this change

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-11 17:18:04 -07:00
Xenia Ragiadakou 631edcdc45 staging: rtl8192u: fix whitespace around '(=<, ' in r8192U.h
This parch fixes the following checkpatch errors:
ERROR: space required before the open parenthesis '('
ERROR: spaces required around that '='
ERROR: spaces required around that '<'
ERROR: space required after that ','

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-11 17:18:03 -07:00
Xenia Ragiadakou 2da4fc24f5 staging: rtl8192u: fix braces in r8192U.h
This patch fixes the whitespace around braces and brace
position, and corrects the following checkpatch errors:
ERROR: space required after that close brace '}'
ERROR: space required before the open brace '{'
ERROR: that open brace { should be on the previous line
ERROR: open brace '{' following enum go on the same line

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-11 17:18:03 -07:00
Xenia Ragiadakou 4e0be66853 staging: rtl8192u: fix comments in r8192U.h
This patch fixes the comments in r8192U.h by:

1) replacing '// ... ' comments with '/* ... */' comments
2) removing from the comments the date and the developer's name
3) removing unnecessary comments when variables naming is
   descriptive enough

Also, it fixes some typos found in the comments and arranges
the comments placement and content aiming to improve code
readability and to limit line length below 80 chars, without
loosing the comment's substance.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-11 17:18:02 -07:00
Xenia Ragiadakou 93a8265290 staging: rtl8192u: remove commented-out code in r8192U.h
This patch removes commented-out code to improve code
readability.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-11 17:18:01 -07:00
Xenia Ragiadakou b3d42bf187 staging: rtl8192u: fix read_nic_* functions
read_nic_*() functions are defined in r8192U_core.c.
They call internally usb_control_msg() to read the
nic registers and return the value read.
Following a remark made by Dan Carpenter, if usb_control_msg()
fails, the value returned will be invalid.

To accommodate for this, this patch changes the functions
to take a pointer as argument to set the value read and
return 0 on success and the error status on failure, so
that callers of read_nic_*() can check the return status.

Some other fixes introduced in read_nic_*() functions are:

The expressions (1<<EPROM_*_SHIFT) used to address and set
the individual bits of the eeprom register were replaced
with EPROM_*_BIT bitmasks to make the code more intuitive.
EPROM_*_BIT bitmasks were defined in r8192U_hw.h and
EPROM_*_SHIFT were removed.

In netdev_err(), which is called in case of failure,
the hardcoded function name in the error log message was
replaced with __func__ to reduce line size.
Also, from the error log message, it was omitted the word
"Timeout" and it is just reported the error code since the
failure can not only be due to timeout expiration but also
due to a memory allocation failure. In case of timeout
expiration, usb_start_wait_urb() prints an appropriate log
message when debug is enabled.

Finally, some minor fixes to the coding style were applied in
lines affected by the above changes, including the removal
of ifdef DEBUG_RX (the debugging of reads and writes of the
nic registers shall be done with explicit check on their
return status which will be added in a follow on patch).

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06 11:57:16 -07:00
Dan Carpenter c2ac90b9b4 Staging: rtl8192u: fix a reversed test
Sean MacLennan fixed this in the rtl8192e driver and we should fix
it here as well.

It's pretty harmless.  This information comes from the firmware, if
we were to hit this bug we would read beyond the end of the array
once or twice before returning and update our statistics with bogus
data.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06 11:57:15 -07:00
Xenia Ragiadakou f2c3d80097 staging: rtl8192u: replace macro rx_hal_is_cck_rate() in r8192U_core.c
This patch replaces macro rx_hal_is_cck_rate() with
the static inline function rx_hal_is_cck_rate().

This replacement was suggested by Dan Carpenter and
has the following benefits:
- improves code readability
- guarantees type safety
- improves code efficiency by enforcing the evaluation of
  the simple boolean expression (!pdrvinfo->RxHT) to be
  done before the evaluation of the more complex one
  (pdrvinfo->RxRate == DESC90_RATE1M ||
   pdrvinfo->RxRate == DESC90_RATE2M ||
   pdrvinfo->RxRate == DESC90_RATE5_5M ||
   pdrvinfo->RxRate == DESC90_RATE11M)

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05 15:37:22 -07:00
Xenia Ragiadakou 88e5a934d3 staging: rtl8192u: remove trailing whitespace in r8192U_core.c
This patch fixes the following checkpatch error:
ERROR: trailing whitespace

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05 15:37:22 -07:00
Xenia Ragiadakou 7d79ec6906 staging: rtl8192u: remove space before '++' in r8192U_core.c
This patch fixes the following checkpatch error:
ERROR: space prohibited before that '++'

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05 15:37:22 -07:00
Xenia Ragiadakou 003a2d18d7 staging: rtl8192u: remove space after reference '&' in r8192U_core.c
This patch fixes the following checkpatch error:
ERROR: space prohibited after that '&'

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05 15:37:21 -07:00
Xenia Ragiadakou 15f6d3a493 staging: rtl8192u: add spaces around ?:&&|| in r8192U_core.c
This patch fixes the following checkpatch errors:
ERROR: spaces required around that '?'
ERROR: spaces required around that ':'
ERROR: spaces required around that '&&'
ERROR: spaces required around that '||'

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05 15:37:21 -07:00
Xenia Ragiadakou 2c7c0c347c staging: rtl8192u: fix return statements in r8192U_core.c
This patch fixes the following checkpatch error:
ERROR: return is not a function, parentheses are not required

Also, fixes the spaces in return statements to
improve code readability.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05 15:37:21 -07:00
Xenia Ragiadakou b1753c43b0 staging: rtl8192u: fix spaces in array indexing in r8192U_core.c
This patch fixes the following checkpatch error:
ERROR: space prohibited before open square bracket '['

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05 15:37:21 -07:00
Xenia Ragiadakou 8f896d61dd staging: rtl8192u: fix identation in r8192U_core.c
This patch fixes identation and alignment in r8192U_core.c.
Also, removes spaces from idents when applicable.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reviewed-by: Dan Carpenter<dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-04 19:33:52 -07:00
Xenia Ragiadakou f0a60a147e staging: rtl8192u: remove unnecessary line continuations in r8192U_core.c
This patch fixes the following checkpatch warning:
WARNING: Avoid unnecessary line continuations

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reviewed-by: Dan Carpenter<dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-04 19:33:52 -07:00
Xenia Ragiadakou 70bdf8a2c5 staging: rtl8192u: fix function definitions' style in r8192U_core.c
This patch fixes the function definitions' style in order
to be uniform across the file and in compliance with the
linux kernel coding style.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reviewed-by: Dan Carpenter<dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-04 19:33:51 -07:00
Xenia Ragiadakou 2716141cd2 staging: rtl8192u: fix braces in r8192U_core.c
This patch fixes the position of braces and removes
redundant braces, following the kernel coding style
conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reviewed-by: Dan Carpenter<dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-04 19:33:50 -07:00
Xenia Ragiadakou 57c259fb6e staging: rtl8192u: remove dead and commented-out code in r8192U_core.c
This cleanup patch removes commented-out code and
the functions rtl8192_dump_reg() and print_buffer()
which are not called anywhere in the driver.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reviewed-by: Dan Carpenter<dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-04 19:33:49 -07:00
Xenia Ragiadakou d6bbce0642 rtl8192u: fix printk calls in r8192U_core.c
This patch replaces calls to printk with their
corresponding calls to pr_<loglevel>(fmt, ...)
and netdev_<loglevel>(dev, fmt, ...), when it
is applicable, to make the log messages more
informative.

Also, it fixes some small typos and whitespaces
found in log messages.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30 21:06:26 +09:00
Xenia Ragiadakou 972ff92fc5 rtl8192u: add space after '}' in r8192U_core.c
This patch fixes the following checkpatch error:
ERROR: space required after that close brace '}'

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-22 19:28:19 -07:00
Xenia Ragiadakou 5b3b215b62 rtl8192u: replace __FUNCTION__ with __func__ in r8192U_core.c
This patch fixes the following checkpatch warning:
WARNING: __func__ should be used instead of gcc
specific __FUNCTION__

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-22 19:28:17 -07:00
Xenia Ragiadakou e636721fd2 rtl8192u: remove space between function name and '(' in r8192U_core.c
This patch fixes the following checkpatch warning:
WARNING: space prohibited between function name and
open parenthesis '('

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-22 19:28:17 -07:00
Xenia Ragiadakou 3ab31c7bc5 rtl8192u: fix whitespace around ',' in r8192U_core.c
This patch fixes whitespace around ',' and corrects
the following checkpatch error:
ERROR: space required after that ','

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-22 15:34:33 -07:00
Xenia Ragiadakou 9f6bd88daf rtl8192u: fix whitespace after '(' and before ')' in r8192U_core.c
This patch removes whitespace after '(' and before ')'
following the kernel coding style.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-22 15:34:32 -07:00
Xenia Ragiadakou 3db3764625 rtl8192u: fix whitespace around ';' in r8192U_core.c
This patch fixes whitespace around ';' following kernel
coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-22 15:34:32 -07:00
Xenia Ragiadakou 204ecd3930 rtl8192u: fix whitespace around relational operators in r8192U_core.c
This patch fixes whitespace around relational operators
following the kernel coding style conventions.
It corrects the following checkpatch errors:
ERROR: spaces required around that '=='
ERROR: spaces required around that '!'
ERROR: spaces required around that '<='
ERROR: spaces required around that '>='
ERROR: spaces required around that '<'
ERROR: spaces required around that '>'

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-22 15:34:32 -07:00
Xenia Ragiadakou 2d39b00292 rtl8192u: fix whitespace around '=' in r8192U_core.c
This patch fixes the following checkpatch error:
ERROR: spaces required around that '='

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-22 15:34:32 -07:00
Xenia Ragiadakou 53c7f3cdba rtl8192u: fix whitespace around 'while' in r8192U_core.c
This patch fixes whitespace around 'while' following
the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-22 15:34:32 -07:00
Xenia Ragiadakou 212bff38c9 rtl8192u: fix whitespace around 'for' in r8192U_core.c
This patch fixes whitespace around 'for' following the
kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-22 15:34:32 -07:00
Xenia Ragiadakou 34fc438a09 rtl8192u: fix whitespace around 'if' in r8192U_core.c
This patch fixes whitespace around 'if' following the
kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-22 15:33:14 -07:00
Xenia Ragiadakou 0009631bc2 rtl8192u: remove whitespace after '(' and before ')' in r8192U_dm.c
This patch fixes the following checkpatch errors, in r8192U_dm.c:
ERROR: space prohibited after that open parenthesis '('
ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16 16:45:53 -07:00
Xenia Ragiadakou 66fe11cf00 rtl8192u: remove whitespace after '(' and before ')' in r8192U.h
This patch fixes the following checkpatch errors:
ERROR: space prohibited after that open parenthesis '('
ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16 16:45:51 -07:00
Xenia Ragiadakou 9948cade1d rtl8192u: remove whitespace after '(' and before ')' in r8190_rtl8256.c
This patch fixes the following checkpatch errors, in r8190_rtl8256.c:
ERROR: space prohibited after that open parenthesis '('
ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16 16:45:51 -07:00
Xenia Ragiadakou 33c2aa14a8 rtl8192u: fix whitespace around ~ in r8192U_dm.c
This patch fixes the following checkpatch error:
ERROR: space prohibited after that '~'

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16 16:44:50 -07:00
Xenia Ragiadakou 4b150936ea rtl8192u: fix whitespace around ~ in r8192U_core.c
This patch fixes the following checkpatch error:
ERROR: space prohibited after that '~'

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16 16:44:49 -07:00
Xenia Ragiadakou f97c26c0b0 rtl8192u: fix whitespace around ~ in r8180_93cx6.c
This patch fixes the whitespace around ~ and corrects the
following checkpatch error:
ERROR: space prohibited after that '~'

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16 16:44:49 -07:00
Xenia Ragiadakou 14bc0d4f07 rtl8192u: fix whitespace around if statements in r819xU_firmware.c
This patch fixes a part of the following checkpatch error:
ERROR: space required before the open parenthesis '('
by adding space after if

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16 16:43:34 -07:00
Xenia Ragiadakou a71d7679d7 rtl8192u: fix whitespace around if statements in r819xU_cmdpkt.c
This patch fixes a part of the following checkpatch error:
ERROR: space required before the open parenthesis '('
by adding space after if

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16 16:43:33 -07:00
Xenia Ragiadakou 0962f96441 rtl8192u: fix whitespace around if statements in r8192U.h
This patch fixes a part of the following checkpatch error:
ERROR: space required before the open parenthesis '('
by adding space after if

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16 16:43:26 -07:00
Xenia Ragiadakou fcd9f3596c rtl8192u: fix whitespace around if statements in r8180_93cx6.c
This patch fixes a part of the following checkpatch error:
ERROR: space required before the open parenthesis '('
by adding space after if

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16 16:43:10 -07:00
Xenia Ragiadakou ad6384591f STAGING: rtl8192u: fix checkpatch error by adding space after switch
This patch fixes the following checkpatch error:
ERROR: space required before the open parenthesis '('

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:17:58 -07:00
Xenia Ragiadakou 3c19fbb6d3 STAGING: rtl8192u/ieee80211: fix checkpatch error about pointer position in tl819x_TSProc.c
This patch fixes the pointer position in tl819x_TSProc.c
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:16:20 -07:00
Xenia Ragiadakou 2abe5a7a6e STAGING: rtl8192u/ieee80211: fix checkpatch error about pointer position in rtl819x_Qos.h
This patch fixes the pointer position in rtl819x_Qos.h
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:16:19 -07:00
Xenia Ragiadakou 2b16648c38 STAGING: rtl8192u/ieee80211: fix checkpatch error about pointer position in rtl819x_HTProc.c
This patch fixes the pointer position in rtl819x_HTProc.c
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:16:19 -07:00
Xenia Ragiadakou 0af6c0cb64 STAGING: rtl8192u/ieee80211: fix checkpatch error about pointer position in rtl819x_BAProc.c
This patch fixes the pointer position in rtl819x_BAProc.c
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:16:18 -07:00
Xenia Ragiadakou 5d279df167 STAGING: rtl8192u/ieee80211: fix checkpatch error about pointer position in dot11d
This patch fixes the pointer position in dot11d.h and dot11d.c
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:14:52 -07:00
Xenia Ragiadakou bdedc7504e STAGING: rtl8192u/ieee80211: fix checkpatch error about pointer position in ieee80211_tx.c
This patch fixes the pointer position in ieee80211_tx.c
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:14:51 -07:00
Xenia Ragiadakou 2639ae97a7 STAGING: rtl8192u/ieee80211: fix checkpatch error about pointer position in ieee80211_softmac.c
This patch fixes the pointer position in ieee80211_softmac.c
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:14:51 -07:00
Xenia Ragiadakou ea77527a45 STAGING: rtl8192u/ieee80211: fix checkpatch error about pointer position in ieee80211_rx.c
This patch fixes the pointer position in ieee80211_rx.c
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:14:51 -07:00
Xenia Ragiadakou f8bfab9e82 STAGING: rtl8192u/ieee80211: fix checkpatch error about pointer position in ieee80211_crypt_wep.c
This patch fixes the pointer position in ieee80211_crypt_wep.c
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:14:50 -07:00
Xenia Ragiadakou 8acfd58a4d STAGING: rtl8192u/ieee80211: fix checkpatch error about pointer position in ieee80211_crypt_tkip.c
This patch fixes the pointer position in ieee80211_crypt_tkip.c
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:14:50 -07:00
Xenia Ragiadakou 6560d4b9bc STAGING: rtl8192u/ieee80211: fix checkpatch error about pointer position in ieee80211_crypt_ccmp.c
This patch fixes the pointer position in ieee80211_crypt_ccmp.c
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:14:49 -07:00
Xenia Ragiadakou ff0d38cc10 STAGING: rtl8192u/ieee80211: fix checkpatch error about pointer position in ieee80211_crypt
This patch fixes the pointer position in ieee80211_crypt.h and
ieee80211_crypt.c to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:14:49 -07:00
Xenia Ragiadakou 347a890d5d STAGING: rtl8192u/ieee20811: fix checkpatch error about pointer position in ieee20811.h
This patch fixes the pointer position in ieee20811.h
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:14:48 -07:00
Xenia Ragiadakou e9082794cc STAGING: rtl8192u: fix checkpatch error about pointer position in r8192U.h
This patch fixes the pointer position in r8192U.h
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:11:50 -07:00
Xenia Ragiadakou b81c2b0a33 STAGING: rtl8192u: fix checkpatch error about pointer position in r8192U_wx.c
This patch fixes the pointer position in r8192U_wx.c
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:11:49 -07:00
Xenia Ragiadakou 959674e3bd STAGING: rtl8192u: fix checkpatch error about pointer position in r8190_rtl8256
This patch fixes the pointer position in r8190_rtl8256.h and r8190_rtl8256.c
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:11:48 -07:00
Xenia Ragiadakou 88d8fe2943 STAGING: rtl8192u: fix checkpatch error about pointer position in r819xU_phy
This patch fixes the pointer position in r819xU_phy.h and r819xU_phy.c
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:11:48 -07:00
Xenia Ragiadakou 12fbccbe18 STAGING: rtl8192u: fix checkpatch error about pointer position in r819xU_firmware.c
This patch fixes the pointer position in r819xU_firmware.c
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:11:48 -07:00
Xenia Ragiadakou 9772acad08 STAGING: rtl8192u: fix checkpatch error about pointer position in r819xU_cmdpkt
This patch fixes the pointer position in r819xU_cmdpkt.h and r819xU_cmdpkt.c
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:11:47 -07:00
Xenia Ragiadakou 999d594b78 STAGING: rtl8192u: fix checkpatch error about pointer position in r8192U_dm.c
This patch fixes the pointer position in r8192U_dm.c
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-12 08:42:50 -07:00
Xenia Ragiadakou 9f7b830033 STAGING: rtl8192u: fix checkpatch error about pointer position in r8192U_core.c
This patch fixes the pointer position in r8192U_core.c
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-12 08:42:50 -07:00
Al Viro bae301d346 staging: single_open() leaks
Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-05 00:15:43 -04:00
Linus Torvalds 20b4fb4852 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull VFS updates from Al Viro,

Misc cleanups all over the place, mainly wrt /proc interfaces (switch
create_proc_entry to proc_create(), get rid of the deprecated
create_proc_read_entry() in favor of using proc_create_data() and
seq_file etc).

7kloc removed.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits)
  don't bother with deferred freeing of fdtables
  proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h
  proc: Make the PROC_I() and PDE() macros internal to procfs
  proc: Supply a function to remove a proc entry by PDE
  take cgroup_open() and cpuset_open() to fs/proc/base.c
  ppc: Clean up scanlog
  ppc: Clean up rtas_flash driver somewhat
  hostap: proc: Use remove_proc_subtree()
  drm: proc: Use remove_proc_subtree()
  drm: proc: Use minor->index to label things, not PDE->name
  drm: Constify drm_proc_list[]
  zoran: Don't print proc_dir_entry data in debug
  reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show()
  proc: Supply an accessor for getting the data from a PDE's parent
  airo: Use remove_proc_subtree()
  rtl8192u: Don't need to save device proc dir PDE
  rtl8187se: Use a dir under /proc/net/r8180/
  proc: Add proc_mkdir_data()
  proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h}
  proc: Move PDE_NET() to fs/proc/proc_net.c
  ...
2013-05-01 17:51:54 -07:00
David Howells 4a520d2769 proc: Supply an accessor for getting the data from a PDE's parent
Supply an accessor function for getting the private data from the parent
proc_dir_entry struct of the proc_dir_entry struct associated with an inode.

ReiserFS, for instance, stores the super_block pointer in the proc directory
it makes for that super_block, and a pointer to the respective seq_file show
function in each of the proc files in that directory.

This allows a reduction in the number of file_operations structs, open
functions and seq_operations structs required.  The problem otherwise is that
each show function requires two pieces of data but only has storage for one
per PDE (and this has no release function).

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: Jerry Chuang <jerry-chuang@realtek.com>
cc: Maxim Mikityanskiy <maxtram95@gmail.com>
cc: YAMANE Toshiaki <yamanetoshi@gmail.com>
cc: linux-wireless@vger.kernel.org
cc: linux-scsi@vger.kernel.org
cc: devel@driverdev.osuosl.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01 17:29:42 -04:00
David Howells cc87e0fff1 rtl8192u: Don't need to save device proc dir PDE
Don't need to save the PDE of a directory created under /proc/net/rtl8192/ as
we can use proc subtree deletion to get rid of it and all its children.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: Jerry Chuang <jerry-chuang@realtek.com>
cc: linux-wireless@vger.kernel.org
cc: devel@driverdev.osuosl.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01 17:29:41 -04:00
David Howells 270b5ac215 proc: Add proc_mkdir_data()
Add proc_mkdir_data() to allow procfs directories to be created that are
annotated at the time of creation with private data rather than doing this
post-creation.  This means no access is then required to the proc_dir_entry
struct to set this.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: Neela Syam Kolli <megaraidlinux@lsi.com>
cc: Jerry Chuang <jerry-chuang@realtek.com>
cc: linux-scsi@vger.kernel.org
cc: devel@driverdev.osuosl.org
cc: linux-wireless@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-01 17:29:41 -04:00
David Howells 0541f9d08a rtl8192u: 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.  Whilst we're at it, reduce the
number of show functions where we can share them.

Note: proc_get_stats_ap() should probably use seq_file iteration rather than
list_for_each_entry().

Further note: There appears to be a lot of locking missing in this file to
defend against concurrent access by the driver doing normal operations.
Notably, ieee->network_list traversal and RWCAM/RCAMO command/response access.
Further, do any of the registers read have side effects upon reading?

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Jerry Chuang <jerry-chuang@realtek.com>
cc: Mauro Carvalho Chehab <mchehab@redhat.com>
cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: linux-wireless@vger.kernel.org
cc: devel@driverdev.osuosl.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:50 -04:00
Al Viro 75ef9de126 constify a bunch of struct file_operations instances
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:16:20 -04:00
Al Viro 78846ce66d rtl8192u: switch to proc_create()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:13:30 -04:00
Al Viro 5a787a6820 rtl8192u: don't play with reassigning ->proc_fops, just use proc_create()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:13:09 -04:00
Haksu Jeong ab4a640efb staging: rtl8192u: fix coding style
Fix coding style of r8192U_dm.h

Signed-off-by: Haksu Jeong <hsjeong@snu.ac.kr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28 16:07:25 -07:00
Peter Huewe 67a88e6390 staging/rtl8192u/ieee80211: Fix buffer overflow in ieee80211_softmac_wx.c
Clang/scan-build complains about a possible buffer overflow in
ieee80211_wx_get_name:

.../staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c:499:3:
warning: String copy function overflows destination buffer
	strcat(wrqu->name," link..");

.../staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c:497:3:
warning: String copy function overflows destination buffer
	strcat(wrqu->name," linked");

The buffer wrqu->name is only IFNAMSIZ bytes big (currently 16),
so if we have a "802.11b/g/n linked" device we overrun the buffer by 3
bytes.

-> Use strlcopy / strlcat to populate the name.
This is done in a similar fashion in
staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c

While at it cleaned some whitespace issues.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-14 09:26:23 -08:00
Patrik Karlin 666b3bf2f1 staging: rtl8192u: fixed coding style issues in r8192U_core.c
This patch fixes some coding style issuses in r8192U_core.c
No logic is changed

Signed-off-by: Patrik Kårlin <patrik.karlin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-11 16:37:11 -08:00
Patrik Karlin 29b48ae391 staging: rtl8192u: removed some non used else's
This patch removes some else blocks that has no function in the
code

Signed-off-by: Patrik Kårlin <patrik.karlin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-11 16:37:11 -08:00
Patrik Karlin f00c493b51 staging: rtl8192u: fixed some coding style issues in r8192U_core.c
This patch fixes some coding style issues. in r8192U_core.c
No logic is changed.

Signed-off-by: Patrik Kårlin <patrik.karlin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-11 16:37:11 -08:00
Sebastian Hahn de13a3dad6 staging/rtl8192u: do not init statics to 0
Fix the checkpatch error "do not initialize statics to 0 or NULL"

Signed-off-by: Sebastian Hahn <snsehahn@cip.cs.fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 12:53:41 -08:00
Sebastian Hahn 24fbe87525 staging/rtl8192u: use same indent for switch and case
Fix the checkpatch error "switch and case should be at the same indent"

Signed-off-by: Sebastian Hahn <snsehahn@cip.cs.fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 12:53:41 -08:00
Sebastian Hahn c4cda30469 staging/rtl8192u: don't init globals to 0 or NULL
Fix a couple of instances where checkpatch complained about
initializing globals with 0.

Signed-off-by: Sebastian Hahn <snsehahn@cip.cs.fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 12:53:41 -08:00
Sebastian Hahn fdc64a9eda staging/rtl8192u: indent with tabs, not spaces
Converted staging/rtl8187se to use tabs instead of spaces for
indentation to fix the checkpatch error "code indent should use tabs
where possible".

Signed-off-by: Sebastian Hahn <snsehahn@cip.cs.fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 12:53:40 -08:00
Jennifer Naumann 0db7a34e6c staging/rtl8192u: put { on same line as struct
This fixes the checkpatch error "open brace '{' following struct go on the
same line" in staging/rtl8192u

Signed-off-by: Jennifer Naumann <Jennifer.Naumann@informatik.stud.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 12:53:40 -08:00
Sebastian Hahn 35997ff0ca staging/rtl8192u: cleanfile run
Run cleanfile on all files inside drivers/staging/rtl819u

Signed-off-by: Sebastian Hahn <snsehahn@cip.cs.fau.de>
Signed-off-by: Jennifer Naumann <Jennifer.Naumann@informatik.stud.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 12:52:58 -08:00
Bill Pemberton a4a557e3d4 staging: rtl8192u: 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:43 -08:00
Bill Pemberton 2579452a6d staging: rtl8192u: 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
Dan Carpenter cbf2f545d7 staging: rtl8192u: fix a macro expansion bug
Clang detected this macro expansion bug:
drivers/staging/rtl8192u/r8192U_core.c:2384:76: warning: operator '?:'
	has lower precedence than '+'; '+' will be evaluated first
	[-Wparentheses]

The line from the .c file looks like this:
	u1bAIFS = qos_parameters->aifs[i] * ((mode&(IEEE_G|IEEE_N_24G)) ?9:20) + aSifsTime;

We need to put parenthesis around the entire macro to fix the bug.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 11:39:22 -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
Peter Senna Tschudin 2e464f0068 drivers/staging/rtl8192u/r8192U_core.c: Remove useless kfree
Remove useless kfree() and clean up code related to the removal.

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

// <smpl>
@r exists@
position p1,p2;
expression x;
@@

if (x@p1 == NULL) { ... kfree@p2(x); ... return ...; }

@unchanged exists@
position r.p1,r.p2;
expression e <= r.x,x,e1;
iterator I;
statement S;
@@

if (x@p1 == NULL) { ... when != I(x,...) S
                        when != e = e1
                        when != e += e1
                        when != e -= e1
                        when != ++e
                        when != --e
                        when != e++
                        when != e--
                        when != &e
   kfree@p2(x); ... return ...; }

@ok depends on unchanged exists@
position any r.p1;
position r.p2;
expression x;
@@

... when != true x@p1 == NULL
kfree@p2(x);

@depends on !ok && unchanged@
position r.p2;
expression x;
@@

*kfree@p2(x);
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12 09:43:45 -07:00
Wei Yongjun 37905ae131 Staging: rtl8192u: 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:29 -07:00
Devendra Naga b7553423cd staging: rtl8192u: use kzalloc to allocate firmware pointer
the firmware pointer is allocated with kmalloc and memset,
instead we can just do a kzalloc which will return a memory that
has been memset.

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 f6aa782f25 Staging: rtl8192u: 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 8cfbc9dcde Staging: rtl8192u: 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
Masanari Iida 935d59ff25 staging: rtl8192u: Fix typo in staging/rtl8192u
Correct spelling typo in staging/rtl8192u

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
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 8ef3a7ed35 staging:rtl8192u Fix typos and comments
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-01 21:50:58 -07:00
Justin P. Mattock ffae3055d2 staging: rtl8192u Fix a typo.
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-01 21:50:09 -07:00
Justin P. Mattock 589b3d06fd staging: rtl8192u Fix typos.
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-30 10:48:48 -04:00
Julia Lawall 89f5e7102a drivers/staging/rtl8192u/ieee80211/ieee80211_module.c: add missing free_netdev
Free dev on failure as done elsewhere in the function.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24 11:28:25 -07:00
Dan Carpenter f7738eda21 Staging: rtl8192u: fix some memory corruption
When we received a command we incremented a stat counter depending on
the type of message.  The problem is there were 8 types of commands but
there were only 4 counters allocated so it corrupted memory past the
end of the rxcmdpkt[] array.

The fix is just to remove the counters because they aren't used.

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
Linus Torvalds 9f3938346a Merge branch 'kmap_atomic' of git://github.com/congwang/linux
Pull kmap_atomic cleanup from Cong Wang.

It's been in -next for a long time, and it gets rid of the (no longer
used) second argument to k[un]map_atomic().

Fix up a few trivial conflicts in various drivers, and do an "evil
merge" to catch some new uses that have come in since Cong's tree.

* 'kmap_atomic' of git://github.com/congwang/linux: (59 commits)
  feature-removal-schedule.txt: schedule the deprecated form of kmap_atomic() for removal
  highmem: kill all __kmap_atomic() [swarren@nvidia.com: highmem: Fix ARM build break due to __kmap_atomic rename]
  drbd: remove the second argument of k[un]map_atomic()
  zcache: remove the second argument of k[un]map_atomic()
  gma500: remove the second argument of k[un]map_atomic()
  dm: remove the second argument of k[un]map_atomic()
  tomoyo: remove the second argument of k[un]map_atomic()
  sunrpc: remove the second argument of k[un]map_atomic()
  rds: remove the second argument of k[un]map_atomic()
  net: remove the second argument of k[un]map_atomic()
  mm: remove the second argument of k[un]map_atomic()
  lib: remove the second argument of k[un]map_atomic()
  power: remove the second argument of k[un]map_atomic()
  kdb: remove the second argument of k[un]map_atomic()
  udf: remove the second argument of k[un]map_atomic()
  ubifs: remove the second argument of k[un]map_atomic()
  squashfs: remove the second argument of k[un]map_atomic()
  reiserfs: remove the second argument of k[un]map_atomic()
  ocfs2: remove the second argument of k[un]map_atomic()
  ntfs: remove the second argument of k[un]map_atomic()
  ...
2012-03-21 09:40:26 -07:00
Cong Wang e3debd2763 rtl8192u: remove the second argument of k[un]map_atomic()
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Cong Wang <amwang@redhat.com>
2012-03-20 21:48:20 +08:00
Martin Krause 07b99cf55c Staging: rtl8712/rtl8192u: move USB device ID within staging drivers.
It seems the USB device ID 0bda:8192 is wrongly assigned to the
RTL8192SU chip and not to the RTL8191SU chip in the USB database.
So this patch moves this device ID from the rtl8192u staging
driver to the rtl8712 staging driver.

This patch was tested with a Radicom WIFIHU embedded wireless
module with a RTL8191SU chip and the USB device ID 0bda:8192.
Without the patch the rtl8192u driver claims this device, but
it does not work. With the patch the rtl8712 driver services
this device and it works.

Signed-off-by: Martin Krause <martin.krause@tqs.de>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-02 16:36:38 -08:00
Masanari Iida d0bc218b0a staging: Fix typo in ieee80211_rx.c
Correct spelling "suppported" to "supported" in
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c

Signed-off-by: Masanari iida<standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 09:51:17 -08:00
Greg Kroah-Hartman 53b99be764 Staging: rtl8192u: remove api.c file
It wasn't being used, and had a hacked-up export symbol table which
wasn't very nice either.

Reported-by: James Morris <jmorris@namei.org>
Cc: Herbert Xu <herbert@gondor.hengli.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:25:54 -08:00
Linus Torvalds aa77677e0a Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
* 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1519 commits)
  staging: et131x: Remove redundant check and return statement
  staging: et131x: Mainly whitespace changes to appease checkpatch
  staging: et131x: Remove last of the forward declarations
  staging: et131x: Remove even more forward declarations
  staging: et131x: Remove yet more forward declarations
  staging: et131x: Remove more forward declarations
  staging: et131x: Remove forward declaration of et131x_adapter_setup
  staging: et131x: Remove some forward declarations
  staging: et131x: Remove unused rx_ring.recv_packet_pool
  staging: et131x: Remove call to find pci pm capability
  staging: et131x: Remove redundant et131x_reset_recv() call
  staging: et131x: Remove unused rx_ring.recv_buffer_pool
  Staging: bcm: Fix three initialization errors in InterfaceDld.c
  Staging: bcm: Fix coding style issues in InterfaceDld.c
  staging:iio:dac: Add AD5360 driver
  staging:iio:trigger:bfin-timer: Fix compile error
  Staging: vt6655: add some range checks before memcpy()
  Staging: vt6655: whitespace fixes to iotcl.c
  Staging: vt6656: add some range checks before memcpy()
  Staging: vt6656: whitespace cleanups in ioctl.c
  ...

Fix up conflicts in:
 - drivers/{Kconfig,Makefile}, drivers/staging/{Kconfig,Makefile}:
	vg driver movement
 - drivers/staging/brcm80211/brcmfmac/{dhd_linux.c,mac80211_if.c}:
	driver removal vs now stale changes
 - drivers/staging/rtl8192e/r8192E_core.c:
	driver removal vs now stale changes
 - drivers/staging/et131x/et131*:
	driver consolidation into one file, tried to do fixups
2011-10-26 15:39:02 +02:00
Greg Kroah-Hartman 4535743304 Staging: rtl8192u: ieee80211: Makefile: remove unneeded stuff
There's a lot of unused and unneeded things in this makefile, so delete
it all.

Reported-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-18 13:36:18 -07:00
Jesper Juhl 58af58007e drivers/staging/rtl8192u: Don't pass huge struct by value
struct ieee80211_network is fairly large (more than half a kilobyte),
so let's pass a pointer instead of passing the entire structure by
value when ieee80211_is_54g() and ieee80211_is_shortslot() need to
look at a few members.
Also remove parentheses around the values being returned from those
two functions - 'return' is not a function.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 14:46:05 -07:00
Toon Schoenmakers 796fd547cf staging: rtl8192u: Follow all suggestions from checkpatch on compress.c
Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 13:27:28 -07:00
David S. Miller 823dcd2506 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net 2011-08-20 10:39:12 -07:00
Jiri Pirko afc4b13df1 net: remove use of ndo_set_multicast_list in drivers
replace it by ndo_set_rx_mode

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-08-17 20:22:03 -07:00
Stefan Lippers-Hollmann 589c3ca00b staging: rtl8192u: declare MODULE_FIRMWARE
declaring MODULE_FIRMWARE has apparently forgotten while removing the embedded
firmware arrays in 0a8692b534 (rtl8192u_usb:
Remove built-in firmware images).

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Cc: stable <stable@kernel.org> [2.6.39+]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-02 16:07:50 -07:00
Linus Torvalds 1380516599 Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (741 commits)
  staging:iio:meter:ade7753 should be 16 bit read not 8 bit for mode register.
  staging:iio:kfifo_buf fix double initialization of the ring device structure.
  staging:iio:accel:lis3l02dq: fix incorrect pointer passed to spi_set_drvdata.
  staging:iio:imu fix missing register table index for some channels
  spectra: enable device before poking it
  staging: rts_pstor: Fix a miswriting
  staging/lirc_bt829: Return -ENODEV when no hardware is found.
  staging/lirc_parallel: remove pointless prototypes.
  staging/lirc_parallel: fix panic on rmmod
  staging:iio:adc:ad7476: Incorrect pointer into spi_set_drvdata.
  Staging: zram: Fix kunmapping order
  Revert "gma500: Fix dependencies"
  gma500: Add medfield header
  gma500: wire up the mrst i2c bus from chip_info
  gma500: Fix DPU build
  gma500: Clean up the DPU config and make it runtime
  gma500: resync with Medfield progress
  gma500: Use the mrst helpers and power control for mode commit
  gma500@ Fix backlight range error
  gma500: More Moorestown muddle meddling means MM maybe might modeset
  ...

Fix up fairly trivial conflicts all over, mostly due to header file
cleanup conflicts, but some deleted files and some just context changes:
 - Documentation/feature-removal-schedule.txt
 - drivers/staging/bcm/headers.h
 - drivers/staging/brcm80211/brcmfmac/dhd_linux.c
 - drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
 - drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
 - drivers/staging/brcm80211/brcmfmac/wl_iw.c
 - drivers/staging/et131x/et131x_netdev.c
 - drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
 - drivers/staging/rtl8192e/r8192E.h
 - drivers/staging/usbip/userspace/src/utils.h
2011-07-25 23:26:34 -07:00
Al Viro e55d92b92d get rid of create_proc_entry() abuses - proc_mkdir() is there for purpose
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2011-07-24 10:12:33 -04:00
Justin P. Mattock 94c97e8e06 drivers:staging:rtl typo fix encryptiong to encryption.
This patch fixes a typo.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08 14:15:05 -07:00
Larry Finger 20a45d6629 staging: rtl8192u: Fix big-endian warning
When compiling the rtl8192u driver from staging on a big-endian
architecture, the following warning results:

  CC [M]  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.o
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c: In function 'ieee80211_probe_resp':
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:780: warning: value computed is not used

The warning is due to misuse of cpu_to_le16().

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 19:59:48 -07:00
Jesper Juhl 41134db17a Remove unneeded version.h includes from drivers/staging/rtl*/
It was pointed out by 'make versioncheck' that some includes of
linux/version.h are not needed in drivers/staging/rtl8187se/,
drivers/staging/rtl8192e/, drivers/staging/rtl8192u/ &
drivers/staging/rtl8712/.
This patch removes them.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 10:39:40 -07:00
Wanlong Gao ad3a245c35 drivers:rtl8192u:remove the use of obsolete create_workqueue in ieee80211_softmac.c
Remove the use of obsolete create_workqueue(name, 0) interface
in ieee80211_softmac.c, since it has changed.

Signed-off-by: Wanlong Gao <wanlong.gao@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 10:19:40 -07:00
Wanlong Gao 2e8b6b4785 drivers:rtl8192u:remove the use of obsolete create_workqueue in r8192U_core.c
Remove the use of obsolete create_workqueue(name, 0) interface
in r8192U_core.c, since it has changed.

Signed-off-by: Wanlong Gao <wanlong.gao@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 10:19:40 -07:00
Stephen Rothwell 219eb47e6f net/staging: add needed interrupt.h and hardirq.h includes
Made necessary by commit a6b7a40786 ("net: remove
interrupt.h inclusion from netdevice.h").

Fixes these build errors:

drivers/staging/brcm80211/brcmfmac/dhd_linux.c:1212:3: error: implicit declaration of function 'in_interrupt'
drivers/staging/brcm80211/brcmfmac/dhd_linux.c:1390:4: error: implicit declaration of function 'tasklet_schedule'
drivers/staging/brcm80211/brcmfmac/dhd_linux.c:1988:3: error: implicit declaration of function 'tasklet_init'
drivers/staging/brcm80211/brcmfmac/dhd_linux.c:2288:5: error: implicit declaration of function 'tasklet_kill'
drivers/staging/brcm80211/brcmfmac/dhd_linux.c:232:24: error: field 'tasklet' has incomplete type
drivers/staging/brcm80211/brcmfmac/wl_iw.c:3670:2: error: implicit declaration of function 'in_interrupt'
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c:1349:3: error: implicit declaration of function 'free_irq'
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c:1352:2: error: implicit declaration of function 'tasklet_kill'
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c:1538:4: error: implicit declaration of function 'tasklet_schedule'
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c:765:2: error: implicit declaration of function 'tasklet_init'
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c:817:2: error: implicit declaration of function 'request_irq'
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c:817:31: error: 'IRQF_SHARED' undeclared (first use in this function)
drivers/staging/brcm80211/brcmsmac/wl_mac80211.h:65:24: error: field 'tasklet' has incomplete type
drivers/staging/rtl8187se/ieee80211/ieee80211.h:994:24: error: field 'ps_task' has incomplete type
drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c:1790:3: error: implicit declaration of function 'tasklet_schedule'
drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c:2590:2: error: implicit declaration of function 'tasklet_init'
drivers/staging/rtl8187se/r8180.h:461:24: error: field 'irq_rx_tasklet' has incomplete type
drivers/staging/rtl8187se/r8180_core.c:2764:2: error: implicit declaration of function 'tasklet_init'
drivers/staging/rtl8187se/r8180_core.c:2954:2: error: implicit declaration of function 'request_irq'
drivers/staging/rtl8187se/r8180_core.c:2954:55: error: 'IRQF_SHARED' undeclared (first use in this function)
drivers/staging/rtl8187se/r8180_core.c:3641:4: error: implicit declaration of function 'free_irq'
drivers/staging/rtl8187se/r8180_core.c:4026:3: error: implicit declaration of function 'tasklet_schedule'
drivers/staging/rtl8192e/ieee80211/ieee80211.h:2000:24: error: field 'ps_task' has incomplete type
drivers/staging/rtl8192e/r8192E.h:909:24: error: field 'irq_rx_tasklet' has incomplete type
drivers/staging/rtl8192e/r8192E.h:910:24: error: field 'irq_tx_tasklet' has incomplete type
drivers/staging/rtl8192e/r8192E.h:911:31: error: field 'irq_prepare_beacon_tasklet' has incomplete type
drivers/staging/rtl8192e/r8192E_core.c:2008:2: error: implicit declaration of function 'tasklet_init'
drivers/staging/rtl8192e/r8192E_core.c:2412:54: error: 'IRQF_SHARED' undeclared (first use in this function)
drivers/staging/rtl8192e/r8192E_core.c:2412:9: error: implicit declaration of function 'request_irq'
drivers/staging/rtl8192e/r8192E_core.c:4640:4: error: implicit declaration of function 'free_irq'
drivers/staging/rtl8192e/r8192E_core.c:620:2: error: implicit declaration of function 'synchronize_irq'
drivers/staging/rtl8192e/r8192E_core.c:913:3: error: implicit declaration of function 'tasklet_schedule'
drivers/staging/rtl8192u/ieee80211/ieee80211.h:1993:24: error: field 'ps_task' has incomplete type

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-19 22:41:59 -07:00
Linus Torvalds df9b29d13e Merge branch 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (28 commits)
  staging: usbip: bugfix for isochronous packets and optimization
  staging: usbip: bugfix add number of packets for isochronous frames
  staging: usbip: bugfixes related to kthread conversion
  staging: usbip: fix shutdown problems.
  staging: hv: Fix GARP not sent after Quick Migration
  staging: IIO: IMU: ADIS16400: Avoid using printk facility directly
  staging: IIO: IMU: ADIS16400: Fix product ID check, skip embedded revision number
  staging: IIO: IMU: ADIS16400: Make sure only enabled scan_elements are pushed into the ring
  staging: IIO: IMU: ADIS16400: Fix addresses of GYRO and ACCEL calibration offset
  staging: IIO: IMU: ADIS16400: Add delay after self test
  staging: IIO: IMU: ADIS16400: Fix up SPI messages cs_change behavior
  staging/rtl81*: build as loadable modules only
  staging: brcm80211: removed 'is_amsdu causing toss' log spam
  staging: brcm80211: fix for 'Short CCK' log spam
  staging: brcm80211: fix for 'AC_BE txop..' logs spammed problem
  staging: memrar: remove driver from tree
  staging: sep: remove last memrar remnants
  staging: fix hv_mouse build, needs delay.h
  staging: fix olpc_dcon build errors
  staging: sm7xx: fixed defines
  ...

Fix up trivial conflict in drivers/staging/memrar/memrar_handler.c
(deleted vs trivial spelling fixes)
2011-04-07 11:36:44 -07:00
Randy Dunlap 84ba253b07 staging/rtl81*: build as loadable modules only
These 3 drivers contain much duplicated (triplicated) code, so
building them as built-in results in many errors like:

(.text+0x1b160): multiple definition of `ieee80211_sta_ps_sleep'

Prevent this configuration by making them all buildable only as
loadable modules (similar to the vt665[56] patch last week).

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-04 22:46:15 -07:00
Lucas De Marchi 25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Ilia Mirkin e72714fb20 staging: rtl8192u: Remove NULL check before kfree
This patch was generated by the following semantic patch:
// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);

@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-14 11:57:35 -07:00
Ben Hutchings 0a8692b534 rtl8192u_usb: Remove built-in firmware images
These firmware images are already unused.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-21 12:19:11 -08:00
Dan Carpenter e91eb2ff1f Staging: rtl8192u: add missing curly braces
The if condition was ignored in the original code and we just used the
default channel.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-10 10:39:55 -08:00
David Chosrova b834517572 Staging: rtl8192u: check return code kmalloc.
This patch checks the return code of  kmalloc when trying to allocate
memory for priv->rx_urb in rtl8192_usb_initendpoints(), return -ENOMEM
when failed.

Signed-off-by: David Chosrova <david.chosrova@libertysurf.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-01 14:53:34 -08:00
David Chosrova 0e7a3e7a74 Staging: rtl8192u: remove dead code to disable dot11d
This patch removes all the ENABLE_DOT11D ifdefs.
It is always defined for driver. DOT11D has to do with regulatory domains.

What prompted this patch was a warning message in Sparse.

drivers/staging/rtl8192u/r8192U_core.c:247:1: warning: "eqMacAddr"
redefined in file included from drivers/staging/rtl8192u/:81:81:
drivers/staging/rtl8192u/dot11d.h:35:1: warning: this is the location
of the previous definition

Now there are no ifdefs around dot11d.h it made no sense to have this
second definition, so I removed that macro as well. ( Thanks Dan ;-) ).

Acked-by. Dan Carpenter <error27@gmail.com>
Signed-off-by: David Chosrova <dada2372@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-01 14:51:16 -08:00
Joe Perches 859171ca92 drivers/staging: Remove unnecessary semicolons
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 12:06:47 -08:00
Uwe Kleine-König af02b584bc Staging: trivial: fix typos concerning "controller"
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09 15:17:18 -08:00
Tracey Dent aad6b18141 Staging: rtl8192u: Makefile: replace the use of <module>-objs with <module>-y
Changed <module>-objs to <module>-y in Makefile.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:23:42 -07:00
Tracey Dent 07dea29a11 Staging: rtl8192u: Makefile: cleaned up Makefile cflag lines
Changed to use the proper ccflags-y option

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 12:02:53 -07:00
Tracey Dent 8138d41632 Staging: rtl8192u: ieee80211: Makefile: cleaned up Makefile cflag lines
Changed to use the proper ccflags-y option

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05 11:56:38 -07:00
Vasiliy Kulikov 2fac6c290f staging: rtl8192u: improve error path
Functions alloc_ieee80211 and register_netdev may fail. Check for it.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-05 16:59:50 -07:00
Uwe Kleine-König 9b0131cb24 staging/trivial: fix typos concerning "initiali[zs]e"
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-04 21:23:26 -07:00
Julia Lawall 4498dbcd2d staging: rtl8193*: Remove double test
The 1 element of the array is tested twice.  Change the code so that the
remaining 3 element of the array is tested instead of testing the 1 element
a second time.

The sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@expression@
expression E;
@@

(
* E
  || ... || E
|
* E
  && ... && E
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 15:22:37 -07:00
Stefan Weil 39831861ff Staging: rtl81*: Fix spelling fuction -> function in comments
Obviously the wrong spelling was copied a lot of times.

A similar patch for the non-staging part of linux
is committed by Jiri Kosina.

Cc: devel@driverdev.osuosl.org
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 15:05:13 -07:00
Greg Kroah-Hartman e9563355ac Staging: Merge staging-next into Linus's tree
Conflicts:
	drivers/staging/Kconfig
	drivers/staging/batman-adv/bat_sysfs.c
	drivers/staging/batman-adv/device.c
	drivers/staging/batman-adv/hard-interface.c
	drivers/staging/cx25821/cx25821-audups11.c

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-05 14:18:03 -07:00
Kulikov Vasiliy f079bc3021 Staging: rtl8192u: use ARRAY_SIZE
Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x).

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-08 13:30:42 -07:00
Dave Jones 2addf798e4 Staging: rtl8192u: remove a copy of 80211.h
We had a request to enable one of the realtek network drivers in staging in Fedora.
After a quick lookover, I decided this wasn't such a great idea.

In doing so though, I noticed we have 6 copies of ieee80211.h there now,
Two drivers even have two copies of it.  (Even worse, cleanups have been pointlessly
happening to both files).  The patch below removes one of them, which is asides
from whitespace, identical afaics. With a change of filename to the #include,
it all still compiles for me.

A better fix would be to remove both, and have them use the core ieee80211 stuff,
but this is at least a tiny step in the right direction.

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-08 13:25:30 -07:00
Ben Hutchings e10ac15582 Staging: rtl8192u_usb: Add LG device ID 043e:7a01
Add another device ID as listed in the vendor driver version
0003.0825.2009.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-30 08:18:15 -07:00
Mike Gilks 616f58f6ec staging: rtl8192u: fix checkpatch.pl issues to line 514
Fixed most problems pointed out by checkpatch.pl in file r8192U_core.c
up to line 500

Signed-off-by: Mike Gilks <mike.kernel@gilksonline.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 16:49:02 -07:00
Andreas Herrmann 0374e91c90 Staging: rtl81xx: Fix build problems when CONFIG_CRYPTO=n
Select CONFIG_CRYPTO for all rtl81xx wireless drivers

... to avoid build problems like:

ERROR: "crypto_destroy_tfm" [drivers/staging/rtl8187se/r8187se.ko] undefined!
ERROR: "crypto_alloc_base" [drivers/staging/rtl8187se/r8187se.ko] undefined!
ERROR: "crypto_destroy_tfm" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!
ERROR: "crypto_alloc_base" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!
ERROR: "crypto_destroy_tfm" [drivers/staging/rtl8192su/r8192s_usb.ko] undefined!
ERROR: "crypto_alloc_base" [drivers/staging/rtl8192su/r8192s_usb.ko] undefined!
ERROR: "crypto_destroy_tfm" [drivers/staging/rtl8192e/r8192e_pci.ko] undefined!
ERROR: "crypto_alloc_base" [drivers/staging/rtl8192e/r8192e_pci.ko] undefined!

when drivers are built as modules but CONFIG_CRYPTO=n.

Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 16:41:50 -07:00
Julia Lawall 94002c07ff Staging: Use kmemdup
Use kmemdup when some other buffer is immediately copied into the
allocated region.

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

// <smpl>
@@
expression from,to,size,flag;
statement S;
@@

-  to = \(kmalloc\|kzalloc\)(size,flag);
+  to = kmemdup(from,size,flag);
   if (to==NULL || ...) S
-  memcpy(to, from, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-17 16:31:15 -07:00
Julia Lawall 7a6cb0d549 Staging: Use kcalloc or kzalloc
Use kcalloc or kzalloc rather than the combination of kmalloc and memset.

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

// <smpl>
@@
expression x,y,flags;
statement S;
type T;
@@

x =
-   kmalloc
+   kcalloc
           (
-           y * sizeof(T),
+           y, sizeof(T),
                flags);
 if (x == NULL) S
-memset(x, 0, y * sizeof(T));

@@
expression x,size,flags;
statement S;
@@

-x = kmalloc(size,flags);
+x = kzalloc(size,flags);
 if (x == NULL) S
-memset(x, 0, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
2010-05-14 14:02:56 -07:00
Anand Gadiyar 935e99fb07 staging: trivial: fix typo "seperate"
s/seperate/separate

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Cc: Jiri Kosina <trivial@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-14 13:16:10 -07:00
Julia Lawall 324148788b Staging: Drop memory allocation cast
Drop cast on the result of kmalloc and similar functions.

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

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

- (T *)
  (\(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\|
   kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\)(...))
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 16:06:48 -07:00
H Hartley Sweeten b63eaed0da staging: rtl8192x: sync the various rtl819x_Qos.h files
The rtl8192e, rtl8192su, and rtl8192u drivers all share what appears
to be a common private ieee80211 stack.  Various patches have been
applied to the rtl819x_Qos.h file for some of the drivers but not the
others.

This sync's the files based on all the applied patches.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 15:08:23 -07:00
H Hartley Sweeten a09fcbd70e staging: rtl8192x: sync the various rtl819x_TSProc.c files
The rtl8192e, rtl8192su, and rtl8192u drivers all share what appears
to be a common private ieee80211 stack.  Various patches have been
applied to the rtl819x_TSProc.c file for some of the drivers but not
the others.

This sync's the files based on all the applied patches.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 15:07:28 -07:00
wzt.wzt@gmail.com dde27e03cc Staging: rtl8192u: Check kmalloc return value before use the buffer in ieee80211_softmac.c
Check kmalloc return value before use the buffer.

Signed-off-by: Zhitong Wang <zhitong.wangzt@alibaba-inc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:36:11 -07:00
Ruslan Pisarev 3dc1536b21 Staging: rtl8192u: fix space coding style issue in ieee80211_crypt.h
This is a patch to the ieee80211_crypt.h file that fixed up a space
Errors found by the checkpatch.pl tools

Signed-off-by: Ruslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:55 -07:00
Ruslan Pisarev 9271ff1048 Staging: rtl8192u: ix brace, comments and space coding style issue in ieee80211.h
This is a patch to the ieee80211.h file that fixed up a brace, comments
and space Errors found by the checkpatch.pl tools.

Signed-off-by: Ruslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:55 -07:00
Ruslan Pisarev 1fc5af161f Staging: rtl8192u: fix comments and space coding style issue in dot11d.h
This is a patch to the dot11d.h file that fixed up a comments and space
Errors found by the checkpatch.pl tools

Signed-off-by: Ruslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:55 -07:00
Joe Perches d10219fcae Staging: rtl8192u: Hoist assign from if
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:44 -07:00
Huang Weiyi 04607c9e65 Staging: rtl8192u: remove unused #include <linux/version.h>
Remove unused #include <linux/version.h>('s) in
  drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:39 -07:00
Huang Weiyi 773cde9a49 Staging: remove unused #include <linux/version.h>
Remove unused #include <linux/version.h>('s) in
  drivers/staging/dt3155/allocator.c
  drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
  drivers/staging/vme/boards/vme_vmivme7805.c

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:36 -07:00
Julia Lawall 8f18604e6f Staging: drop redundant memset
The region set by the call to memset is immediately overwritten by the
subsequent call to memcpy.

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

// <smpl>
@@
expression e1,e2,e3,e4;
@@

- memset(e1,e2,e3);
  memcpy(e1,e4,e3);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:34 -07:00
Tejun Heo 5a0e3ad6af include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-30 22:02:32 +09:00
Randy Dunlap 128a5d0223 Staging: rtl8192* needs semaphore.h
The rtl8192* drivers in staging use semaphores, so they need
to #include <linux/semaphore.h>.

(similar to staging-rtl8187se-needs-semaphore.h.patch)

drivers/staging/rtl8192e/ieee80211/ieee80211.h:2038: error: field 'ips_sem' has incomplete type
drivers/staging/rtl8192e/ieee80211/ieee80211.h:2249: error: field 'wx_sem' has incomplete type
drivers/staging/rtl8192e/ieee80211/ieee80211.h:2250: error: field 'scan_sem' has incomplete type
drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c:442: error: implicit declaration of function 'down'
drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c:500: error: implicit declaration of function 'up'
drivers/staging/rtl8192e/ieee80 211/ieee80211_softmac.c:3165: error: implicit declaration of function 'sema_init'

drivers/staging/rtl8192su/ieee80211/ieee80211.h:1330: error: field 'wx_sem' has incomplete type
drivers/staging/rtl8192su/ieee80211/ieee80211.h:1331: error: field 'scan_sem' has incomplete type

drivers/staging/rtl8192u/ieee80211/ieee80211.h:2010: error: field 'wx_sem' has incomplete type
drivers/staging/rtl8192u/ieee80211/ieee80211.h:2011: error: field 'scan_sem' has incomplete type

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:43:04 -08:00
Roel Kluin 0289bb5d18 Staging: rtl8192u: ieee80211: CurrentMPDUDensity assigned to itself in HTUseDefaultSetting()
CurrentMPDUDensity was designed to itself.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:44 -08:00
Jeff Mahoney ab59186c75 Staging: rtl8192u: dont use -mhard-float
rtl8192u uses -mhard-float, which doesn't exist on ia64. Since in-kernel
floating-point isn't allowed, this is implied anyway.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:43 -08:00
Németh Márton a457732b83 staging: make USB device id constant
The id_table field of the struct usb_device_id is constant in <linux/usb.h>
so it is worth to make the initialization data also constant.

The semantic match that finds this kind of pattern is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
disable decl_init,const_decl_init;
identifier I1, I2, x;
@@
	struct I1 {
	  ...
	  const struct I2 *x;
	  ...
	};
@s@
identifier r.I1, y;
identifier r.x, E;
@@
	struct I1 y = {
	  .x = E,
	};
@c@
identifier r.I2;
identifier s.E;
@@
	const struct I2 E[] = ... ;
@depends on !c@
identifier r.I2;
identifier s.E;
@@
+	const
	struct I2 E[] = ...;
// </smpl>

Signed-off-by: Németh Márton <nm127@freemail.hu>
Cc: Julia Lawall <julia@diku.dk>
Cc: cocci@diku.dk
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:42 -08:00
Peter Huewe 733acf902f Staging: rtl8192u: Add select WEXT_PRIV to Kconfig to prevent build failure
Without WEXT_PRIV set the driver fails to build due to unknown fields in
the iw_handler_def struct.
Those fields are enclosed in WEXT_PRIV conditionals in the prototype
of iw_handler_def in include/net/iw_handler.h

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:41 -08:00
Simon Horman cf137d5c49 Staging: rtl8192su, rtl8192u: use min_t() in store_debug_level()
sizeof() returns a size_t but the other types involved
are unsigned long, so using min() results in a warning.

As sizeof() is called on an 11 character buffer defined
immediately above unsigned long is obviously wide enough
for the result.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:38 -08:00
Roel Kluin 716323c093 Staging: rtl8192u: ieee80211: add missing parentheses
not(!) has a higher precedence than bit and(&).

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:34 -08:00
Adam Buchbinder 39cfb97b0d staging: Fix misspelling of "should" and "shouldn't" in comments.
Some comments misspell "should" or "shouldn't"; this fixes them. No code changes.

Signed-off-by: Adam Buchbinder <adam.buchbinder@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:31 -08:00
Joe Perches 0ee9f67c40 Staging: rtl8187x: Use %pM for mac address output
Uncompiled.  Doesn't currently build anyway.

Converted MAC_FMT to %pM
Converted some %02x%02x%02x%02x%02x%02x to %pm
Converted MAC_ARG to direct use
Removed MAC_FMT and MAC_ARG macros

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:29 -08:00
Randy Dunlap 3d8affc001 Staging: rtl8192x: fix printk formats
Fix printk format warnings in rtl8192[eu]:

drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c:979: warning: format '%d' expects type 'int', but argument 2 has type 'size_t'
drivers/staging/rtl8192e/ieee80211/rtl819x_BAProc.c:385: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
drivers/staging/rtl8192e/ieee80211/rtl819x_BAProc.c:484: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
drivers/staging/rtl8192e/ieee80211/rtl819x_BAProc.c:614: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c:848: warning: format '%d' expects type 'int', but argument 2 has type 'size_t'
drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c:343: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c:442: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c:572: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-23 11:27:48 -08:00
Randy Dunlap 6638db58db Staging: rtl8192u: depends on USB
rtl8192u uses usb_* interfaces so it should depend on USB.

ERROR: "usb_kill_urb" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!
ERROR: "usb_deregister" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!
ERROR: "usb_control_msg" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!
ERROR: "usb_submit_urb" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!
ERROR: "usb_register_driver" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!
ERROR: "usb_free_urb" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!
ERROR: "usb_alloc_urb" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined!

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:22 -08:00
Mauro Carvalho Chehab 50a09b3b09 Staging: rtl8192u: remove dead code
Remove #ifse against older kernel versions;
Remove codes marked with #if 0;
Remove #if 1

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:22 -08:00
Mauro Carvalho Chehab e406322b4b Staging: rtl8192u: remove bad whitespaces
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:22 -08:00
Mauro Carvalho Chehab f61fb9356d Staging: rtl8192u: make it compile
Add it to staging Kbuild and fixes some API differences that prevents
compilation.

It seems that the ieee80211 stack is very close to rtl8192su one.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:22 -08:00
Jerry Chuang 8fc8598e61 Staging: Added Realtek rtl8192u driver to staging
Add Realtek linux driver for rtl8192u as provided by Realtek

rtl8192u_linux_2.6.0006.1031.2008.tar.gz, send to me C/C staging ML.

This version won't compile against upstream, doesn't follow
Linux CodingStyle and has their own ieee80211 stack.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:22 -08:00