summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8192u
AgeCommit message (Collapse)Author
2021-05-22staging: rtl8192u: Fix potential infinite loopColin Ian King
[ Upstream commit f9b9263a25dc3d2eaaa829e207434db6951ca7bc ] The for-loop iterates with a u8 loop counter i and compares this with the loop upper limit of riv->ieee80211->LinkDetectInfo.SlotNum that is a u16 type. There is a potential infinite loop if SlotNum is larger than the u8 loop counter. Fix this by making the loop counter the same type as SlotNum. Addresses-Coverity: ("Infinite loop") Fixes: 8fc8598e61f6 ("Staging: Added Realtek rtl8192u driver to staging") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210407150308.496623-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-17staging: rtl8192u: fix ->ssid overflow in r8192_wx_set_scan()Dan Carpenter
commit 87107518d7a93fec6cdb2559588862afeee800fb upstream. We need to cap len at IW_ESSID_MAX_SIZE (32) to avoid memory corruption. This can be controlled by the user via the ioctl. Fixes: 5f53d8ca3d5d ("Staging: add rtl8192SU wireless usb driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/YEHoAWMOSZBUw91F@mwanda Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-29staging: rtl8192u: Do not use GFP_KERNEL in atomic contextChristophe JAILLET
[ Upstream commit acac75bb451fd39344eb54fad6602dfc9482e970 ] 'rtl8192_irq_rx_tasklet()' is a tasklet initialized in 'rtl8192_init_priv_task()'. >From this function it is possible to allocate some memory with the GFP_KERNEL flag, which is not allowed in the atomic context of a tasklet. Use GFP_ATOMIC instead. The call chain is: rtl8192_irq_rx_tasklet (in r8192U_core.c) --> rtl8192_rx_nomal (in r8192U_core.c) --> ieee80211_rx (in ieee80211/ieee80211_rx.c) --> RxReorderIndicatePacket (in ieee80211/ieee80211_rx.c) Fixes: 79a5ccd97209 ("staging: rtl8192u: fix large frame size compiler warning") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/20200813173458.758284-1-christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-19staging: rtl8192u: fix a dubious looking mask before a shiftColin Ian King
[ Upstream commit c4283950a9a4d3bf4a3f362e406c80ab14f10714 ] Currently the masking of ret with 0xff and followed by a right shift of 8 bits always leaves a zero result. It appears the mask of 0xff is incorrect and should be 0xff00, but I don't have the hardware to test this. Fix this to mask the upper 8 bits before shifting. [ Not tested ] Addresses-Coverity: ("Operands don't affect result") Fixes: 8fc8598e61f6 ("Staging: Added Realtek rtl8192u driver to staging") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20200716154720.1710252-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-31staging: rtl8192u: fix multiple memory leaks on error pathNavid Emamdoost
[ Upstream commit ca312438cf176a16d4b89350cade8789ba8d7133 ] In rtl8192_tx on error handling path allocated urbs and also skb should be released. Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Link: https://lore.kernel.org/r/20190920025137.29407-1-navid.emamdoost@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-08-08staging:rtl8192u: Remove unused macro definitions - StyleJohn Whitmore
Removed unused macro definitions as they add nothing to the code. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging:rtl8192u: Add spaces around '+' operator - StyleJohn Whitmore
Add spaces around '+' operator as required by the coding standard. This clears the checkpatch issue. This change is purely coding style in nature and should have not effect on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging:rtl8192u: Remove stale comment - StyleJohn Whitmore
Remove a comment which appears to be from a previous version of code. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Replace magic number with defined constant - StyleJohn Whitmore
Replace the magic number '8' with defined constant which is normally used 'MAX_DEV_ADDR_SIZE'. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Remove comments - StyleJohn Whitmore
Removal of three comments. The comments in question do not add anything to the understanding of the code, and if they are necessary it would imply that the structure and its member variables are badly named. This is a simple style change and should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Remove blank line - StyleJohn Whitmore
Removal of a blank like which causes a checkpatch issue. This is a simple coding style change and should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Rename multiple variables - StyleJohn Whitmore
All of the variables used within the structures of the union qos_tclas cause checkpatch issue due to CamelCase naming. As none the member variables are used in code all have been changed on one patch. These changes are coding style in nature and should not impact runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Rename types in QOS_TCLAS union - StyleJohn Whitmore
Whilst none of the structures inside the qos_tclas union are used, their names conflict with the coding standard being named in uppercase. The names of all five have been changed to lowercase. This is a style change, and since none of the structures are referenced, these changes should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Remove typedef and rename QOS_TCLAS - StyleJohn Whitmore
Remove the typedef from the union QOS_TCLAS, which causes a checkpatch issue with defining new types. In addition, as a type, the name should be in lowercase so has been changed. These are coding style changes and should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Clean up of spacing - StyleJohn Whitmore
Multiple blank line, which cause an issue with checkpath, have been removed and the spacing of definitions have been aligned to look cleaner. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Rename Register Constants - StyleJohn Whitmore
The four register constants, 'Current_Tx_Rate_Reg', 'Initial_Tx_Rate_Reg', 'Tx_Retry_Count_Reg' and 'RegC38_TH' all cause checkpatch issue with CamelCase naming. The three have been renamed to 'CURRENT_TX_RATE_REG', 'INITIAL_TX_RATE_REG', 'TX_RETRY_COUNT_REG' and 'REG_C38_TH' respectively. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Rename constants - StyleJohn Whitmore
The constants 'VeryLowRSSI' and 'CTSToSelfTHVal' generate warnings from checkpatch due to the use of CamelCase naming. The two constants have been renamed to 'VERY_LOW_RSSI' and 'CTS_TO_SELF_TH_VAL' respectively. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Rename constants RateAdaptiveTH_Low_* - StyleJohn Whitmore
The two constants, RateAdaptiveTH_Low_20M and RateAdaptiveTH_Low_40M generate a checkpatch warning about CamelCase naming. The two have been renamed to clear this issue. RATE_ADAPTIVE_TH_LOW_20M and RATE_ADAPTIVE_TH_LOW_40M This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Rename RateAdaptiveTH_High - StyleJohn Whitmore
The constant RateAdaptiveTH_High causes a checkpatch issue with respect to CamelCase naming. As a result the constant has been renamed to RATE_ADAPTIVE_TH_HIGH. This is purely a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Rename DM_DIG_MIN_Netcore - StyleJohn Whitmore
The constant DM_DIG_MIN_Netcore causes a checkpatch issue with CamelCase naming so has been renamed to DM_DIG_MIN_NETCORE. This is a simple coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Refactor DCMD_TXCMD_T structure - StyleJohn Whitmore
The structure DCMD_TXCMD_T is declared with a typedef, which causes a checkpatch issue with defining new types. As a result the typedef has been removed. The structure's name DCMD_TXCMD_T, as a type, is meant to be lowercase so has been renamed to tx_config_cmd. The structures three members, (Op, Length, and Value) are all violating the coding standard policy on CamelCase naming, so have all been renamed. They have been renamed with longer names, (cmd_op, cmd_length and cmd_value), to make the variable names easier to search for in code. The magic numbers '4' and '12' have both been replaced with sizeof() calls, as they both represent the size of data elements. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Remove member reserved - StyleJohn Whitmore
The structure dynamic_rx_path_sel contains a u8 member variable called reserved. This member variable is never actually used in the code. The naming suggests that the sizeof the structure is significant but the only use of the structure is a local static in r8192U_dm.c: static struct dynamic_rx_path_sel DM_RxPathSelTable; There is no apparent significance to the sizeof the declared structure DM_RxPathSelTable. As a result the reserved member variable has been removed from the structure. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Rename member disabledRF - StyleJohn Whitmore
Rename the member variable disabledRF to disabled_rf. This change resolves the checkpatch issue with CamelCase naming. The change is purely a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Remove member diff_TH - StyleJohn Whitmore
The member variable diff_TH is assigned a constant value and then used in a comparison. The variable is never changed so the comparison can as easily be performed directly with the defined constant. The member variable has been removed and the defined constant RxPathSelection_diff_TH renamed to RX_PATH_SELECTION_DIFF_TH, to clear the checkpatch issue with CamelCase naming. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Remove SS_TH_low - StyleJohn Whitmore
The member variable SS_TH_low is assigned a constant and then used in a comparison. This member variable is redundant as the constant can be used directly for the comparison. In addition the constant RxPathSelection_SS_TH_low has been renamed to RX_PATH_SELECTION_SS_TH_LOW, to clear the checkpatch issue with CamelCase naming. These changes are coding style in nature and should not impact runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Rename cck_Rx_path - StyleJohn Whitmore
Rename the member variable cck_Rx_path to cck_rx_path. This clears the checkpatch issue with CamelCase naming. This is a coding style change which should have no impact one runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Remove member variable Enable - StyleJohn Whitmore
The structure dynamic_rx_path_sel defines a member variable 'Enable' which is initialised and later tested. The variable is however never changed to the test is redundant and the member variable is then never used. The member variable, initialisation and test have all been removed. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Remove unused extern DM_RxPathSelTable - StyleJohn Whitmore
The file r8192U_dm.h defines the structure DM_RxPathSelTable as being external. The structure is however declared in r8192U_dm.c and only used locally in that file. As a result the external definition has been removed and the declaration in r8192U_dm.c changed to being of type static. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Rename enum constants - StyleJohn Whitmore
Rename the two constants defined in the enumerated type enum cck_rx_path_method so that they are both uppercase, as suggested by the coding style. This is purely a coding style change and should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Remove member initialgain_lowerbound_state - StyleJohn Whitmore
The structure 'dig' defines a member variable 'initialgain_lowerbound_state', which although initialised to false, is never used in the code. As a result this unused member variable has been removed. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Remove member variable rx_gain_range_max - StyleJohn Whitmore
The structure 'dig' defines a member variable, (rx_gain_range_max) which is initialised to the value 'DM_DIG_MAX', (a defined constant). The variable is then used to test and set another variable. Since the member rx_gain_range_max is never assigned any other value then the constant 'DM_DIG_MAX' the code might as well simply use that constant, rather the a member variable set to that constant. The member variable has been removed and the constant used directly in the code. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-05staging:rtl8192u: Remove debug member from structures - StyleJohn Whitmore
Two structures, (struct dig and struct dynamic_rx_path_sel) contain a u8 member variable representing debug setting. In the file r8192U_dm.c these member variables, for both structures, are initialised to an enumerated constant 'DM_DBG_OFF'. The member variables are never assigned another value, other then off. Later in code the member variables are tested to for equality to 'DM_DBG_OFF' and if that is the case an assignment statement is executed. Since the value of the variables is always off the test is redundant and the conditional branch can just be executed without the test. Since the member variables are then actually used both have been removed, along with the enumerated type which defines debug status, on/off. These are coding style changes to remove unused or redundant code, there should be no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging:rtl8192u: Change clock comment - StyleJohn Whitmore
A number of block comments have been changed to comply with the coding standard. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging:rtl8192u: Rename IsACValid and add parenthesis - StyleJohn Whitmore
The macro IsACValid is renamed to resolve the checkpatch issue with CamelCase naming. In addition the parameter has parenthesis added to clear the checkpatch issue with precedence issues. These changes are coding style changes and as such should have not impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging:rtl8192u: Remove unused UP2AC - StyleJohn Whitmore
The macro UP2AC is commented out of the header file so the macro and its associated comment are removed. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging:rtl8192u: Rename octet_string members - StyleJohn Whitmore
Rename the structure octet_string's member variables Octet to octet and Length to length. This change clears the checkpatch issue with CamelCase naming of variables. This is purely a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging:rtl8192u: rename OCTET_STRING - StyleJohn Whitmore
Rename the structure OCTET_STRING to octet_string. This is to comply with the coding style of using lowercase for types. In addition the typedef directive is removed to clear the checkpatch issue with defining new types. These are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging:rtl8192u: Move QOS_TCLAS to rtl819x_TS.h - StyleJohn Whitmore
Move the union QOS_TCLAS from the header file rtl819x_Qos.h to header file rtl819x_TS.h, where the structure is actually used, as the member of another structure. This is a coding style change, which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging:rtl8192u: Remove commented out code - StyleJohn Whitmore
A number of structures have been commented out of code. Obviously they are not used and as a result have been removed from the code. This is a coding style change which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging:rtl8192u: Rename tspec_body members - StyleJohn Whitmore
The member variables of the tspec_body have been renamed to clear the checkpatch issue with CamelCase naming. As these member variables are never used in the code the changes are combined into this single patch. These changes are coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging:rtl8192u: Rename TSInfo - StyleJohn Whitmore
Rename TSInfo, the memeber variable of struct tspec_body to ts_info. This change clears the checkpatch issue with CamelCase naming. This is a coding style change which should not impact runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging:rtl8192u: Refactor union TSPEC_BODY - StyleJohn Whitmore
The union TSPEC_BODY is never used as a union. The union comprises an array of bytes and a bitfield structure, both of which are 55 bytes in length, but the byte array is never used. As a result the union has been truncated to the bitfield struct, which is actually used. Additionally the typedef has been removed from the structure to clear the checkpatch issue with defining new types. Additionally the name has been changed to lowercase to comply with coding style. These changes are all coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging:rtl8192u: Rename members of struct qos_tsinfo - StyleJohn Whitmore
The member variables of struct qos_tsinfo all cause checkpatch issues with CamelCase naming. As the variables are used in so few places the changes are combined into this single patch. Additionally the member variable usReserved is never used in code so has been removed. These are all coding style changes which should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging:rtl8192u: Remove union from qos_tsinfo - StyleJohn Whitmore
The union is never used as a union but only as a bitfield struct. One side of the union (u8 charData[3];) Only seems to be present to ensure that the structures size is 3 bytes in length. That length, of the structure is dictated by the largest element of the union, so the byte array only dictates size if it's the largest element of the union. The byte array and union add nothing. The union has therefore been removed and the structure and access to the structure simplified. Additionally since one of the bitfield variables (ucAccessPolicy) spans a byte boundary the base type of the bitfield has been changed from u8 to u16. Compilers have probably moved on from having an issue with this, call it OCD. The changes are coding style in nature and should not impact runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging:rtl8192u: Remove union from aci_aifsn - StyleJohn Whitmore
The union aci_aifsn is not used as a union, but only as a struct. The union seems to have been used to ensure that the size of the structure was only a single byte. That size is set by the bitfield structure, adding a union with an unused byte adds nothing. The union has been removed. This is a coding style change and should not impact runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02staging:rtl8192u: Clean cmpk_counttxstatistic() comments - StyleJohn Whitmore
The only useful piece of information in the header comment of this static function was the name of the function and parameters. That is not useful information, given that they are in the C Source of the function declaration, a few lines below the comment. The block comment has been removed. This is a coding style change, there should be no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-30staging:rtl8192u: Refactor enum DM_CCK_Rx_Path_Method - StyleJohn Whitmore
The enumerated type DM_CCK_Rx_Path_Method is used as a container for constant definitions, rather then an enumerated type enabling compiler type checking. To correct this, the variable which uses the constants, defined by the enumeration, has had its type changed from a u8 to the enumeration. Additionally the type has been moved above the structure where the type is used, to avoid compiler error. The typedef has been removed from the enumerated type to clear the checkpatch issue with defining new types. The name of the type has been changed to cck_rx_path_method to clear the checkpatch issue with CamelCase naming. And the enumerated constant CCK_Rx_Version_MAX has been removed, since it is never used in code. The changes are all coding style in nature and so should have no impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-30staging:rtl8192u: Refactor enum dm_dig_cs_ratio_e - StyleJohn Whitmore
The enumerated type dm_dig_cs_ratio_e is never actually used as a type, but only as a collection of related constants. This is because the variables, which use the defined constant values, are defined as being of type u8 rather then tne enumerated type. This omission negates the possibility of taking advantage of compiler type checking. To enable the use of compiler type checking of the enumeration the two variables, (curcs_ratio_state & precs_ratio_state), which use the type's constants have their types changed from u8 to enum dig_cck_cs_ratio_state. Additionally the types declaration has been moved above the dig structure, where the type is used. The 'typedef' keyword has been removed from the type to clear the checkpatch issue with defining new types. And the constant DIG_CS_MAX has been removed since this is never used in the code. These changes are purely coding style changes and should not impact on runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-30staging:rtl8192u: Refactor enum dm_dig_pd_th_e - StyleJohn Whitmore
The enumerated type dm_dig_pd_th_e is never actually used as the type for the two variables which use the constants, which the enumeration defines. This omission removes the possibility of taking advantage of compiler type checking. To correct this the two member variables, (curpd_thstate & prepd_thstate) have been changed to use the type enum dig_pkt_detection_threshold rather then u8. Additionally the enum's declaration has been moved above the dig structure, where the type is used, the 'typedef' has been removed to clear the checkpatch issue with defining new types, and the value 'DIG_PD_MAX' has been removed from the enumeration, since it is never used in code. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-30staging:rtl8192u: Refactor dm_dig_connect_e - StyleJohn Whitmore
The enumerated type dm_dig_connect_e is only used to group constant values, as the actual type is never used as the type for the variables which use the defined constants (cur_connect_state and pre_connect_state). These two member variables have had there defined types changed to properly reflect there usage and to permit compiler type checks to be performed. In addition the definition of the enumerated type has been moved above the structure which uses the type. The typedef of the enumerated type has been removed to clear the checkpatch issue with defining new types and the enumerated value DIG_CONNECT_MAX has been removed since it is never used in code. The resulting changes are all coding style in nature and should not impact runtime code execution. Signed-off-by: John Whitmore <johnfwhitmore@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>