summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8192u
diff options
context:
space:
mode:
authorLen Baker <len.baker@gmx.com>2021-08-24 10:59:58 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-08-26 12:14:27 +0200
commitc4b30776bf2941e0d17d3f164e54e553b2456888 (patch)
treeef082ed655fb1d026944138e1f407811252c1771 /drivers/staging/rtl8192u
parent7dfe9fac786769e1a49fa350158d39b4fef237ba (diff)
staging/rtl8192u: Initialize variables in the definition block
Initialize the pre_cmd_cnt, post_cmd_cnt and rf_cmd_cnt variables in the definition block as it is not necessary to do this in the middle of the function. Signed-off-by: Len Baker <len.baker@gmx.com> Link: https://lore.kernel.org/r/20210824073643.GA7396@titan Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192u')
-rw-r--r--drivers/staging/rtl8192u/r819xU_phy.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/staging/rtl8192u/r819xU_phy.c b/drivers/staging/rtl8192u/r819xU_phy.c
index 6a67708cdd89..ff6fe2ee3349 100644
--- a/drivers/staging/rtl8192u/r819xU_phy.c
+++ b/drivers/staging/rtl8192u/r819xU_phy.c
@@ -1186,11 +1186,11 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,
{
struct r8192_priv *priv = ieee80211_priv(dev);
struct sw_chnl_cmd *pre_cmd;
- u32 pre_cmd_cnt;
+ u32 pre_cmd_cnt = 0;
struct sw_chnl_cmd *post_cmd;
- u32 post_cmd_cnt;
+ u32 post_cmd_cnt = 0;
struct sw_chnl_cmd *rf_cmd;
- u32 rf_cmd_cnt;
+ u32 rf_cmd_cnt = 0;
struct sw_chnl_cmd *current_cmd = NULL;
u8 e_rfpath;
bool ret;
@@ -1225,7 +1225,6 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,
/* FIXME: need to check whether channel is legal or not here */
/* <1> Fill up pre common command. */
- pre_cmd_cnt = 0;
rtl8192_phy_SetSwChnlCmdArray(pre_cmd, pre_cmd_cnt++,
MAX_PRECMD_CNT, CMD_ID_SET_TX_PWR_LEVEL,
0, 0, 0);
@@ -1233,12 +1232,10 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,
MAX_PRECMD_CNT, CMD_ID_END, 0, 0, 0);
/* <2> Fill up post common command. */
- post_cmd_cnt = 0;
rtl8192_phy_SetSwChnlCmdArray(post_cmd, post_cmd_cnt++,
MAX_POSTCMD_CNT, CMD_ID_END, 0, 0, 0);
/* <3> Fill up RF dependent command. */
- rf_cmd_cnt = 0;
switch (priv->rf_chip) {
case RF_8225:
if (!(channel >= 1 && channel <= 14)) {