Commit graph

195 commits

Author SHA1 Message Date
Gaston Gonzalez 80cf407fd4 staging: rtl8192u: ieee80211: Fix incorrect type in assignment
Added le16_to_cpu() conversion fixing the following warning in assignment detected by sparse:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2157:30: warning: invalid assignment: +=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2157:30:    left side has type unsigned long
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2157:30:    right side has type restricted __le16

Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-17 21:33:26 -07:00
Gaston Gonzalez 25e2704c46 staging: rtl8192u: ieee80211: Fix sparse endianness warnings ieee80211_softmac.c
Fix the following endinness warnings detected by sparse:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:669:34: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:669:34:    expected restricted __le16 [usertype] duration_id
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:669:34:    got int

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:679:33: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:679:33:    expected restricted __le16 [usertype] algorithm
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:679:33:    got int

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1090:32: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1090:32:    expected restricted __le16 [usertype] duration_id
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1090:32:    got int

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1109:30: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1109:30:    expected restricted __le16 [usertype] listen_interval
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1109:30:    got int

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:3130:24: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:3130:24:    expected restricted __le16 [usertype] reason
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:3130:24:    got unsigned char [unsigned] [usertype] asRsn

Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12 17:19:47 -07:00
Pedro Marzo Perez c1ab2fa969 Staging: rtl8192u: Remove two useless lines at ieee80211_wep_null
Remove two lines at ieee80211_wep_null which checkpatch.pl reported as errors.
The first one because it has a C99 comment style and the second one because it is a void
return which is useless.
The function ieee80211_wep_null cannot be completely removed because it is exported and
used to autoload the module.

Signed-off-by: Pedro Marzo Perez <marzo.pedro@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:40:55 -07:00
Pedro Marzo Perez 251ae75c69 Staging: rtl8192u: Simplify error check code at prism2_wep_init
Simplify prism2_wep_init error check code employing goto when a failure is detected.
Removed pr_debug which was given a checkpatch.pl error because of literal string
 splitted across two lines of code, it was seldom going to be printed anyway.

Signed-off-by: Pedro Marzo Perez <marzo.pedro@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:40:55 -07:00
Gaston Gonzalez bf95628e61 staging: rtl8192u: ieee80211: Fix sparse endianness warnings
Fix the following sparse warnings:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:    expected restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:    got int
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: invalid assignment: |=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:    left side has type restricted __le16
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:    right side has type int

Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:40:55 -07:00
Tolga Ceylan 2bd239d70e staging: rtl8192u/ieee80211/ieee80211_softmac.c: auth parse error code byte order fix
auth_parse() return result is in incorrect le16 byte order. Currently
this still works since the user code merely checks if error code is
equal to 0. However debug statement in ieee80211_check_auth_response()
prints the error code in the incorrect le16 byte order. This fix
corrects the byte order as cpu order.

Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:40:54 -07:00
Chaitanya Dhere 9c708f9461 staging: rtl8192u: Fix indentation issue
This change was detected with help of checkpatch.pl script.

Signed-off-by: Chaitanya Dhere <cvijaydh@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:34:05 -07:00
Chaitanya Dhere a4f649bdab staging: rtl8192u: Patch to modify if, else conditions
In this patch, the if, else conditions are modified to remove the
unnecessary equality checks. This change was detected with help of
coccinelle tool.

Signed-off-by: Chaitanya Dhere <cvijaydh@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08 13:34:05 -07:00
Pedro Marzo Perez 73f11ecbcb Staging: rtl8192u: Correct include indentation and openning braces at new line
Opening braces should never be in a new line.
Correct include indentation.

Signed-off-by: Pedro Marzo Perez <marzo.pedro@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 10:41:21 +09:00
Marti Bolivar ac04b3b73b staging: rtl8192u: don't redefine container_of()
This file already includes <linux/kernel.h>.

Signed-off-by: Marti Bolivar <mbolivarmullen@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:16 +02:00
Paul Gortmaker 09e0b2ff32 rtl8192u: delete another embedded instance of generic reason codes
We have global copies of all these reason codes.  We don't need local
copies.  Worse is that these seem totally unused; a grep for some of
the fields comes up empty, and it still compiles after its complete
removal.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:15 +02:00
Paul Gortmaker db2616199e rtl8192u: don't duplicate ieee80211 constants for status/auth/reason
These are all defined as a part of the standard and should not be
duplicated on a per-driver basis.  Use the global ones and delete the
local ones.

In switching to <linux/ieee80211.h> we have to delete a local copy of
an identical struct that we prepped earlier to have identical field
names, and we add explicit include <...> where needed in order to
preserve getting a successful compile.

This isn't the totality of duplicated data removed, but it is a start.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:14 +02:00
Paul Gortmaker 7c6e3f24c3 rtl8192u: align local ieee80211_wmm_ac_param struct fields with global
The <linux/ieee80211.h> and this local file both have a struct of the
same name.  They also have the same field sizes and generally the
same fields, as can be seen here:

   ~/git/linux-head$ git grep -A4 'struct ieee80211_wmm_ac_param {'
   drivers/staging/rtl8192u/ieee80211/ieee80211.h:struct ieee80211_wmm_ac_param {
   drivers/staging/rtl8192u/ieee80211/ieee80211.h- u8 ac_aci_acm_aifsn;
   drivers/staging/rtl8192u/ieee80211/ieee80211.h- u8 ac_ecwmin_ecwmax;
   drivers/staging/rtl8192u/ieee80211/ieee80211.h- u16 ac_txop_limit;
   drivers/staging/rtl8192u/ieee80211/ieee80211.h-};
   --
   include/linux/ieee80211.h:struct ieee80211_wmm_ac_param {
   include/linux/ieee80211.h-      u8 aci_aifsn; /* AIFSN, ACM, ACI */
   include/linux/ieee80211.h-      u8 cw; /* ECWmin, ECWmax (CW = 2^ECW - 1) */
   include/linux/ieee80211.h-      __le16 txop_limit;
   include/linux/ieee80211.h-} __packed;
   ~/git/linux-head$

Here we just align the local field names with the main system one.  Then
we can add an include of the system one and delete the local copy in one
smooth step in a follow-on commit.

Not that the replacement:

 for i in `find . -name '*.[ch]'` ; do sed -i 's/ac_aci_acm_aifsn/aci_aifsn/g' $i ; done
 for i in `find . -name '*.[ch]'` ; do sed -i 's/ac_ecwmin_ecwmax/cw/g' $i ; done
 for i in `find . -name '*.[ch]'` ; do sed -i 's/ac_txop_limit/txop_limit/g' $i ; done

implicitly shows that only one of the three fields is currently used.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:14 +02:00
Paul Gortmaker d140d6a15b rtl8192u: promote auth_mode to a full 8 bits
Currently LEAP is defined to two locally but the identically named
global constant is 128 in <linux/ieee80211.h>.  In order for us to
switch over to using the global value, we need to adjust the local
storage which is currently not enough to hold the larger value.

This is now consistent with the similar struct used in
drivers/net/wireless/ipw2x00/libipw.h and other drivers.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:14 +02:00
Paul Gortmaker 5c2918a5ba rtl8192u: don't trample on <linux/ieee80211.h> struct namespace
In order to start reducing the duplicated code/constants/macros in this
driver, we need to include <linux/ieee80211.h> to provide the defacto
versions.  However this driver has structs with the same name as the
ones in the main include, so namespace collision prevents us from doing
step #1.

Since the structs actually differ in their respective fields, we can't
simply delete the local ones without impacting the runtime; a conversion
to use the global ones can be considered at a later date if desired.

Rename the ones here with a vendor specific prefix so that we won't have
the namespace collision, and hence can continue on with the cleanup.

Automated conversion done with:

    for i in `find . -name '*.[ch]'` ; do \
      sed -i 's/struct ieee80211_hdr/struct rtl_80211_hdr/g' $i ; \
    done

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:13 +02:00
Dan Carpenter c4151700bb Staging: rtl8192u: use correct array for debug output
This is supposed to be ->rates_ex[] instead of ->rates[].  I found this
because static checkers complain than ->rates is too small so we're
reading beyond the end of the array.  It has 12 elements instead of 15.

This bug was apparently copy and pasted from ipw2x00.  I fixed it before
in that driver 428e3cf5f9 ('ipw2x00: printing the wrong array in
debug code')

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:40:49 +02:00
Cihangir Akturk d9e048cdd2 staging: rtl8192u: Fix static decleration sparse warning.
The function 'ieee80211_check_auth_response' is used only in this
file, so make it static. This patch fixes the following sparse
warning.

'ieee80211_check_auth_response' was not declared. Should it be static?

Signed-off-by: Cihangir Akturk <cakturk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 13:13:13 +01:00
Haneen Mohammed f53cb7b168 Staging: rtl8192u: Fix space issues before '(' and after ')'
Space is required before the open and after the close parenthesis.
This patch adds space after 'if' and before '{'.

This was done with the help of the following Coccinelle script:

@r@
expression E;
position p1,p2,p3;
@@

if@p1 (E) @p3{@p2
        ...
}

@script:python@
p1 << r.p1;
p2 << r.p2;
p3 << r.p3;
@@

l1 = int (p1[0].line)
l2 = int (p2[0].line)
l3 = int (p3[0].line)
c1 = int (p1[0].column_end)
c2 = int (p2[0].column)
c3 = int (p3[0].column)
if (l1 != l2):
  cocci.include_match(False)
if (l2 == l3 and c3 + 2 == c2):
  cocci.include_match(False)

@@
position r.p1,r.p2,r.p3;
expression r.E;
@@

-if@p1 (E) @p3{@p2
+if (E) {
...
}

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 10:35:33 +01:00
Haneen Mohammed dde48b99d2 Staging: rtl8192u: Add space before open parenthesis
Space is required before the open parenthesis.
This patch adds space after if to address that issue.
This was done with the help of the following Coccinelle script:

@r@
position p1,p2;
@@
if@p1 (@p2 ...) {
        ...
}
@script:python@
p1 << r.p1;
p2 << r.p2;
@@

l1 = int (p1[0].line)
l2 = int (p2[0].line)
c1 = int (p1[0].column)
c2 = int (p2[0].column)
if (l2 == l1 and c1 + 2 != c2):
  cocci.include_match(False)

@@
position r.p1,r.p2;
@@
- if@p1 (
+ if (
...) {
        ...
}

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 10:35:33 +01:00
Haneen Mohammed 2060f31ae5 Staging: rtl8192u: Remove parentheses around right side an assignment
Parentheses are not needed around the right hand side of an assignment.
This patch remove parenthese of such occurenses. Issue was detected and
solved using the following coccinelle script:

@rule1@
identifier x, y, z;
expression E1, E2;
@@

(
x = (y == z);
|
x = (E1 == E2);
|
 x =
-(
...
-)
 ;
)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:56:46 +01:00
Cristina Opriceana a0886f7303 Staging: rtl8192u: Bool tests don't need comparisons
This patch removes explicit true/false comparations to bool variables.
Warning found by coccinelle:
"WARNING: Comparison to bool"

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:56:46 +01:00
Supriya Karanth 2a7089dbd1 staging: rtl8192u: remove break after return
Remove "break" statement after a "return" statement as
it does not get executed.

Found by checkpatch.pl - break is not useful after a goto
or return

Signed-off-by: Supriya Karanth <iskaranth@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:56:45 +01:00
Cristina Opriceana d064f3b03c Staging: rtl8192u: Remove unnecessary struct and typedef
This patch removes the _bss_ht struct and the associated type definition
because it is not used and it also introduces the warning:
"WARNING: do not add new typedefs".

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:54:13 +01:00
Cristina Opriceana 6c14378eca Staging: rtl8192u: Remove unnecessary variable
This patch detects the cases in which a variable is not modified through
the code and it is used as a return value. The variable is detected and
removed by coccinelle using the following semantic patch:

@@ type T; expression expr; identifier r; constant c; @@

-T r = expr;
... when != r
    when strict
-return r;
+return expr;

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:54:13 +01:00
Somya Anand acc6539fe6 Staging: rtl8192u: Combine initialization using setup_timer
The function setup_timer combines the initialization of a timer with the
initialization of the timer's function and data fields.

So, this patch combines the multiline code for timer initialization using the function
setup_timer. This issue is identified via coccinelle script.

@@
expression E1, E2, E3;
type T;
@@
- init_timer(&E1);
...
(
- E1.function = E2;
...
- E1.data = (T)E3;
+ setup_timer(&E1, E2, (T)E3);
|
- E1.data = (T)E3;
...
- E1.function = E2;
+ setup_timer(&E1, E2, (T)E3);
|
- E1.function = E2;
+ setup_timer(&E1, E2, 0);
)

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:54:13 +01:00
Cristina Opriceana c3bb45456b Staging: rtl8192u: Review phrase and fix spelling errors
This patch removes some serious spelling errors and adds small
improvements to the phrases in order to make them easier to understand.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:52:42 +01:00
Dilek Uzulmez 8236589b7c Staging: rtl8192u: Fix do not use // c99 comments.
This patch fixes checkpatch.pl issues with "do not use // C99 comments" errors in ieee80211_rx.c

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:52:42 +01:00
Dilek Uzulmez ca67dfefd8 Staging: rtl8192u: Added #include <linux/uaccess.h> instead of <asm/uaccess.h>
The following patch fixes the checkpatch.pl warning:
WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h>

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:50:16 +01:00
Vaishali Thakkar 6465144c3d Staging: rtl8192u: Convert use of __constant_<foo> to <foo>
Using functions of the form __constant_<foo> isn't preferred
outside of include/uapi/ as using the function without
__constant_ is identical when the argument is a constant.
So, this patch replaces __constant_htons with htons.

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

@@identifier x;@@

(
- __constant_htons(x)
+ htons(x)
|
- __constant_htonl(x)
+ htonl(x)
|
- __constant_ntohs(x)
+ htons(x)
|
- __constant_ntohl(x)
+ htonl(x)
)

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:50:16 +01:00
Cristina Opriceana b4e3e6eec8 Staging: rtl8192u: Replace printk() with netdev_dbg()
This patch replaces the printk() function with netdev_dbg() in order to
fix the following: "WARNING: printk() should include KERN_ facility level"
and "WARNING: line over 80 characters".

Issue found by checkpatch.pl

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15 18:41:10 +01:00
Cristina Opriceana 5b2965b633 Staging: rtl8192u: Add function to improve code quality
This patch introduces a new function for the authentication response
error check in the  ieee80211_rx_frame_softmac() function to fix the
indentation problem. It also adds the iotAction variable in the new
function to fix the "more than 80 characters per line" warning.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15 18:41:10 +01:00
Navya Sri Nizamkari a774fe0923 staging: rtl8192u: Use kzalloc instead of kmalloc.
This patch uses kzalloc instead of kmalloc function.
A coccinelle script was used to make this change.

Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15 18:41:09 +01:00
Cristina Opriceana 7aa5d5097d Staging: rtl8192u: Use __packed instead of __attribute__((packed))
This patch fixed the following checkpatch.pl warning:
"WARNING: __packed is preferred over __attribute__((packed))".

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-13 10:06:45 +01:00
Cristina Opriceana 6706bbd843 Staging: rtl8192u: Remove unnecessary macro definition
This patch removes the IEEE80211_PRINT_STR macro definition because it appears
only in the header file and it doesn't serve any purpose in this context.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09 13:40:11 +01:00
Dilek Uzulmez a429238b9a Staging: rtl8192u: Replace #include <asm/string.h>
The following patch fixes the checkpatch.pl warning:
WARNING: Use #include <linux/string.h> instead of #include <asm/string.h>

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09 13:36:22 +01:00
Dilek Uzulmez 9a4ed8c506 Staging: rtl8192u: Added #include <linux/string.h> instead of <asm/string.h>
The following patch fixes the checkpatch.pl warning:
WARNING: Use #include <linux/string.h> instead of #include <asm/string.h>

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09 13:36:22 +01:00
Dilek Uzulmez a6a93bc03b Staging: rtl8192u: Added #include <linux/string.h> instead of <asm/string.h>
The following patch fixes the checkpatch.pl warning:
WARNING: Use #include <linux/string.h> instead of #include <asm/string.h>

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09 13:36:22 +01:00
Joe Perches d08c028c75 staging: rtl8192x: Remove use of seq_printf return value
The seq_printf return value, because it's frequently misused,
will eventually be converted to void.

See: commit 1f33c41c03 ("seq_file: Rename seq_overflow() to
     seq_has_overflowed() and make public")

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 16:59:53 -08:00
Tolga Ceylan 5877ecc3f7 Staging: rtl8192u: ieee80211: dot11d: added parenthesis to RESET_CIE_WATCHDOG macro
Added parenthesis to RESET_CIE_WATCHDOG macro to resolve checkpatch
error.

Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 16:58:32 -08:00
Ksenija Stanojevic 6d67b3a2f3 Staging: rtl8192u: Replace TRUE with true
This patch replaces TRUE by true, since Linux kernel has already a
boolean type, bool, defined in linux/stddef.h

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 15:48:33 -08:00
Cristina Opriceana 19cd22972f Staging: drivers: Bool initializations should use true/false
This patch replaces bool initializations of 1/0 with true/false in order
to increase readability and respect the standards. Warning found by
coccinelle.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 15:30:07 -08:00
Aya Mahfouz 47f0585a20 staging: rtl8192u: ieee80211: replace memset(x,0,ETH_ALEN) by eth_zero_addr(x)
eth_zero_addr() is a wrapper function for memset if 0 is going to
be assigned to a mac address. The replacement was done by the
following coccinelle script:

@header@
@@

#include <linux/etherdevice.h>

@eth_zero_addr@
expression e;
@@

-memset(e,0,ETH_ALEN);
+eth_zero_addr(e);

@eth_broadcast_addr@
identifier e;
@@

-memset(e,\(0xff\|0xFF\|255\),ETH_ALEN);
+eth_broadcast_addr(e);

@linux_header depends on !header && (eth_zero_addr || eth_broadcast_addr) @
@@

+ #include <linux/etherdevice.h>
+

@special_header depends on !header && !linux_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>
+

@custom_header depends on !header && !linux_header && !special_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 09:54:34 -08:00
Aya Mahfouz 21f5690ec7 staging: rtl8192u: replace memset(x,0,ETH_ALEN) by eth_zero_addr(x)
eth_zero_addr() is a wrapper function for memset if 0 is going to
be assigned to a mac address. The replacement was done by the
following coccinelle script:

@header@
@@

#include <linux/etherdevice.h>

@eth_zero_addr@
expression e;
@@

-memset(e,0,ETH_ALEN);
+eth_zero_addr(e);

@eth_broadcast_addr@
identifier e;
@@

-memset(e,\(0xff\|0xFF\|255\),ETH_ALEN);
+eth_broadcast_addr(e);

@linux_header depends on !header && (eth_zero_addr || eth_broadcast_addr) @
@@

+ #include <linux/etherdevice.h>
+

@special_header depends on !header && !linux_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>
+

@custom_header depends on !header && !linux_header && !special_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 09:54:34 -08:00
Dilek Uzulmez 80c598a6ab Staging: rtl8192u: Fix quoted string split across lines
This patch fixes checkpatch.pl warning in file ieee80211_crypt.c
WARNING: "quoted string split across lines warning"

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 09:54:33 -08:00
Hatice ERTÜRK babcf83806 Staging: rtl8192u: ieee80211: Add blank line after declarations
The following patch fixes the checkpatch.pl warning:
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c WARNING:
Missing a blank line after declarations

Signed-off-by: Hatice ERTURK <haticeerturk27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 17:10:22 -08:00
Navya Sri Nizamkari 0b5c85e0f4 staging: Remove <linux/moduleparam.h> header.
This patch drops #include <linux/moduleparam.h> in all the staging
driver files that also include #include <linux/module.h> as
module.h includes moduleparam.h already.

The following semantic patch is used to make these changes:

@ includesmodule @
@@
@ depends on includesmodule @
@@
- #include <linux/moduleparam.h>

Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 17:09:52 -08:00
Hatice ERTÜRK 4d2c47a922 Staging: rtl8192u: ieee80211: Convert comment from C99 style to C89 style
This patch fixes the checkpatch.pl error:
ERROR: "Do not use C99 // comments"

Signed-off-by: Hatice ERTURK <haticeerturk27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 17:09:15 -08:00
Ksenija Stanojevic 6518c10be9 Staging: rtl8192u: Replace printk() with pr_debug()
For dynamic debugging netdev_dbg(), dev_dbg() or  pr_debug() macro is
preferred over printk(), which is the raw way to print something.
Network system has it's own printk format, netdev_dbg, but in this case
function's argument list has no  pointer to a struct netdevice so
pr_debug is used instead.
Issue found by checkpatch.pl.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 15:33:04 -08:00
Aya Mahfouz 1339078956 staging: rtl8192u: rewrite the right hand side of an assignment
This patch rewrites the right hand side of an assignment for
expressions of the form:
a = (a <op> b);
to be:
a <op>= b;
where <op> = << | >>.

This issue was detected and resolved using the following
coccinelle script:

@@
identifier i;
expression e;
@@

-i = (i >> e);
+i >>= e;

@@
identifier i;
expression e;
@@

-i = (i << e);
+i <<= e;

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 15:23:47 -08:00
Ksenija Stanojevic ff757c8a26 Staging: rtl8192u: Convert comments from C99 to C89 style
Kernel style for comments is C89 style. Issue found by checkpatch.pl.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 13:45:05 -08:00