Commit d3c90eff authored by John Whitmore's avatar John Whitmore Committed by Greg Kroah-Hartman

staging:rtl8192u: Refactor DCMD_TXCMD_T structure - Style

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: default avatarJohn Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 447558d2
...@@ -510,7 +510,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev) ...@@ -510,7 +510,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev)
{ {
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(dev);
bool viviflag = false; bool viviflag = false;
DCMD_TXCMD_T tx_cmd; struct tx_config_cmd tx_cmd;
u8 powerlevelOFDM24G; u8 powerlevelOFDM24G;
int i = 0, j = 0, k = 0; int i = 0, j = 0, k = 0;
u8 RF_Type, tmp_report[5] = {0, 0, 0, 0, 0}; u8 RF_Type, tmp_report[5] = {0, 0, 0, 0, 0};
...@@ -532,10 +532,10 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev) ...@@ -532,10 +532,10 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev)
RT_TRACE(COMP_POWER_TRACKING, "powerlevelOFDM24G = %x\n", powerlevelOFDM24G); RT_TRACE(COMP_POWER_TRACKING, "powerlevelOFDM24G = %x\n", powerlevelOFDM24G);
for (j = 0; j <= 30; j++) { /* fill tx_cmd */ for (j = 0; j <= 30; j++) { /* fill tx_cmd */
tx_cmd.Op = TXCMD_SET_TX_PWR_TRACKING; tx_cmd.cmd_op = TXCMD_SET_TX_PWR_TRACKING;
tx_cmd.Length = 4; tx_cmd.cmd_length = sizeof(tx_cmd.cmd_op);
tx_cmd.Value = Value; tx_cmd.cmd_value = Value;
rtStatus = SendTxCommandPacket(dev, &tx_cmd, 12); rtStatus = SendTxCommandPacket(dev, &tx_cmd, sizeof(struct tx_config_cmd));
if (rtStatus == RT_STATUS_FAILURE) if (rtStatus == RT_STATUS_FAILURE)
RT_TRACE(COMP_POWER_TRACKING, "Set configuration with tx cmd queue fail!\n"); RT_TRACE(COMP_POWER_TRACKING, "Set configuration with tx cmd queue fail!\n");
usleep_range(1000, 2000); usleep_range(1000, 2000);
......
...@@ -139,11 +139,12 @@ struct dynamic_rx_path_sel { ...@@ -139,11 +139,12 @@ struct dynamic_rx_path_sel {
long cck_pwdb_sta[4]; long cck_pwdb_sta[4];
}; };
typedef struct tag_Tx_Config_Cmd_Format { struct tx_config_cmd {
u32 Op; /* Command packet type. */ u32 cmd_op; /* Command packet type. */
u32 Length; /* Command packet length. */ u32 cmd_length; /* Command packet length. */
u32 Value; u32 cmd_value;
} DCMD_TXCMD_T, *PDCMD_TXCMD_T; };
/*------------------------------Define structure----------------------------*/ /*------------------------------Define structure----------------------------*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment