Commit Graph

777 Commits

Author SHA1 Message Date
Mateusz Kulikowski 8852112e1c staging: rtl8192e: Remove dead code
Remove commented-out code

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:29:31 +02:00
Mateusz Kulikowski 14b40d9288 staging: rtl8192e: Comment cleanup (style/format)
- Multiline comments use "network subsystem comment style"
- Merge short multiline comments
- Remove empty comments
- Remove function name comment at the end of small (<1 screen) functions
- Reformat 802.11 data frame format to use spaces and network format

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:29:31 +02:00
Mateusz Kulikowski e725fb6f81 staging: rtl8192e: Fix indentation in rtllib_rx_auth_resp()
Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:29:30 +02:00
Mateusz Kulikowski f7567e2070 staging: rtl8192e: Decrease nesting of rtllib_rx_auth_resp()
Return from rtllib_rx_auth_resp() if auth_parse() fails.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:29:30 +02:00
Mateusz Kulikowski e8f05b0b01 staging: rtl8192e: Divide rtllib_rx_auth()
Move authentication response processing to rtllib_rx_auth_resp() function.
No logic is affected.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:29:30 +02:00
Mateusz Kulikowski 61dbdf36f2 staging: rtl8192e: Fix PRINTK_WITHOUT_KERN_LEVEL warnings
Replace custom hex dumping function with print_hex_dump_bytes()
to make checkpatch.pl happy

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:29:30 +02:00
Mateusz Kulikowski ff28b74c1c staging: rtl8192e: Fix DO_WHILE_MACRO_WITH_TRAILING_SEMICOLON warning
Fix 'do {} while (0) macros should not be semicolon terminated'
checkpatch.pl warning

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:29:30 +02:00
Mateusz Kulikowski bec027ea38 staging: rtl8192e: Fix BRACES warning
Fix 'braces {} are not necessary for single statement blocks'
checkpatch.pl warning

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:29:30 +02:00
Mateusz Kulikowski e2ac043118 staging: rtl8192e: Fix LINE_CONTINUATIONS warning
Fix 'Avoid unnecessary line continuations' checkpatch.pl warning

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:29:30 +02:00
Mateusz Kulikowski 025b8bbe49 staging: rtl8192e: Fix UNNECESSARY_PARENTHESES warnings
Fix 'Unnecessary parentheses' checkpatch.pl warning

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:29:30 +02:00
Mateusz Kulikowski b2e70746e9 staging: rtl8192e: remove unused EXPORT_SYMBOL_RSL macro
This macro caused checkpatch.pl warning and is not used.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:29:30 +02:00
Mateusz Kulikowski 0f0688b3ce staging: rtl8192e: Fix RETURN_VOID warnings
Fix 'void function return statements are not generally useful'
checkpatch.pl warnings

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:29:29 +02:00
Mateusz Kulikowski 285b7c00e0 staging: rtl8192e: Fix UNNECESSARY_ELSE warning
Fix checkpatch warnings 'else is not generally useful after a break or return'

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:29:29 +02:00
Mateusz Kulikowski a8f4f33a4f staging: rtl8192e: remove CURRENT_RATE macro
CURRENT_RATE macro is used only once in driver. This patch removes it
and adds rtllib_current_rate() static function in file using that macro

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:14:00 +01:00
Mateusz Kulikowski e48617a48c staging: rtl8192e: remove eqMacAddr macro
Remove eqMacAddr macro and replace it with ether_addr_equal_unaligned()

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:14:00 +01:00
Mateusz Kulikowski 34fff6db29 staging: rtl8192e: rtllib.h: remove duplicated container_of
This macro is already defined in kernel.h - there is no need to redefine it.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:13:59 +01:00
Mateusz Kulikowski 7e4eb9fdf2 staging: rtl8192e: remove unused macros
Several (unused) macros were removed from driver.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:13:59 +01:00
Mateusz Kulikowski 7527cf3710 staging: rtl8192e: remove dead code
Remove commented-out unions and enum.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:13:59 +01:00
Mateusz Kulikowski 7b979cda81 staging: rtl8192e: remove rtllib_endianfree.h
rtllib_endianfree.h was not used (only included)

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:13:59 +01:00
Mateusz Kulikowski d69d20549b staging: rtl8192e: fix coding style warnings (printk -> netdev_*)
Use netdev_*, dev_* or pr_* instead of printk where possible.
KERN_DEBUG messages are left intact as pr_dbg has different behaviour.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:13:59 +01:00
Mateusz Kulikowski 2729011c40 staging: rtl8192e: rtllib_wx: remove duplicate messages
Some messages were reported with netdev_* macros and internal
driver-specific macro.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:13:58 +01:00
Mateusz Kulikowski 3325721d36 staging: rtl8192e: fix coding style errors (macros in parentheses)
Fix checkpatch.pl errors 'Macros with complex values should be enclosed in parentheses'.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:13:58 +01:00
Mateusz Kulikowski dc986e3ed3 staging: rtl8192e: fix coding style issues (spaces before semicolon)
Fix checkpatch.pl warning 'space prohibited before semicolon'.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:13:58 +01:00
Mateusz Kulikowski 0822339b52 staging: rtl8192e: fix coding style issues (merge broken strings)
Fix checkpatch.pl warnings:
- 'WARNING: quoted string split across lines'
- 'WARNING: break quoted strings at a space character'

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 13:13:58 +01:00
Cristina Opriceana 44acc6b524 Staging: rtl8192e: Bool tests don't need comparisons
This patch removes comparisons to true/false values on bool variables.
Warning found by coccinelle:
"WARNING: Comparison to bool".

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 16:00:20 +01:00
Supriya Karanth 26049b11cb staging: rtl8192e: 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 16:00:20 +01:00
Cristina Opriceana e623d0f3f9 Staging: rtl8192e: Remove unnecessary variables
This patch removes unnecessary intermediary variables in return lines
and uses actual values.
Found by coccinelle using this semantic patch:

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

-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 16:00:20 +01:00
Vaishali Thakkar 8b9733c1ad Staging: rtl8192e: Eliminate use of MSECS macro
Use msecs_to_jiffies instead of driver specific macro
MSECS. This is done using Coccinelle and semantic
patch used for this is as follows:

@@expression t;@@

- MSECS(t)
+ msecs_to_jiffies(t)

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:59:15 +01:00
Cristina Opriceana 453ce99c26 Staging: rtl8192e: Remove unnecessary macro
This patch removes the RTLLIB_PRINT_STR macro definition because it's
only defined in the header and it's never referenced. It also removes
PRINTABLE and MAX_STR_LEN, which were defined as helpers for the first
one.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:59:15 +01:00
Sudip Mukherjee d40b62babc staging: rtl8192e: remove unused functions
removed some functions which were not being used anywhere.
build tested and also verified by git grep that there is no other
reference to these functions.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:59:15 +01:00
Navya Sri Nizamkari d272f9ddce staging: rtl8192e: 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
Darshana Padmadas d009f0d7ae staging: rtl8192e: Replace min with min_t
This patch replaces min with min_t and eliminates the
following warnings found by checkpatch.pl:

WARNING: min() should probably be min_t

Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09 13:30:40 +01:00
Matteo Semenzato ad22d55c4b Staging: rtl8192e: remove assignment of function parameter
This patch removes the assignment of a function parameter that has no
effect.

Signed-off-by: Matteo Semenzato <mattew8898@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 16:59:53 -08:00
Quentin Lambert b6b0012c2d staging: rtl8192e: Remove unnecessary OOM message
This patch reduces the kernel size by removing error messages that duplicate
the normal OOM message.

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

@@
identifier f,print,l;
expression e;
constant char[] c;
@@

e = \(kzalloc\|kmalloc\|devm_kzalloc\|devm_kmalloc\)(...);
if (e == NULL) {
  <+...
-  print(...,c,...);
  ... when any
(
  goto l;
|
  return ...;
)
  ...+> }

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 16:59:53 -08: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
Navya Sri Nizamkari a568dc1f37 staging: rtl8192e: Remove if conditions.
This patch removes if conditions with no exececutable
statements in the bodies of those ifs and also no variable
assignments in the if conditional checks. The call to
rtllib_act_scanning in the condition doesn't have any side
effects as it too performs conditional checks without changing
any values. Hence, it's safe to remove the if condition.

Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 15:30:07 -08:00
Aya Mahfouz 0c401c1dc9 staging: rtl8192e: remove extra parentheses around right bit shift operation
Removes extra parentheses around bitwise right shift operation.
The cases handled are  when the resultant value is assigned to
a variable or when a shift operation is carried out for a function
argument. The issues were detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

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

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Some coding style issues were handled manually to avoid
checkpatch warnings and errors.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 15:22:42 -08:00
Aya Mahfouz 76f73693ca staging: rtl8192e: 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 cdbaf3f672 staging: rtl8192e: 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
Vaishali Thakkar 5dc42962e1 Staging: rtl8192e: Eliminate use of macro IS_NIC_DOWN
This patch eliminates use of unnecessory macro IS_NIC_DOWN
and replaces it with standard code.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 09:54:33 -08:00
Hatice ERTÜRK 0994899598 Staging: rtl8192e: rtl8192e: fix space prohibited before that ','
This patch fixes the following checkpatch.pl error:
space prohibited before that ','

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
Vatika Harlalka 9f491da91f Staging: rtl8192e: Remove unneeded brackets.
These were detected with this Coccinelle script:
@@
identifier f1, f2, f3;
constant c;
@@

f1 =
(
- (f2 << f3)
+ f2 << f3
|
- (f2 >> f3)
+ f2 >> f3
|
- (f2 << c)
+ f2 << c
|
- (f2 >> c)
+ f2 >> c
)

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 17:09:15 -08:00
Ksenija Stanojevic a3ed22eabd Staging: rtl8192e: Fix line over 80 characters
This patch fixes line to fit 80 characters.
Issue found by checkpatch.pl

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 17:07:43 -08:00
Ksenija Stanojevic c63eee5460 Staging: rtl8192e: Use ether_addr_copy() instead of memcpy()
This patch replaces memcpy with ether_addr_copy.
Also pathole was used to make sure that arguments passed to ether_addr_copy
are aligned to u16.
First argument is iwe.u.ap_addr.sa_data i output of pahole is:
struct iw_event {
	__u16                      len;                  /*     0     2 */
	__u16                      cmd;                  /*     2     2 */

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

	union iwreq_data           u;                    /*     8    16 */

	/* size: 24, cachelines: 1, members: 3 */
	/* sum members: 20, holes: 1, sum holes: 4 */
	/* last cacheline: 24 bytes */
};
and inside union iwreq_data u is sa_data:
struct sockaddr {
/* typedef sa_family_t -> __kernel_sa_family_t */ short unsigned int sa_family; /*     8     2 */
char       sa_data[14];                                          /*    10    14 */
} ap_addr; /*          16 */

sa_data is a char array of size 14, and the number of bytes copied using
ether_addr_copy() is 6.

Second argument is network->bssid and output of pahole is:
struct rtllib_network {
	u8                         bssid[6];             /*     0     6 */
	u8                         channel;              /*     6     1 */
	u8                         ssid[33];             /*     7    33 */
	u8                         ssid_len;             /*    40     1 */
	u8                         hidden_ssid[33];      /*    41    33 */
	/* --- cacheline 1 boundary (64 bytes) was 10 bytes ago --- */
	u8                         hidden_ssid_len;      /*    74     1 */

	/* XXX 1 byte hole, try to pack */

	struct rtllib_qos_data     qos_data;             /*    76    48 */
	bool                       bWithAironetIE;       /*   124     1 */
	bool                       bCkipSupported;       /*   125     1 */
	bool                       bCcxRmEnable;         /*   126     1 */

	/* XXX 1 byte hole, try to pack */

	/* --- cacheline 2 boundary (128 bytes) --- */
	u16                        CcxRmState[2];        /*   128     4 */
	bool                       bMBssidValid;         /*   132     1 */
	u8                         MBssidMask;           /*   133     1 */
	u8                         MBssid[6];            /*   134     6 */
	bool                       bWithCcxVerNum;       /*   140     1 */
	u8                         BssCcxVerNumber;      /*   141     1 */

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

	struct rtllib_rx_stats     stats;                /*   144   120 */
	/* --- cacheline 4 boundary (256 bytes) was 8 bytes ago --- */
	u16                        capability;           /*   264     2 */
	u8                         rates[12];            /*   266    12 */
	u8                         rates_len;            /*   278     1 */
	u8                         rates_ex[16];         /*   279    16 */
	u8                         rates_ex_len;         /*   295     1 */
	long unsigned int          last_scanned;         /*   296     8 */
	u8                         mode;                 /*   304     1 */

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

	u32                        flags;                /*   308     4 */
	u32                        last_associate;       /*   312     4 */
	u32                        time_stamp[2];        /*   316     8 */
	/* --- cacheline 5 boundary (320 bytes) was 4 bytes ago --- */
	u16                        beacon_interval;      /*   324     2 */
	u16                        listen_interval;      /*   326     2 */
	u16                        atim_window;          /*   328     2 */
	u8                         erp_value;            /*   330     1 */
	u8                         wpa_ie[64];           /*   331    64 */

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

	/* --- cacheline 6 boundary (384 bytes) was 16 bytes ago --- */
	size_t                     wpa_ie_len;           /*   400     8 */
	u8                         rsn_ie[64];           /*   408    64 */
	/* --- cacheline 7 boundary (448 bytes) was 24 bytes ago --- */
	size_t                     rsn_ie_len;           /*   472     8 */
	u8                         wzc_ie[256];          /*   480   256 */
	/* --- cacheline 11 boundary (704 bytes) was 32 bytes ago --- */
	size_t                     wzc_ie_len;           /*   736     8 */
	struct rtllib_tim_parameters tim;                /*   744     2 */
	u8                         dtim_period;          /*   746     1 */
	u8                         dtim_data;            /*   747     1 */

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

	u64                        last_dtim_sta_time;   /*   752     8 */
	u8                         wmm_info;             /*   760     1 */

	/* XXX 1 byte hole, try to pack */

	struct rtllib_wmm_ac_param wmm_param[4];         /*   762    16 */
	/* --- cacheline 12 boundary (768 bytes) was 10 bytes ago --- */
	u8                         Turbo_Enable;         /*   778     1 */

	/* XXX 1 byte hole, try to pack */

	u16                        CountryIeLen;         /*   780     2 */
	u8                         CountryIeBuf[255];    /*   782   255 */

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

	/* --- cacheline 16 boundary (1024 bytes) was 16 bytes ago --- */
	struct bss_ht              bssht;                /*  1040    84 */
	/* --- cacheline 17 boundary (1088 bytes) was 36 bytes ago --- */
	bool                       broadcom_cap_exist;   /*  1124     1 */
	bool                       realtek_cap_exit;     /*  1125     1 */
	bool                       marvell_cap_exist;    /*  1126     1 */
	bool                       ralink_cap_exist;     /*  1127     1 */
	bool                       atheros_cap_exist;    /*  1128     1 */
	bool                       cisco_cap_exist;      /*  1129     1 */
	bool                       airgo_cap_exist;      /*  1130     1 */
	bool                       unknown_cap_exist;    /*  1131     1 */
	bool                       berp_info_valid;      /*  1132     1 */
	bool                       buseprotection;       /*  1133     1 */
	bool                       bIsNetgear854T;       /*  1134     1 */
	u8                         SignalStrength;       /*  1135     1 */
	u8                         RSSI;                 /*  1136     1 */

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

	struct list_head           list;                 /*  1144    16 */
	/* --- cacheline 18 boundary (1152 bytes) was 8 bytes ago --- */

	/* size: 1160, cachelines: 19, members: 61 */
	/* sum members: 1132, holes: 10, sum holes: 28 */
	/* last cacheline: 8 bytes */
};

network->bssid is char array of size 6.

Issue found by checkpatch.pl

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 17:07:43 -08:00
Ksenija Stanojevic c60cfc8e3b Staging: rtl8192e: Replace printk with netdev_dbg, netdev_info, or netdev_warn
For network systems netdev_dbg, netdev_info or netdev_warn is preferred over
printk. Issue found by checkpatch.pl

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 17:07:05 -08:00
Aya Mahfouz 0dbffe07b1 staging: rtl8192e: rewrite the right hand side of an assignment
This patch rewrites the right hand side of an assignment for
expressions of the form:
a = (a <op> b);
to be:
a <op>= b;
where <op> = << | >>.

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

@@
identifier i;
expression e;
@@

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

@@
identifier i;
expression e;
@@

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

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 15:23:47 -08:00
Aya Mahfouz be31fed4f9 staging: rtl8192e: 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
Melike Yurtoglu 1f3aefb5df Staging: rtl8192e: replace memcpy() by ether_addr_copy() using coccinelle and pack variable
This patch focuses on fixing the following warning generated
by checkpatch.pl for the file rxtx.c

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

@@ expression e1, e2; @@

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

struct net_device {
        char                       name[16];             /*     0    16*/
        struct hlist_node          name_hlist;           /*    16    16*/
        char *                     ifalias;              /*    32     8*/
        long unsigned int          mem_end;              /*    40     8*/
        long unsigned int          mem_start;            /*    48     8*/
        long unsigned int          base_addr;            /*    56     8*/
        /* --- cacheline 1 boundary (64 bytes) --- */
        int                        irq;                  /*    64     4*/

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

        long unsigned int          state;                /*    72     8*/
        struct list_head           dev_list;             /*    80    16*/
        struct list_head           napi_list;            /*    96    16*/
        struct list_head           unreg_list;           /*   112    16*/
        /* --- cacheline 2 boundary (128 bytes) --- */
        struct list_head           close_list;           /*   128    16*/
        struct {
                struct list_head   upper;                /*   144    16*/
                struct list_head   lower;                /*   160    16*/
        } adj_list;                                      /*   144    32*/
        struct {
                struct list_head   upper;                /*   176    16*/
                struct list_head   lower;                /*   192    16*/
        } all_adj_list;                                  /*   176    32*/
        /* --- cacheline 3 boundary (192 bytes) was 16 bytes ago --- */
        netdev_features_t          features;             /*   208     8*/
        netdev_features_t          hw_features;          /*   216     8*/
        netdev_features_t          wanted_features;      /*   224     8*/
        netdev_features_t          vlan_features;        /*   232     8*/
        netdev_features_t          hw_enc_features;      /*   240     8*/
        netdev_features_t          mpls_features;        /*   248     8*/
        /* --- cacheline 4 boundary (256 bytes) --- */
	int                        ifindex;              /*   256     4*/
        int                        iflink;               /*   260     4*/
        struct net_device_stats    stats;                /*   264   184*/
        /* --- cacheline 7 boundary (448 bytes) --- */
        atomic_long_t              rx_dropped;           /*   448     8*/
        atomic_long_t              tx_dropped;           /*   456     8*/
        atomic_t                   carrier_changes;      /*   464     4*/

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

        const struct iw_handler_def  * wireless_handlers; /*   472     8*/
        struct iw_public_data *    wireless_data;        /*   480     8*/
        const struct net_device_ops  * netdev_ops;       /*   488     8*/
        const struct ethtool_ops  * ethtool_ops;         /*   496     8*/
        const struct forwarding_accel_ops  * fwd_ops;    /*   504     8*/
        /* --- cacheline 8 boundary (512 bytes) --- */
        const struct header_ops  * header_ops;           /*   512     8*/
        unsigned int               flags;                /*   520     4*/
        unsigned int               priv_flags;           /*   524     4*/
        short unsigned int         gflags;               /*   528     2*/
        short unsigned int         padded;               /*   530     2*/
        unsigned char              operstate;            /*   532     1*/
        unsigned char              link_mode;            /*   533     1*/
        unsigned char              if_port;              /*   534     1*/
        unsigned char              dma;                  /*   535     1*/
        unsigned int               mtu;                  /*   536     4*/
        short unsigned int         type;                 /*   540     2*/
        short unsigned int         hard_header_len;      /*   542     2*/
        short unsigned int         needed_headroom;      /*   544     2*/
        short unsigned int         needed_tailroom;      /*   546     2*/
        unsigned char              perm_addr[32];        /*   548    32*/
        /* --- cacheline 9 boundary (576 bytes) was 4 bytes ago --- */
        unsigned char              addr_assign_type;     /*   580     1*/
        unsigned char              addr_len;             /*   581     1*/
        short unsigned int         neigh_priv_len;       /*   582     2*/
        short unsigned int         dev_id;               /*   584     2*/
        short unsigned int         dev_port;             /*   586     2*/
        spinlock_t                 addr_list_lock;       /*   588     4*/
	struct netdev_hw_addr_list uc;                   /*   592    24*/
        struct netdev_hw_addr_list mc;                   /*   616    24*/
        /* --- cacheline 10 boundary (640 bytes) --- */
        struct netdev_hw_addr_list dev_addrs;            /*   640    24*/
        struct kset *              queues_kset;          /*   664     8*/
        unsigned char              name_assign_type;     /*   672     1*/
        bool                       uc_promisc;           /*   673     1*/

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

        unsigned int               promiscuity;          /*   676     4*/
        unsigned int               allmulti;             /*   680     4*/

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

        struct vlan_info *         vlan_info;            /*   688     8*/
        struct dsa_switch_tree *   dsa_ptr;              /*   696     8*/
        /* --- cacheline 11 boundary (704 bytes) --- */
        struct tipc_bearer *       tipc_ptr;             /*   704     8*/
        void *                     atalk_ptr;            /*   712     8*/
        struct in_device *         ip_ptr;               /*   720     8*/
        struct dn_dev *            dn_ptr;               /*   728     8*/
        struct inet6_dev *         ip6_ptr;              /*   736     8*/
        void *                     ax25_ptr;             /*   744     8*/
        struct wireless_dev *      ieee80211_ptr;        /*   752     8*/
        struct wpan_dev *          ieee802154_ptr;       /*   760     8*/
        /* --- cacheline 12 boundary (768 bytes) --- */
        long unsigned int          last_rx;              /*   768     8*/
        unsigned char *            dev_addr;             /*   776     8*/
        struct netdev_rx_queue *   _rx;                  /*   784     8*/
        unsigned int               num_rx_queues;        /*   792     4*/
        unsigned int               real_num_rx_queues;   /*   796     4*/
        long unsigned int          gro_flush_timeout;    /*   800     8*/
        rx_handler_func_t *        rx_handler;           /*   808     8*/
        void *                     rx_handler_data;      /*   816     8*/
        struct netdev_queue *      ingress_queue;        /*   824     8*/
        /* --- cacheline 13 boundary (832 bytes) --- */
	unsigned char              broadcast[32];        /*   832    32*/

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

        /* --- cacheline 14 boundary (896 bytes) --- */
        struct netdev_queue *      _tx;                  /*   896     8*/
        unsigned int               num_tx_queues;        /*   904     4*/
        unsigned int               real_num_tx_queues;   /*   908     4*/
        struct Qdisc *             qdisc;                /*   912     8*/
        long unsigned int          tx_queue_len;         /*   920     8*/
        spinlock_t                 tx_global_lock;       /*   928     4*/

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

        struct xps_dev_maps *      xps_maps;             /*   936     8*/
        struct cpu_rmap *          rx_cpu_rmap;          /*   944     8*/
        long unsigned int          trans_start;          /*   952     8*/
        /* --- cacheline 15 boundary (960 bytes) --- */
        int                        watchdog_timeo;       /*   960     4*/

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

        struct timer_list          watchdog_timer;       /*   968    80*/
        /* --- cacheline 16 boundary (1024 bytes) was 24 bytes ago ---* */
        int *                      pcpu_refcnt;          /*  1048     8*/
        struct list_head           todo_list;            /*  1056    16*/
        struct hlist_node          index_hlist;          /*  1072    16*/
        /* --- cacheline 17 boundary (1088 bytes) --- */
        struct list_head           link_watch_list;      /*  1088    16*/
        enum {
                NETREG_UNINITIALIZED = 0,
                NETREG_REGISTERED = 1,
                NETREG_UNREGISTERING = 2,
                NETREG_UNREGISTERED = 3,
                NETREG_RELEASED = 4,
                NETREG_DUMMY = 5,
        } reg_state:8;                                     /*  1104 4 */
	/* Bitfield combined with next fields */

        bool                       dismantle;            /*  1105     1*/

        /* Bitfield combined with previous fields */

        enum {
                RTNL_LINK_INITIALIZED = 0,
                RTNL_LINK_INITIALIZING = 1,
        } rtnl_link_state:16;                               /*  1104 4 */

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

        void                       (*destructor)(struct net_device *);/*  1112     8 */
        struct netpoll_info *      npinfo;               /*  1120     8*/
        struct net *               nd_net;               /*  1128     8*/
        union {
                void *             ml_priv;              /*           8*/
                struct pcpu_lstats * lstats;             /*           8*/
                struct pcpu_sw_netstats * tstats;        /*           8*/
                struct pcpu_dstats * dstats;             /*           8*/
                struct pcpu_vstats * vstats;             /*           8*/
        };                                               /*  1136     8*/
        struct garp_port *         garp_port;            /*  1144     8*/
        /* --- cacheline 18 boundary (1152 bytes) was 4 bytes ago --- */
        struct mrp_port *          mrp_port;             /*  1152     8*/
        struct device              dev;                  /*  1160   696*/

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

        /* --- cacheline 29 boundary (1856 bytes) was 4 bytes ago --- */
        const struct attribute_group  * sysfs_groups[4]; /*  1856    32*/
        const struct attribute_group  * sysfs_rx_queue_group; /*  18888 */
        const struct rtnl_link_ops  * rtnl_link_ops;     /*  1896     8*/
        unsigned int               gso_max_size;         /*  1904     4*/
        u16                        gso_max_segs;         /*  1908     2*/
        u16                        gso_min_segs;         /*  1910     2*/
	const struct dcbnl_rtnl_ops  * dcbnl_ops;        /*  1912     8*/
        /* --- cacheline 30 boundary (1920 bytes) was 4 bytes ago --- */
        u8                         num_tc;               /*  1920     1*/

        /* XXX 1 byte hole, try to pack */

        struct netdev_tc_txq       tc_to_txq[16];        /*  1922    64*/
        /* --- cacheline 31 boundary (1984 bytes) was 6 bytes ago --- */
        u8                         prio_tc_map[16];      /*  1986    16*/

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

        unsigned int               fcoe_ddp_xid;         /*  2004     4*/
        struct phy_device *        phydev;               /*  2008     8*/
        struct lock_class_key *    qdisc_tx_busylock;    /*  2016     8*/
        int                        group;                /*  2024     4*/

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

        struct pm_qos_request      pm_qos_req;           /*  2032   176*/
        /* --- cacheline 34 boundary (2176 bytes) was 36 bytes ago --- * */

        /* size: 2240, cachelines: 35, members: 120 */
        /* sum members: 2147, holes: 11, sum holes: 65 */
        /* padding: 32 */
        /* paddings: 1, sum paddings: 7 */

        /* BRAIN FART ALERT! 2240 != 2147 + 65(holes), diff = 28 */

};

Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 15:12:10 -08:00
Kolbeinn Karlsson 98ab6ff914 Staging: rtl8192e: Fixed unnecessary line continuation.
Fixed a coding style issue.

Signed-off-by: Kolbeinn Karlsson <kolbeinnkarls@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07 17:25:43 +08:00
Alexander Kuleshov e77e19ac0f staging: rtl8192e: Fix duplicated conditional branch
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:21:59 -08:00