Skip to content

Commit 5642424

Browse files
mistraubegregkh
authored andcommitted
staging: rtl8192e: clean up brace coding style issues
Clean up brace coding style in if/else statements to improve readability and clear checkpatch issues. CHECK: braces {} should be used on all arms of this statement CHECK: Unbalanced braces around else statement Signed-off-by: Michael Straube <straube.linux@gmail.com> Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/20230619150953.22484-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 13904f9 commit 5642424

7 files changed

Lines changed: 30 additions & 22 deletions

File tree

drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,9 @@ void rtl92e_link_change(struct net_device *dev)
765765
;
766766
else
767767
priv->receive_config = reg |= RCR_CBSSID;
768-
} else
768+
} else {
769769
priv->receive_config = reg &= ~RCR_CBSSID;
770+
}
770771

771772
rtl92e_writel(dev, RCR, reg);
772773
}

drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ void rtl92e_set_bb_reg(struct net_device *dev, u32 dwRegAddr, u32 dwBitMask,
3939
BitShift = _rtl92e_calculate_bit_shift(dwBitMask);
4040
NewValue = (OriginalValue & ~dwBitMask) | (dwData << BitShift);
4141
rtl92e_writel(dev, dwRegAddr, NewValue);
42-
} else
42+
} else {
4343
rtl92e_writel(dev, dwRegAddr, dwData);
44+
}
4445
}
4546

4647
u32 rtl92e_get_bb_reg(struct net_device *dev, u32 dwRegAddr, u32 dwBitMask)
@@ -163,10 +164,10 @@ void rtl92e_set_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath,
163164

164165
_rtl92e_phy_rf_fw_write(dev, eRFPath, RegAddr,
165166
New_Value);
166-
} else
167+
} else {
167168
_rtl92e_phy_rf_fw_write(dev, eRFPath, RegAddr, Data);
169+
}
168170
udelay(200);
169-
170171
} else {
171172
if (BitMask != bMask12Bits) {
172173
Original_Value = _rtl92e_phy_rf_read(dev, eRFPath,
@@ -175,8 +176,9 @@ void rtl92e_set_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath,
175176
New_Value = (Original_Value & ~BitMask) | (Data << BitShift);
176177

177178
_rtl92e_phy_rf_write(dev, eRFPath, RegAddr, New_Value);
178-
} else
179+
} else {
179180
_rtl92e_phy_rf_write(dev, eRFPath, RegAddr, Data);
181+
}
180182
}
181183
}
182184

drivers/staging/rtl8192e/rtl8192e/rtl_dm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,9 @@ static void _rtl92e_dm_tx_power_tracking_callback_tssi(struct net_device *dev)
622622
} else if (priv->rtllib->current_network.channel != 14 && priv->bcck_in_ch14) {
623623
priv->bcck_in_ch14 = false;
624624
rtl92e_dm_cck_txpower_adjust(dev, priv->bcck_in_ch14);
625-
} else
625+
} else {
626626
rtl92e_dm_cck_txpower_adjust(dev, priv->bcck_in_ch14);
627+
}
627628
}
628629

629630
if (priv->cck_present_attn_diff <= -12 ||

drivers/staging/rtl8192e/rtl8192e/rtl_ps.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,9 @@ void rtl92e_leisure_ps_enter(struct net_device *dev)
219219

220220
if (priv->rtllib->ps == RTLLIB_PS_DISABLED)
221221
_rtl92e_ps_set_mode(dev, RTLLIB_PS_MBCAST | RTLLIB_PS_UNICAST);
222-
} else
222+
} else {
223223
psc->LpsIdleCount++;
224+
}
224225
}
225226
}
226227

drivers/staging/rtl8192e/rtl8192e/rtl_wx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,9 +568,9 @@ static int _rtl92e_wx_set_frag(struct net_device *dev,
568568
if (priv->hw_radio_off)
569569
return 0;
570570

571-
if (wrqu->frag.disabled)
571+
if (wrqu->frag.disabled) {
572572
priv->rtllib->fts = DEFAULT_FRAG_THRESHOLD;
573-
else {
573+
} else {
574574
if (wrqu->frag.value < MIN_FRAG_THRESHOLD ||
575575
wrqu->frag.value > MAX_FRAG_THRESHOLD)
576576
return -EINVAL;

drivers/staging/rtl8192e/rtllib_softmac.c

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -809,8 +809,9 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee,
809809
erpinfo_content = 0;
810810
if (ieee->current_network.buseprotection)
811811
erpinfo_content |= ERP_UseProtection;
812-
} else
812+
} else {
813813
erp_len = 0;
814+
}
814815

815816
crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx];
816817
encrypt = ieee->host_encrypt && crypt && crypt->ops &&
@@ -1383,9 +1384,9 @@ static void rtllib_associate_step1(struct rtllib_device *ieee, u8 *daddr)
13831384

13841385
skb = rtllib_authentication_req(beacon, ieee, 0, daddr);
13851386

1386-
if (!skb)
1387+
if (!skb) {
13871388
rtllib_associate_abort(ieee);
1388-
else {
1389+
} else {
13891390
ieee->link_state = RTLLIB_ASSOCIATING_AUTHENTICATING;
13901391
netdev_dbg(ieee->dev, "Sending authentication request\n");
13911392
softmac_mgmt_xmit(skb, ieee);
@@ -1408,9 +1409,9 @@ static void rtllib_auth_challenge(struct rtllib_device *ieee, u8 *challenge,
14081409

14091410
skb = rtllib_authentication_req(beacon, ieee, chlen + 2, beacon->bssid);
14101411

1411-
if (!skb)
1412+
if (!skb) {
14121413
rtllib_associate_abort(ieee);
1413-
else {
1414+
} else {
14141415
c = skb_put(skb, chlen + 2);
14151416
*(c++) = MFIE_TYPE_CHALLENGE;
14161417
*(c++) = chlen;
@@ -1439,9 +1440,9 @@ static void rtllib_associate_step2(struct rtllib_device *ieee)
14391440

14401441
ieee->softmac_stats.tx_ass_rq++;
14411442
skb = rtllib_association_req(beacon, ieee);
1442-
if (!skb)
1443+
if (!skb) {
14431444
rtllib_associate_abort(ieee);
1444-
else {
1445+
} else {
14451446
softmac_mgmt_xmit(skb, ieee);
14461447
mod_timer(&ieee->associate_timer, jiffies + (HZ / 2));
14471448
}
@@ -1583,11 +1584,12 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee,
15831584
net->ssid_len = net->hidden_ssid_len;
15841585
ssidbroad = 1;
15851586
}
1586-
} else
1587+
} else {
15871588
ssidmatch =
15881589
(ieee->current_network.ssid_len == net->ssid_len) &&
15891590
(!strncmp(ieee->current_network.ssid, net->ssid,
15901591
net->ssid_len));
1592+
}
15911593

15921594
/* if the user set the AP check if match.
15931595
* if the network does not broadcast essid we check the
@@ -2536,8 +2538,9 @@ static void rtllib_start_ibss_wq(void *data)
25362538
ieee->current_network.rates[3] =
25372539
RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_11MB;
25382540

2539-
} else
2541+
} else {
25402542
ieee->current_network.rates_len = 0;
2543+
}
25412544

25422545
if (ieee->modulation & RTLLIB_OFDM_MODULATION) {
25432546
ieee->current_network.rates_ex_len = 8;
@@ -3119,10 +3122,10 @@ void notify_wx_assoc_event(struct rtllib_device *ieee)
31193122
return;
31203123

31213124
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
3122-
if (ieee->link_state == MAC80211_LINKED)
3125+
if (ieee->link_state == MAC80211_LINKED) {
31233126
memcpy(wrqu.ap_addr.sa_data, ieee->current_network.bssid,
31243127
ETH_ALEN);
3125-
else {
3128+
} else {
31263129
netdev_info(ieee->dev, "%s(): Tell user space disconnected\n",
31273130
__func__);
31283131
eth_zero_addr(wrqu.ap_addr.sa_data);

drivers/staging/rtl8192e/rtllib_softmac_wx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ int rtllib_wx_set_rts(struct rtllib_device *ieee,
231231
struct iw_request_info *info,
232232
union iwreq_data *wrqu, char *extra)
233233
{
234-
if (wrqu->rts.disabled || !wrqu->rts.fixed)
234+
if (wrqu->rts.disabled || !wrqu->rts.fixed) {
235235
ieee->rts = DEFAULT_RTS_THRESHOLD;
236-
else {
236+
} else {
237237
if (wrqu->rts.value < MIN_RTS_THRESHOLD ||
238238
wrqu->rts.value > MAX_RTS_THRESHOLD)
239239
return -EINVAL;

0 commit comments

Comments
 (0)