aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8192u/r819xU_phy.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-11-02License cleanup: add SPDX GPL-2.0 license identifier to files with no licenseGreg Kroah-Hartman1-0/+1
Many source files in the tree are missing licensing information, which makes it harder for compliance tools to determine the correct license. By default all files without license information are under the default license of the kernel, which is GPL version 2. Update the files which contain no license information with the 'GPL-2.0' SPDX license identifier. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This patch is based on work done by Thomas Gleixner and Kate Stewart and Philippe Ombredanne. How this work was done: Patches were generated and checked against linux-4.14-rc6 for a subset of the use cases: - file had no licensing information it it. - file was a */uapi/* one with no licensing information in it, - file was a */uapi/* one with existing licensing information, Further patches will be generated in subsequent months to fix up cases where non-standard license headers were used, and references to license had to be inferred by heuristics based on keywords. The analysis to determine which SPDX License Identifier to be applied to a file was done in a spreadsheet of side by side results from of the output of two independent scanners (ScanCode & Windriver) producing SPDX tag:value files created by Philippe Ombredanne. Philippe prepared the base worksheet, and did an initial spot review of a few 1000 files. The 4.13 kernel was the starting point of the analysis with 60,537 files assessed. Kate Stewart did a file by file comparison of the scanner results in the spreadsheet to determine which SPDX license identifier(s) to be applied to the file. She confirmed any determination that was not immediately clear with lawyers working with the Linux Foundation. Criteria used to select files for SPDX license identifier tagging was: - Files considered eligible had to be source code files. - Make and config files were included as candidates if they contained >5 lines of source - File already had some variant of a license header in it (even if <5 lines). All documentation files were explicitly excluded. The following heuristics were used to determine which SPDX license identifiers to apply. - when both scanners couldn't find any license traces, file was considered to have no license information in it, and the top level COPYING file license applied. For non */uapi/* files that summary was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 11139 and resulted in the first patch in this series. If that file was a */uapi/* path one, it was "GPL-2.0 WITH Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 WITH Linux-syscall-note 930 and resulted in the second patch in this series. - if a file had some form of licensing information in it, and was one of the */uapi/* ones, it was denoted with the Linux-syscall-note if any GPL family license was found in the file or had no licensing in it (per prior point). Results summary: SPDX license identifier # files ---------------------------------------------------|------ GPL-2.0 WITH Linux-syscall-note 270 GPL-2.0+ WITH Linux-syscall-note 169 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17 LGPL-2.1+ WITH Linux-syscall-note 15 GPL-1.0+ WITH Linux-syscall-note 14 ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5 LGPL-2.0+ WITH Linux-syscall-note 4 LGPL-2.1 WITH Linux-syscall-note 3 ((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3 ((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1 and that resulted in the third patch in this series. - when the two scanners agreed on the detected license(s), that became the concluded license(s). - when there was disagreement between the two scanners (one detected a license but the other didn't, or they both detected different licenses) a manual inspection of the file occurred. - In most cases a manual inspection of the information in the file resulted in a clear resolution of the license that should apply (and which scanner probably needed to revisit its heuristics). - When it was not immediately clear, the license identifier was confirmed with lawyers working with the Linux Foundation. - If there was any question as to the appropriate license identifier, the file was flagged for further research and to be revisited later in time. In total, over 70 hours of logged manual review was done on the spreadsheet to determine the SPDX license identifiers to apply to the source files by Kate, Philippe, Thomas and, in some cases, confirmation by lawyers working with the Linux Foundation. Kate also obtained a third independent scan of the 4.13 code base from FOSSology, and compared selected files where the other two scanners disagreed against that SPDX file, to see if there was new insights. The Windriver scanner is based on an older version of FOSSology in part, so they are related. Thomas did random spot checks in about 500 files from the spreadsheets for the uapi headers and agreed with SPDX license identifier in the files he inspected. For the non-uapi files Thomas did random spot checks in about 15000 files. In initial set of patches against 4.14-rc6, 3 files were found to have copy/paste license identifier errors, and have been fixed to reflect the correct identifier. Additionally Philippe spent 10 hours this week doing a detailed manual inspection and review of the 12,461 patched files from the initial patch version early this week with: - a full scancode scan run, collecting the matched texts, detected license ids and scores - reviewing anything where there was a license detected (about 500+ files) to ensure that the applied SPDX license was correct - reviewing anything where there was no detection but the patch license was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied SPDX license was correct This produced a worksheet with 20 files needing minor correction. This worksheet was then exported into 3 different .csv files for the different types of files to be modified. These .csv files were then reviewed by Greg. Thomas wrote a script to parse the csv files and add the proper SPDX tag to the file, in the format that the file expected. This script was further refined by Greg based on the output to detect more types of files automatically and to distinguish between header and source .c files (which need different comment types.) Finally Greg ran the script using the .csv files to generate the patches. Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: rtl8192u: fix spelling mistake in variable name *attentuationColin Ian King1-17/+17
Fix the spelling of a bunch of variables, from *attentuation to *attenuation. No functional change. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12Staging: rtl8192u: r819xU_phy.c - style fixDerek Robson1-14/+27
Fixed style of block comments Found using checkpatch Signed-off-by: Derek Robson <robsonde@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: rtl8192u: use to_delayed_workGeliang Tang1-2/+1
Use to_delayed_work() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15staging: rtl8192u: Remove unnecessary functionAmitoj Kaur Chawla1-20/+5
This patch solves two problems. The function rtl8192_CalculateBitShift() had an unnecessary variable i that could be removed by using a single line of code. After this change, rtl8192_CalculateBitShift() becomes a wrapper function, so the rtl8192_CalculateBitShift() function has been removed completely to replace it with a single line of code. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-13rtl8192u: BIT() macro cleanupAnish Bhatt1-2/+2
Use the BIT(x) macro directly instead using multiple BITX defines. Signed-off-by: Anish Bhatt <anish@gatech.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20Staging: rtl8192u: Remove unnecessary spacesHatice ERTÜRK1-4/+4
Fix checkpatch.pl issues with "unnecessary whitespace before a quoted newline" in r819xU_phy.c Signed-off-by: Hatice ERTURK <haticeerturk27@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16Staging: rtl8192u: Remove parentheses around right side an assignmentHaneen Mohammed1-2/+2
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: rtl8192u: Bool tests don't need comparisonsCristina Opriceana1-1/+1
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-01Staging: rtl8192u: Replace TRUE and FALSE macrosKsenija Stanojevic1-2/+2
Replace all occurrences of TRUE and FALSE by true and false respectively. Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8192u: Remove break statementKsenija Stanojevic1-1/+0
This patch fixes the checkpatch.pl warning: WARNING: "break is not useful after a goto or return" Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8192: Simplifying if-else statementKsenija Stanojevic1-6/+4
This patch simplifies the code by not having two identical paths and fixes the warning given by checkpatch.pl: "else is not useful after a break or return". Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8192u: Simplify if conditionKsenija Stanojevic1-1/+1
Remove unnecessary TRUE statement. Field bMediaConnect is of bool type, so such change is correct. Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8192u: Remove else after returnKsenija Stanojevic1-4/+3
This patch simplifies the code by removing else and fixes the following checkpatch.pl warning: "else is not useful after break or return". Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: rtl8192u: Remove space before tabKsenija Stanojevic1-4/+4
This patch fixes the checkpatch.pl warning: WARNING: "please, no space before tabs" Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20staging: rtl8192u: Missing a blank line after declarations.Melike Yurtoglu1-0/+1
Missing a blank line after declarations" checkpatch.pl warning in r819xU_phy.c Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-10staging: rtl8192u: Fixed switch and case indentation errorsanjeev sharma1-6/+6
This patch will fix switch and case indentation Error reported by checkpatch script. Signed-off-by: Sanjeev Sharma <Sanjeev_Sharma@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-10staging: rtl8192u: Remove useless return statementsanjeev sharma1-13/+0
This patch will remove unneeded return statements in code. Signed-off-by: Sanjeev Sharma <Sanjeev_Sharma@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-26drivers/staging: Remove useless return variablesPeter Senna Tschudin1-2/+1
This patch remove variables that are initialized with a constant, are never updated, and are only used as parameter of return. Return the constant instead of using a variable. Verified by compilation only. The coccinelle script that find and fixes this issue is: // <smpl> @@ type T; constant C; identifier ret; @@ - T ret = C; ... when != ret when strict return - ret + C ; // </smpl> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03staging: rtl8192u: fix checkpatch braces warningRui Miguel Silva1-2/+1
fix some code style related to the use of braces in a one statement block Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-16staging: rtl8192u: make in r819xU_phy.c some local functions staticAna Rey1-14/+15
Make some local functions static and fix coding style in these function declarations when It is necessary These are the local functions that were made static: rtl8192_CalculateBitShift, rtl8192_phy_RFSerialRead, rtl8192_phy_RFSerialWrite, rtl8192_InitBBRFRegDef, rtl8192_BB_Config_ParaFile,rtl8192_SetTxPowerLevel, rtl8192_phy_SetSwChnlCmdArray, rtl8192_phy_SwChnlStepByStep, rtl8192_phy_FinishSwChnlNow Fixed the following sparse warnings in r819xU_phy.c drivers/staging/rtl8192u/r819xU_phy.c:47:5: warning: symbol 'rtl8192_CalculateBitShift' was not declared. Should it be static? drivers/staging/rtl8192u/r819xU_phy.c:147:5: warning: symbol 'rtl8192_phy_RFSerialRead' was not declared. Should it be static? drivers/staging/rtl8192u/r819xU_phy.c:232:6: warning: symbol 'rtl8192_phy_RFSerialWrite' was not declared. Should it be static? drivers/staging/rtl8192u/r819xU_phy.c:574:6: warning: symbol 'rtl8192_InitBBRFRegDef' was not declared. Should it be static? drivers/staging/rtl8192u/r819xU_phy.c:783:6: warning: symbol 'rtl8192_BB_Config_ParaFile' was not declared. Should it be static? drivers/staging/rtl8192u/r819xU_phy.c:1073:6: warning: symbol 'rtl8192_SetTxPowerLevel' was not declared. Should it be static? drivers/staging/rtl8192u/r819xU_phy.c:1242:4: warning: symbol 'rtl8192_phy_SetSwChnlCmdArray' was not declared. Should it be static? drivers/staging/rtl8192u/r819xU_phy.c:1279:4: warning: symbol 'rtl8192_phy_SwChnlStepByStep' was not declared. Should it be static? drivers/staging/rtl8192u/r819xU_phy.c:1436:6: warning: symbol 'rtl8192_phy_FinishSwChnlNow' was not declared. Should it be static? Signed-off-by: Ana Rey <anarey@gmail.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2013-10-16Staging: rtl8192u: fix functions that should not be declared externTeodora Baluta1-1/+1
These functions are already marked extern in the header file drivers/staging/rtl8192u/r819xU_phy.c:1716:13: warning: function 'InitialGainOperateWorkItemCallBack' with external linkage has definition drivers/staging/rtl8192u/r819xU_cmdpkt.c:497:12: warning: function 'cmpk_message_handle_rx' with external linkage has definition Signed-off-by: Teodora Baluta <teobaluta@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25staging: rtl8192u: remove code inside #ifdef RTL8190P/RTL8192E in r819xU_phy.cXenia Ragiadakou1-6/+0
This patch removes the unused code inside #ifdef RTL8190P and #ifdef RTL8192E guards since RTL8190P and RTL8192E are not defined. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-24staging: rtl8192u: fix newlines in r819xU_phy.cXenia Ragiadakou1-16/+26
This patch fixes the newlines by: - adding a newline after variables declarations. - removing the newlines following the return statement. - removing the newlines between function header comments and function definitions. - adding one newline between function definitions. - adding a newline at the end of RT_TRACE messages. This was done to improve code's and logmessages' readability. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-24staging: rtl8192u: replace msleep(1) with usleep_range() in r819xU_phy.cXenia Ragiadakou1-3/+3
This patch fixes the following checkpatch warning: WARNING: msleep < 20ms can sleep for up to 20ms The implementation of msleep() is based on jiffies timeout subsystem. Hence, its resolution is constrained by the value of HZ tick rate. When HZ variable is configured to 100, the jiffies variable is updated every 10 ms, so a timeout of 1ms cannot be met using jiffies (it will be rounded up to 10ms). This patch replaces msleep(1) with usleep_range(1000, 1000). usleep_range() uses hrtimers subsystem which is not bound to HZ value and can provide microsecond-level resolution. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-24staging: rtl8192u: rename dwRegRead and rtStatus in r819xU_phy.cXenia Ragiadakou1-12/+12
This patch renames the following variables: 'dwRegRead' into 'reg' 'rtStatus' into 'status' This is done primarily to reduce line length below 80 chars, since the size and the usage of dwRegRead variable can be deduced by its type and the function called to assign it, so it can be replaced by simply 'reg'. Also, rtStatus is not more informative than just status in the given context. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-24staging: rtl8192u: replace __FUNCTION__ in r819xU_phy.cXenia Ragiadakou1-4/+4
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-24staging: rtl8192u: limit line size in r819xU_phy.cXenia Ragiadakou1-372/+505
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-19staging: rtl8192u: fix comments in r819xU_phy.cXenia Ragiadakou1-433/+475
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-19staging: rtl8192u: fix spaces around ',' in r819xU_phy.cXenia Ragiadakou1-31/+31
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-19staging: rtl8192u: remove variable 'Ret' in r819xU_phy.cXenia Ragiadakou1-3/+2
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-18staging: rtl8192u: rename general variables in r819xU_phy.cXenia Ragiadakou1-89/+89
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-18staging: rtl8192u: rename *BitMask variables in r819xU_phy.cXenia Ragiadakou1-41/+41
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-18staging: rtl8192u: replace *Value variables in r819xU_phy.cXenia Ragiadakou1-36/+39
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-18staging: rtl8192u: fix spaces around relational operators in r819xU_phy.cXenia Ragiadakou1-20/+20
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-18staging: rtl8192u: fix spaces around ';' in r819xU_phy.cXenia Ragiadakou1-6/+6
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-18staging: rtl8192u: fix spaces around '=' in r819xU_phy.cXenia Ragiadakou1-23/+23
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-17staging: rtl8192u: fix function arguments position in r819xU_phy.cXenia Ragiadakou1-32/+32
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-17staging: rtl8192u: fix spaces around ( and ) in r819xU_phy.cXenia Ragiadakou1-11/+11
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-17staging: rtl8192u: remove commented-out code in r819xU_phy.cXenia Ragiadakou1-49/+2
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-17staging: rtl8192u: fix spaces around for and while in r819xU_phy.cXenia Ragiadakou1-10/+10
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-17staging: rtl8192u: fix spaces around 'if' in r819xU_phy.cXenia Ragiadakou1-45/+45
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-17staging: rtl8192u: fix return statements in r819xU_phy.cXenia Ragiadakou1-5/+5
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-17staging: rtl8192u: fix braces in r819xU_phy.cXenia Ragiadakou1-202/+106
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-17staging: rtl8192u: fix bitshift calculation in r819xU_phy.cXenia Ragiadakou1-5/+3
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-11staging: rtl8192u: fix macros in r8192U.hXenia Ragiadakou1-1/+1
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-06staging: rtl8192u: fix read_nic_* functionsXenia Ragiadakou1-30/+34
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-05-13STAGING: rtl8192u: fix checkpatch error by adding space after switchXenia Ragiadakou1-17/+17
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-13STAGING: rtl8192u: fix checkpatch error about pointer position in r819xU_phyXenia Ragiadakou1-28/+28
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-01-07staging/rtl8192u: use same indent for switch and caseSebastian Hahn1-39/+39
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>