summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8188eu
AgeCommit message (Collapse)Author
2015-03-18Staging: rtl8188eu: Remove timer handler macrosVaishali Thakkar
After the commit 28af7ea81e16 ("Staging: rtl8188eu: Eliminate use of _init_timer"), macros (RTW_TIMER_HDL_ARGS, RTW_TIMER_HDL_NAME, RTW_DECLARE_TIMER_HDL) are no longer needed. So, remove them. Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16Staging: rtl8188eu: Remove parentheses around right side an assignmentHaneen Mohammed
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-16staging: rtl8188eu: remove break after returnSupriya Karanth
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-16staging: rtl8188eu: remove intialization of static intsSupriya Karanth
static ints are initialized to 0 by the compiler. Explicit initialization is not necessary. Found by checkpatch.pl - ERROR: do not initialise statics to 0 or NULL changes made using coccinelle script: @@ type T; identifier var; @@ static T var - =0 ; Signed-off-by: Supriya Karanth <iskaranth@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16Staging: rtl8188eu: Eliminate use of _init_timerVaishali Thakkar
This patch introduces the use of API function setup_timer instead of driver specific function init_timer as it is the preferred and standard way to set and setup the timer. To be compatible with the changes, argument types of referenced functions are changed. Also, definition of function _init_timer is removed as it is no longer needed after this change. Here, these cases are handled using Coccinelle and semantic patch used for this is as follows: @@ expression x, y; identifier a, b;@@ - _init_timer (&x, y, a, b); + setup_timer (&x, a, (unsigned long)b); Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16Staging: rtl8188eu: Eliminate use of _set_timerVaishali Thakkar
This patch introduces the use of API function mod_timer instead of driver specific function _set_timer as it is a more efficient and standard way to update the expire field of an active timer. Also, definition of function _set_timer is removed as it is no longer needed after this change. Here, these cases are handled using Coccinelle and semantic patch used for this is as follows: @@ expression x; expression y;@@ - _set_timer (&x, y); + mod_timer (&x, jiffies + msecs_to_jiffies (y)); Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16drivers: staging: rtl8188eu: core: rtw_security: Fix misspelled wordIoana Ciornei
This patch fixes the checkpatch.pl warning: WARNING: 'halfs' may be misspelled - perhaps 'halves'? Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16staging: rtl8188eu: use %pM specifier instead of passing direct valuesMike Krinkin
The patch converts code to use %pM specifier instead of pushing each byte via stack. Signed-off-by: Mike Krinkin <krinkin.m.u@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15Staging: rtl8188eu: Remove unneeded return statementSomya Anand
This patch removes unnecessary return statement from a void function and hence make it more compatible. This issue is identified by checkpatch.pl Signed-off-by: Somya Anand <somyaanand214@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15Staging: rtl8188eu: Remove redundant local variableSomya Anand
This patch removes a redundant variable "val" and adds inline return statements. It also adds a default case to the switch statement which returns 0 to keep the logic intact. It also removes a redundant variable "inx" and adds inline return statements. This issue is identified by the following coccinelle script. @@ expression ret; identifier f; @@ -ret = +return f(...); -return ret; Signed-off-by: Somya Anand <somyaanand214@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15staging: rtl8188eu: Use kcalloc instead of kzalloc.Navya Sri Nizamkari
This patch uses kcalloc instead of kzalloc 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-15staging: rtl8188eu: Use kcalloc instead of kzallocNavya Sri Nizamkari
This patch uses kcalloc instead of kzalloc 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-09drivers: staging: rtl8188eu: core: Removed unnecessary parenthesesTina Johnson
Parentheses around the right side of an assignment statement are unnecessary and hence removed. Coccinelle was used to produce the patch: @rule1@ identifier x,y; constant c; @@ ( x = -( y << c -) ; | x = -( y >> c -) ; | x = -( y + c -) ; | x = -( y - c -) ; ) Signed-off-by: Tina Johnson <tinajohnson.1234@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09staging: rtl8188eu: Remove unneeded parenthesesSomya Anand
This patch removes unneeded parentheses from a if statement for better readability. This issue is identified by checkpatch.pl Signed-off-by: Somya Anand <somyaanand214@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-07staging: rtl8188eu: Fix trivial typos in commentsYannick Guerrini
Change 'disabed' and 'disabel' to 'disabled' Change 'inviation' to 'invitation' Change 'negoitation' to 'negotiation' Signed-off-by: Yannick Guerrini <yguerrini@tomshardware.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06Staging: rtl8188eu: Remove unnecessary return statementsSomya Anand
This patch removes unnecessary return statement from a void function. This issue is identified by checkpatch.pl Signed-off-by: Somya Anand <somyaanand214@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06Staging: rtl8188eu: Remove redundant local variableSomya Anand
This patch removes a redundant variable "raid" and adds inline return statements. This issue is identified by the following coccinelle script: @@ expression ret; identifier f; @@ -ret = +return f(...); -return ret; Signed-off-by: Somya Anand <somyaanand214@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06staging: rtl8188eu: replace memset(x,0,ETH_ALEN)Aya Mahfouz
eth_zero_addr() is a wrapper function for memset if 0 is going to be assigned to a mac address. The aforementioned function replaces memset. In addition, linux/etherdevice.h was included as a header since it is the file that define the inline function eth_zero_addr(). The changes were carried out using 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-06staging: rtl8188eu: remove extra parentheses around right bit shift operationsAya Mahfouz
Removes extra parentheses around bitwise right shift operations. The cases handled here are when resultant values are assigned to variables. The issue was 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 ,...); Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-02staging: rtl8188eu: Remove memset.Navya Sri Nizamkari
The memory area set by the call to memset is immediately overwritten by the subsequent call to memcpy. Hence, remove that redundant memset. Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-02staging: rtl8188eu: Add blank line after declarationsNavya Sri Nizamkari
This patch removes the following checkpatch.pl warning: WARNING: Missing a blank line after declarations Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-02staging: rtl8188eu: Compress two statements into one.Navya Sri Nizamkari
This patch removes the use of a variable used only for returning a value. The following coccinelle script was used to discover it: @@ expression ret; identifier f; @@ -ret = +return f(...); -return ret; It also fixes the checkpatch.pl warning about line being over 80 characters, in the lines where changes were made. Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-02Staging: rtl8188eu: Remove unused variableVatika Harlalka
Remove unused variable assignment for is2t and assign sim_bitmap at declaration to make the code more compact. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-02staging: rtl8188eu: os_dep: remove unused variableAya Mahfouz
This patch removes a variable that was simply used to store the return value of a function call before returning it. The issue was detected and resolved using the following coccinelle script: @@ identifier len,f; @@ -int len; ... when != len when strict -len = +return f(...); -return len; Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-02Staging: rtl8188eu: Move variable assignmentVatika Harlalka
Variable path_on is assigned explicitly in the if branch and so its assignment outside can be moved to the else branch. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01Staging: rtl8188eu: Remove braces from single statement blockVatika Harlalka
Remove braces from single statement if condition to follow kernel coding convention. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8188eu: Remove unnecessary codeVatika Harlalka
Code removed as variables assigned are not used anywhere. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26staging: rtl8188eu: rewrite the right hand side of an assignmentAya Mahfouz
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-26staging: rtl8188eu: rewrite the right hand side of an assignmentAya Mahfouz
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-26staging: rtl8188eu: rewrite the right hand side of an assignmentAya Mahfouz
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-26staging: rtl8188eu: rewrite the right hand side of an assignmentAya Mahfouz
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-26Staging: rtl8188eu: Replace if-else block with switch-caseVatika Harlalka
Replace if-else block with switch-case to make it more compact and increase readability. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8188eu: Refactor conditional code to increase readabilityVatika Harlalka
Remove the nested conditionals. The if and else-if have the same code so they are combined to make the code more compact. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8188eu: Combine two loops to increase readabilityVatika Harlalka
The first loop assigns values to ofdm_index array and the second checks for boundary conditions. They are combined and a comment is added to increase clarity. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8188eu: Remove unnecessary if conditionVatika Harlalka
Remove this branch as is2t is defined false and is not modified. The variable value32 is then unused. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8188eu: Remove unused macrosKatie Dunne
Removes macro definitions that are unused elsewhere Signed-off-by: Katie Dunne <kdunne@mail.ccsf.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8188eu: Remove unnecessary variableVatika Harlalka
Remove unnecessary variable and replace its uses with previously defined variable. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8188eu: Refactored code to increase readilityVatika Harlalka
Refactored the conditional code to make it more compact. Replaced the ternary operators with abs() macro to increase readability. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8188eu: Replace ternary operator with existing macroVatika Harlalka
Replace ternary operator with existing abs() macro to increase code readability. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8188eu: Remove redundant if conditionVatika Harlalka
Remove redundant if condition as !result is always false. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8188eu: Add blank line after declarationsMelike Yurtoglu
WARNING: "Missing a blank line after declarations" That was found by running checkpatch Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8188eu: Changed array and loop constructVatika Harlalka
This function only required the array from the 14th element onwards. Therefore, the array size is reduced and the loop counter is modified so as to start from 0. Also, the assignment of variable place is redundant as it is initialized again in the loop. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8188eu: Replace unneeded switch-case blockVatika Harlalka
Replace switch-case block with single if statement to increase code readability. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8188eu: Remove unnecessary variableVatika Harlalka
Remove unneccessary variable and replace its uses with another variable which is previously defined. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8188eu: Fix line over 80 charactersVatika Harlalka
Added a variable to reduce line size and enhance code readability. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8188eu: Use put_unaligned_le16Vaishali Thakkar
Using byte ordering functions and then memcpy() is risky and prone to hide errors which are hard to track down. So, this patch introduces the use of function put_unaligned_le16 which makes the code clear. Here, use of variable tim_bitmap_le and variable itself is removed. Also, to be compatible with the changes header file is added too. Coccinelle is used to do this change and semantic patch used for this is as follows: @a@ typedef __le16; __le16 e16; identifier tmp; expression ptr; expression y,e; type T; @@ - tmp = cpu_to_le16(y); <+... when != tmp ( - memcpy(ptr, (T)&tmp, \(2\|sizeof(__le16)\|sizeof(e16)\)); + put_unaligned_le16(y,ptr); | - memcpy(ptr, (T)&tmp, ...); + put_unaligned_le16(y,ptr); ) ...+> ? tmp = e @@ type T; identifier a.tmp; @@ - T tmp; ...when != tmp Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Preeti U Murthy <preeti@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8188eu: Remove unused struct ndis_802_11_keyVaishali Thakkar
This patch removes struct ndis_802_11_key as it is defined in a header file but never used. Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07staging: rtl8188eu: core: switch with redundant casesNicholas Mc Guire
A few redundant switch cases as well as a redundant if/else within one of the cases was consolidated to a single call. The cases are intentionally retained for documentation purposes. case WIFI_REASSOCREQ,WIFI_PROBEREQ,WIFI_BEACON,WIFI_ACTION all have the same effect - notably the also for WIFI_PROBEREQ where the if/else is executing the same function. These redundant cases could all be dropped and consolidated into the default but probably it is better for documentation/readability to leave them in the switch/case explicitly. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07staging: rtl8188eu: odm: conditional setting with no effectNicholas Mc Guire
The if and the else branch code are identical - so the condition has no effect on the effective code - this patch removes the condition and the duplicated code. Due to this being a fall-through-if here - the first if condition has no effect either - so it also can be removed. struct mlme_priv is thus also no longer needed here. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07staging: rtl8188eu: odm: condition with no effectNicholas Mc Guire
The if and the else branch code are identical - so the condition has no effect on the effective code - this patch removes the condition and the duplicated code. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>