* [PATCH v2 0/6] staging: rtl8192e: Fix alignment to open parentheses
@ 2024-09-20 19:36 Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 1/6] staging: rtl8192e: r8190P_rtl8256.c: " Dominik Karol Piątkowski
` (6 more replies)
0 siblings, 7 replies; 10+ messages in thread
From: Dominik Karol Piątkowski @ 2024-09-20 19:36 UTC (permalink / raw)
To: gregkh, tdavies, philipp.g.hortmann, dan.carpenter
Cc: linux-staging, linux-kernel, Dominik Karol Piątkowski
This series aligns the code to open parentheses to improve readability.
v2: Split patch into smaller patches and refine them, exclude files conflicting
with https://lore.kernel.org/linux-staging/Zung-0ClV_527-_e@kernel-710/T/#t
Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
Dominik Karol Piątkowski (6):
staging: rtl8192e: r8190P_rtl8256.c: Fix alignment to open parentheses
staging: rtl8192e: rtl_ps.c: Fix alignment to open parentheses
staging: rtl8192e: rtllib_rx.c: Fix alignment to open parentheses
staging: rtl8192e: rtllib_softmac.c: Fix alignment to open parentheses
staging: rtl8192e: rtllib_softmac_wx.c: Fix alignment to open
parentheses
staging: rtl8192e: rtllib_wx.c: Fix alignment to open parentheses
.../rtl8192e/rtl8192e/r8190P_rtl8256.c | 9 +-
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 2 +-
drivers/staging/rtl8192e/rtllib_rx.c | 91 +++++++++----------
drivers/staging/rtl8192e/rtllib_softmac.c | 60 ++++++------
drivers/staging/rtl8192e/rtllib_softmac_wx.c | 60 ++++++------
drivers/staging/rtl8192e/rtllib_wx.c | 3 +-
6 files changed, 103 insertions(+), 122 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 1/6] staging: rtl8192e: r8190P_rtl8256.c: Fix alignment to open parentheses
2024-09-20 19:36 [PATCH v2 0/6] staging: rtl8192e: Fix alignment to open parentheses Dominik Karol Piątkowski
@ 2024-09-20 19:36 ` Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 2/6] staging: rtl8192e: rtl_ps.c: " Dominik Karol Piątkowski
` (5 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Dominik Karol Piątkowski @ 2024-09-20 19:36 UTC (permalink / raw)
To: gregkh, tdavies, philipp.g.hortmann, dan.carpenter
Cc: linux-staging, linux-kernel, Dominik Karol Piątkowski
This patch aligns the code to open parentheses to improve readability.
Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
---
drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c b/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c
index 7061f1cf4d3a..d909f5c4fd21 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c
@@ -101,12 +101,9 @@ bool rtl92e_config_rf(struct net_device *dev)
RF3_Final_Value = 0;
while (RF3_Final_Value != RegValueToBeCheck &&
RetryTimes != 0) {
- ret = rtl92e_config_rf_path(dev,
- (enum rf90_radio_path)eRFPath);
- RF3_Final_Value = rtl92e_get_rf_reg(dev,
- (enum rf90_radio_path)eRFPath,
- RegOffSetToBeCheck,
- bMask12Bits);
+ ret = rtl92e_config_rf_path(dev, (enum rf90_radio_path)eRFPath);
+ RF3_Final_Value = rtl92e_get_rf_reg(dev, (enum rf90_radio_path)eRFPath,
+ RegOffSetToBeCheck, bMask12Bits);
RetryTimes--;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 2/6] staging: rtl8192e: rtl_ps.c: Fix alignment to open parentheses
2024-09-20 19:36 [PATCH v2 0/6] staging: rtl8192e: Fix alignment to open parentheses Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 1/6] staging: rtl8192e: r8190P_rtl8256.c: " Dominik Karol Piątkowski
@ 2024-09-20 19:36 ` Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 3/6] staging: rtl8192e: rtllib_rx.c: " Dominik Karol Piątkowski
` (4 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Dominik Karol Piątkowski @ 2024-09-20 19:36 UTC (permalink / raw)
To: gregkh, tdavies, philipp.g.hortmann, dan.carpenter
Cc: linux-staging, linux-kernel, Dominik Karol Piątkowski
This patch aligns the code to open parentheses to improve readability.
Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
---
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
index 7b6247acf6f4..dba35ba20dac 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
@@ -118,7 +118,7 @@ void rtl92e_ips_enter(struct net_device *dev)
rt_state = priv->rtllib->rf_power_state;
if (rt_state == rf_on && !psc->bSwRfProcessing &&
- (priv->rtllib->link_state != MAC80211_LINKED)) {
+ (priv->rtllib->link_state != MAC80211_LINKED)) {
psc->eInactivePowerState = rf_off;
_rtl92e_ps_update_rf_state(dev);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 3/6] staging: rtl8192e: rtllib_rx.c: Fix alignment to open parentheses
2024-09-20 19:36 [PATCH v2 0/6] staging: rtl8192e: Fix alignment to open parentheses Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 1/6] staging: rtl8192e: r8190P_rtl8256.c: " Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 2/6] staging: rtl8192e: rtl_ps.c: " Dominik Karol Piątkowski
@ 2024-09-20 19:36 ` Dominik Karol Piątkowski
2024-09-21 13:51 ` Philipp Hortmann
2024-09-20 19:36 ` [PATCH v2 4/6] staging: rtl8192e: rtllib_softmac.c: " Dominik Karol Piątkowski
` (3 subsequent siblings)
6 siblings, 1 reply; 10+ messages in thread
From: Dominik Karol Piątkowski @ 2024-09-20 19:36 UTC (permalink / raw)
To: gregkh, tdavies, philipp.g.hortmann, dan.carpenter
Cc: linux-staging, linux-kernel, Dominik Karol Piątkowski
This patch aligns the code to open parentheses to improve readability.
Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
---
drivers/staging/rtl8192e/rtllib_rx.c | 91 +++++++++++++---------------
1 file changed, 42 insertions(+), 49 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 8fe224a83dd6..e58be8e07917 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -409,12 +409,10 @@ static bool add_reorder_entry(struct rx_ts_record *ts,
while (list->next != &ts->rx_pending_pkt_list) {
if (SN_LESS(reorder_entry->seq_num, ((struct rx_reorder_entry *)
- list_entry(list->next, struct rx_reorder_entry,
- list))->seq_num))
+ list_entry(list->next, struct rx_reorder_entry, list))->seq_num))
list = list->next;
- else if (SN_EQUAL(reorder_entry->seq_num,
- ((struct rx_reorder_entry *)list_entry(list->next,
- struct rx_reorder_entry, list))->seq_num))
+ else if (SN_EQUAL(reorder_entry->seq_num, ((struct rx_reorder_entry *)
+ list_entry(list->next, struct rx_reorder_entry, list))->seq_num))
return false;
else
break;
@@ -600,7 +598,7 @@ static void rx_reorder_indicate_packet(struct rtllib_device *ieee,
if (!list_empty(&ieee->RxReorder_Unused_List)) {
reorder_entry = (struct rx_reorder_entry *)
list_entry(ieee->RxReorder_Unused_List.next,
- struct rx_reorder_entry, list);
+ struct rx_reorder_entry, list);
list_del_init(&reorder_entry->list);
/* Make a reorder entry and insert
@@ -736,7 +734,7 @@ static u8 parse_subframe(struct rtllib_device *ieee, struct sk_buff *skb,
/* just for debug purpose */
seq_num = WLAN_GET_SEQ_SEQ(le16_to_cpu(hdr->seq_ctrl));
if ((RTLLIB_QOS_HAS_SEQ(fc)) &&
- (((union frameqos *)(skb->data + RTLLIB_3ADDR_LEN))->field.reserved))
+ (((union frameqos *)(skb->data + RTLLIB_3ADDR_LEN))->field.reserved))
is_aggregate_frame = true;
if (RTLLIB_QOS_HAS_SEQ(fc))
@@ -876,9 +874,9 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
frag = WLAN_GET_SEQ_FRAG(sc);
if (!ieee->ht_info->cur_rx_reorder_enable ||
- !ieee->current_network.qos_data.active ||
- !is_data_frame(skb->data) ||
- is_legacy_data_frame(skb->data)) {
+ !ieee->current_network.qos_data.active ||
+ !is_data_frame(skb->data) ||
+ is_legacy_data_frame(skb->data)) {
if (!ieee80211_is_beacon(hdr->frame_control)) {
if (is_duplicate_packet(ieee, hdr))
return -1;
@@ -887,7 +885,7 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
struct rx_ts_record *ts = NULL;
if (rtllib_get_ts(ieee, (struct ts_common_info **)&ts, hdr->addr2,
- (u8)frame_qos_tid((u8 *)(skb->data)), RX_DIR, true)) {
+ (u8)frame_qos_tid((u8 *)(skb->data)), RX_DIR, true)) {
if ((fc & (1 << 11)) && (frag == ts->rx_last_frag_num) &&
(WLAN_GET_SEQ_SEQ(sc) == ts->rx_last_seq_num))
return -1;
@@ -976,7 +974,7 @@ static int rtllib_rx_data_filter(struct rtllib_device *ieee, struct ieee80211_hd
}
static int rtllib_rx_get_crypt(struct rtllib_device *ieee, struct sk_buff *skb,
- struct lib80211_crypt_data **crypt, size_t hdrlen)
+ struct lib80211_crypt_data **crypt, size_t hdrlen)
{
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
u16 fc = le16_to_cpu(hdr->frame_control);
@@ -1008,8 +1006,8 @@ static int rtllib_rx_get_crypt(struct rtllib_device *ieee, struct sk_buff *skb,
}
static int rtllib_rx_decrypt(struct rtllib_device *ieee, struct sk_buff *skb,
- struct rtllib_rx_stats *rx_stats,
- struct lib80211_crypt_data *crypt, size_t hdrlen)
+ struct rtllib_rx_stats *rx_stats,
+ struct lib80211_crypt_data *crypt, size_t hdrlen)
{
struct ieee80211_hdr *hdr;
int keyidx = 0;
@@ -1092,7 +1090,7 @@ static int rtllib_rx_decrypt(struct rtllib_device *ieee, struct sk_buff *skb,
* encrypted/authenticated
*/
if ((fc & IEEE80211_FCTL_PROTECTED) &&
- rtllib_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt)) {
+ rtllib_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt)) {
netdev_info(ieee->dev, "%s: ==>decrypt msdu error\n", __func__);
return -1;
}
@@ -1152,10 +1150,10 @@ static void rtllib_rx_check_leave_lps(struct rtllib_device *ieee, u8 unicast,
}
static void rtllib_rx_indicate_pkt_legacy(struct rtllib_device *ieee,
- struct rtllib_rx_stats *rx_stats,
- struct rtllib_rxb *rxb,
- u8 *dst,
- u8 *src)
+ struct rtllib_rx_stats *rx_stats,
+ struct rtllib_rxb *rxb,
+ u8 *dst,
+ u8 *src)
{
struct net_device *dev = ieee->dev;
u16 ethertype;
@@ -1175,9 +1173,9 @@ static void rtllib_rx_indicate_pkt_legacy(struct rtllib_device *ieee,
*/
ethertype = (sub_skb->data[6] << 8) | sub_skb->data[7];
if (sub_skb->len >= 8 &&
- ((memcmp(sub_skb->data, rfc1042_header, SNAP_SIZE) == 0 &&
- ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) ||
- memcmp(sub_skb->data, bridge_tunnel_header, SNAP_SIZE) == 0)) {
+ ((memcmp(sub_skb->data, rfc1042_header, SNAP_SIZE) == 0 &&
+ ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) ||
+ memcmp(sub_skb->data, bridge_tunnel_header, SNAP_SIZE) == 0)) {
/* remove RFC1042 or Bridge-Tunnel encapsulation
* and replace EtherType
*/
@@ -1220,7 +1218,7 @@ static void rtllib_rx_indicate_pkt_legacy(struct rtllib_device *ieee,
}
static int rtllib_rx_infra_adhoc(struct rtllib_device *ieee, struct sk_buff *skb,
- struct rtllib_rx_stats *rx_stats)
+ struct rtllib_rx_stats *rx_stats)
{
struct net_device *dev = ieee->dev;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
@@ -1322,8 +1320,7 @@ static int rtllib_rx_infra_adhoc(struct rtllib_device *ieee, struct sk_buff *skb
&& !is_multicast_ether_addr(hdr->addr1)) {
TID = frame_qos_tid(skb->data);
seq_num = WLAN_GET_SEQ_SEQ(sc);
- rtllib_get_ts(ieee, (struct ts_common_info **)&ts, hdr->addr2, TID,
- RX_DIR, true);
+ rtllib_get_ts(ieee, (struct ts_common_info **)&ts, hdr->addr2, TID, RX_DIR, true);
if (TID != 0 && TID != 3)
ieee->bis_any_nonbepkts = true;
}
@@ -1380,7 +1377,7 @@ static int rtllib_rx_infra_adhoc(struct rtllib_device *ieee, struct sk_buff *skb
}
static int rtllib_rx_monitor(struct rtllib_device *ieee, struct sk_buff *skb,
- struct rtllib_rx_stats *rx_stats)
+ struct rtllib_rx_stats *rx_stats)
{
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
u16 fc = le16_to_cpu(hdr->frame_control);
@@ -1412,7 +1409,7 @@ static int rtllib_rx_monitor(struct rtllib_device *ieee, struct sk_buff *skb,
* This function is called only as a tasklet (software IRQ).
*/
int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb,
- struct rtllib_rx_stats *rx_stats)
+ struct rtllib_rx_stats *rx_stats)
{
int ret = 0;
@@ -1576,11 +1573,9 @@ static int rtllib_parse_qos_info_param_IE(struct rtllib_device *ieee,
} else {
struct rtllib_qos_parameter_info param_element;
- rc = rtllib_read_qos_param_element(¶m_element,
- info_element);
+ rc = rtllib_read_qos_param_element(¶m_element, info_element);
if (rc == 0) {
- rtllib_qos_convert_ac_to_parameters(¶m_element,
- &(network->qos_data));
+ rtllib_qos_convert_ac_to_parameters(¶m_element, &(network->qos_data));
network->flags |= NETWORK_HAS_QOS_PARAMETERS;
network->qos_data.param_count =
param_element.info_element.ac_info & 0x0F;
@@ -1693,8 +1688,9 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee,
MAX_IE_LEN);
if (*tmp_htcap_len != 0) {
network->bssht.bd_ht_spec_ver = HT_SPEC_VER_EWC;
- network->bssht.bd_ht_cap_len = min_t(u16, *tmp_htcap_len,
- sizeof(network->bssht.bd_ht_cap_buf));
+ network->bssht.bd_ht_cap_len =
+ min_t(u16, *tmp_htcap_len,
+ sizeof(network->bssht.bd_ht_cap_buf));
memcpy(network->bssht.bd_ht_cap_buf,
info_element->data,
network->bssht.bd_ht_cap_len);
@@ -1864,7 +1860,7 @@ static void rtllib_parse_mfie_ht_cap(struct rtllib_info_element *info_element,
if (*tmp_htcap_len != 0) {
ht->bd_ht_spec_ver = HT_SPEC_VER_EWC;
ht->bd_ht_cap_len = min_t(u16, *tmp_htcap_len,
- sizeof(ht->bd_ht_cap_buf));
+ sizeof(ht->bd_ht_cap_buf));
memcpy(ht->bd_ht_cap_buf, info_element->data, ht->bd_ht_cap_len);
ht->bd_support_ht = true;
@@ -1882,10 +1878,10 @@ static void rtllib_parse_mfie_ht_cap(struct rtllib_info_element *info_element,
}
int rtllib_parse_info_param(struct rtllib_device *ieee,
- struct rtllib_info_element *info_element,
- u16 length,
- struct rtllib_network *network,
- struct rtllib_rx_stats *stats)
+ struct rtllib_info_element *info_element,
+ u16 length,
+ struct rtllib_network *network,
+ struct rtllib_rx_stats *stats)
{
u8 i;
short offset;
@@ -2329,9 +2325,9 @@ static inline void update_network(struct rtllib_device *ieee,
dst->wmm_info = src->wmm_info;
if (src->wmm_param[0].ac_aci_acm_aifsn ||
- src->wmm_param[1].ac_aci_acm_aifsn ||
- src->wmm_param[2].ac_aci_acm_aifsn ||
- src->wmm_param[3].ac_aci_acm_aifsn)
+ src->wmm_param[1].ac_aci_acm_aifsn ||
+ src->wmm_param[2].ac_aci_acm_aifsn ||
+ src->wmm_param[3].ac_aci_acm_aifsn)
memcpy(dst->wmm_param, src->wmm_param, WME_AC_PRAM_LEN);
dst->signal_strength = src->signal_strength;
@@ -2449,8 +2445,7 @@ static inline void rtllib_process_probe_response(
*/
spin_lock_irqsave(&ieee->lock, flags);
- if (is_same_network(&ieee->current_network, network,
- (network->ssid_len ? 1 : 0))) {
+ if (is_same_network(&ieee->current_network, network, (network->ssid_len ? 1 : 0))) {
update_network(ieee, &ieee->current_network, network);
if ((ieee->current_network.mode == WIRELESS_MODE_N_24G ||
ieee->current_network.mode == WIRELESS_MODE_G) &&
@@ -2466,8 +2461,7 @@ static inline void rtllib_process_probe_response(
}
}
list_for_each_entry(target, &ieee->network_list, list) {
- if (is_same_network(target, network,
- (target->ssid_len ? 1 : 0)))
+ if (is_same_network(target, network, (target->ssid_len ? 1 : 0)))
break;
if (!oldest || (target->last_scanned < oldest->last_scanned))
oldest = target;
@@ -2527,8 +2521,7 @@ static inline void rtllib_process_probe_response(
spin_unlock_irqrestore(&ieee->lock, flags);
if (ieee80211_is_beacon(frame_ctl) &&
- is_same_network(&ieee->current_network, network,
- (network->ssid_len ? 1 : 0)) &&
+ is_same_network(&ieee->current_network, network, (network->ssid_len ? 1 : 0)) &&
(ieee->link_state == MAC80211_LINKED)) {
ieee->handle_beacon(ieee->dev, beacon, &ieee->current_network);
}
@@ -2553,8 +2546,8 @@ static void rtllib_rx_mgt(struct rtllib_device *ieee,
stats);
if (ieee->sta_sleep || (ieee->ps != RTLLIB_PS_DISABLED &&
- ieee->iw_mode == IW_MODE_INFRA &&
- ieee->link_state == MAC80211_LINKED))
+ ieee->iw_mode == IW_MODE_INFRA &&
+ ieee->link_state == MAC80211_LINKED))
schedule_work(&ieee->ps_task);
} else if (ieee80211_is_probe_resp(header->frame_control)) {
netdev_dbg(ieee->dev, "received PROBE RESPONSE\n");
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 4/6] staging: rtl8192e: rtllib_softmac.c: Fix alignment to open parentheses
2024-09-20 19:36 [PATCH v2 0/6] staging: rtl8192e: Fix alignment to open parentheses Dominik Karol Piątkowski
` (2 preceding siblings ...)
2024-09-20 19:36 ` [PATCH v2 3/6] staging: rtl8192e: rtllib_rx.c: " Dominik Karol Piątkowski
@ 2024-09-20 19:36 ` Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 5/6] staging: rtl8192e: rtllib_softmac_wx.c: " Dominik Karol Piątkowski
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Dominik Karol Piątkowski @ 2024-09-20 19:36 UTC (permalink / raw)
To: gregkh, tdavies, philipp.g.hortmann, dan.carpenter
Cc: linux-staging, linux-kernel, Dominik Karol Piątkowski
This patch aligns the code to open parentheses to improve readability.
Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
---
drivers/staging/rtl8192e/rtllib_softmac.c | 60 ++++++++++-------------
1 file changed, 26 insertions(+), 34 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c
index 0fc97c868f81..1fb7b2b027a1 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -243,9 +243,8 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct rtllib_device *ieee)
* as for the completion function, it does not need
* to check it any more.
*/
- netdev_info(ieee->dev,
- "%s():insert to waitqueue, queue_index:%d!\n",
- __func__, tcb_desc->queue_index);
+ netdev_info(ieee->dev, "%s():insert to waitqueue, queue_index:%d!\n",
+ __func__, tcb_desc->queue_index);
skb_queue_tail(&ieee->skb_waitq[tcb_desc->queue_index],
skb);
} else {
@@ -348,8 +347,7 @@ static inline struct sk_buff *rtllib_probe_req(struct rtllib_device *ieee)
}
/* Enables network monitor mode, all rx packets will be received. */
-void rtllib_enable_net_monitor_mode(struct net_device *dev,
- bool init_state)
+void rtllib_enable_net_monitor_mode(struct net_device *dev, bool init_state)
{
struct rtllib_device *ieee = netdev_priv_rsl(dev);
@@ -719,8 +717,7 @@ rtllib_association_req(struct rtllib_network *beacon,
else
encrypt = 0;
- if ((ieee->rtllib_ap_sec_type &&
- (ieee->rtllib_ap_sec_type(ieee) & SEC_ALG_TKIP)) ||
+ if ((ieee->rtllib_ap_sec_type && (ieee->rtllib_ap_sec_type(ieee) & SEC_ALG_TKIP)) ||
ieee->forced_bg_mode) {
ieee->ht_info->enable_ht = 0;
ieee->mode = WIRELESS_MODE_G;
@@ -729,14 +726,12 @@ rtllib_association_req(struct rtllib_network *beacon,
if (ieee->ht_info->current_ht_support && ieee->ht_info->enable_ht) {
ht_cap_buf = (u8 *)&ieee->ht_info->self_ht_cap;
ht_cap_len = sizeof(ieee->ht_info->self_ht_cap);
- ht_construct_capability_element(ieee, ht_cap_buf, &ht_cap_len,
- encrypt, true);
+ ht_construct_capability_element(ieee, ht_cap_buf, &ht_cap_len, encrypt, true);
if (ieee->ht_info->current_rt2rt_aggregation) {
realtek_ie_buf = ieee->ht_info->sz_rt2rt_agg_buf;
realtek_ie_len =
sizeof(ieee->ht_info->sz_rt2rt_agg_buf);
- ht_construct_rt2rt_agg_element(ieee, realtek_ie_buf,
- &realtek_ie_len);
+ ht_construct_rt2rt_agg_element(ieee, realtek_ie_buf, &realtek_ie_len);
}
}
@@ -1042,8 +1037,8 @@ static void rtllib_associate_complete_wq(void *data)
{
struct rtllib_device *ieee = (struct rtllib_device *)
container_of(data,
- struct rtllib_device,
- associate_complete_wq);
+ struct rtllib_device,
+ associate_complete_wq);
struct rt_pwr_save_ctrl *psc = &ieee->pwr_save_ctrl;
netdev_info(ieee->dev, "Associated successfully with %pM\n",
@@ -1177,10 +1172,10 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee,
* and the network does broadcast and that those two bssid match
*/
if ((apset && apmatch &&
- ((ssidset && ssidbroad && ssidmatch) ||
- (ssidbroad && !ssidset) || (!ssidbroad && ssidset))) ||
- (!apset && ssidset && ssidbroad && ssidmatch) ||
- (ieee->is_roaming && ssidset && ssidbroad && ssidmatch)) {
+ ((ssidset && ssidbroad && ssidmatch) ||
+ (ssidbroad && !ssidset) || (!ssidbroad && ssidset))) ||
+ (!apset && ssidset && ssidbroad && ssidmatch) ||
+ (ieee->is_roaming && ssidset && ssidbroad && ssidmatch)) {
/* Save the essid so that if it is hidden, it is
* replaced with the essid provided by the user.
*/
@@ -1190,7 +1185,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee,
tmp_ssid_len = ieee->current_network.ssid_len;
}
memcpy(&ieee->current_network, net,
- sizeof(ieee->current_network));
+ sizeof(ieee->current_network));
if (!ssidbroad) {
memcpy(ieee->current_network.ssid, tmp_ssid,
tmp_ssid_len);
@@ -1218,7 +1213,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee,
if ((ieee->current_network.qos_data.supported == 1) &&
ieee->current_network.bssht.bd_support_ht)
ht_reset_self_and_save_peer_setting(ieee,
- &ieee->current_network);
+ &ieee->current_network);
else
ieee->ht_info->current_ht_support = false;
@@ -1314,10 +1309,10 @@ static inline u16 assoc_parse(struct rtllib_device *ieee, struct sk_buff *skb,
status_code = le16_to_cpu(response_head->status);
if ((status_code == WLAN_STATUS_ASSOC_DENIED_RATES ||
- status_code == WLAN_STATUS_CAPS_UNSUPPORTED) &&
- ((ieee->mode == WIRELESS_MODE_G) &&
- (ieee->current_network.mode == WIRELESS_MODE_N_24G) &&
- (ieee->asoc_retry_count++ < (RT_ASOC_RETRY_LIMIT - 1)))) {
+ status_code == WLAN_STATUS_CAPS_UNSUPPORTED) &&
+ ((ieee->mode == WIRELESS_MODE_G) &&
+ (ieee->current_network.mode == WIRELESS_MODE_N_24G) &&
+ (ieee->asoc_retry_count++ < (RT_ASOC_RETRY_LIMIT - 1)))) {
ieee->ht_info->iot_action |= HT_IOT_ACT_PURE_N_MODE;
} else {
ieee->asoc_retry_count = 0;
@@ -1581,13 +1576,12 @@ rtllib_rx_assoc_resp(struct rtllib_device *ieee, struct sk_buff *skb,
WLAN_FC_GET_STYPE(frame_ctl));
if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) &&
- ieee->link_state == RTLLIB_ASSOCIATING_AUTHENTICATED &&
- (ieee->iw_mode == IW_MODE_INFRA)) {
+ ieee->link_state == RTLLIB_ASSOCIATING_AUTHENTICATED &&
+ (ieee->iw_mode == IW_MODE_INFRA)) {
errcode = assoc_parse(ieee, skb, &aid);
if (!errcode) {
- struct rtllib_network *network =
- kzalloc(sizeof(struct rtllib_network),
- GFP_ATOMIC);
+ struct rtllib_network *network = kzalloc(sizeof(struct rtllib_network),
+ GFP_ATOMIC);
if (!network)
return 1;
@@ -1599,8 +1593,8 @@ rtllib_rx_assoc_resp(struct rtllib_device *ieee, struct sk_buff *skb,
assoc_resp = (struct rtllib_assoc_response_frame *)skb->data;
if (ieee->current_network.qos_data.supported == 1) {
if (rtllib_parse_info_param(ieee, assoc_resp->info_element,
- rx_stats->len - sizeof(*assoc_resp),
- network, rx_stats)) {
+ rx_stats->len - sizeof(*assoc_resp),
+ network, rx_stats)) {
kfree(network);
return 1;
}
@@ -2225,10 +2219,8 @@ u8 rtllib_ap_sec_type(struct rtllib_device *ieee)
if (encrypt && (wpa_ie_len == 0)) {
return SEC_ALG_WEP;
} else if ((wpa_ie_len != 0)) {
- if (((ieee->wpa_ie[0] == 0xdd) &&
- (!memcmp(&ieee->wpa_ie[14], ccmp_ie, 4))) ||
- ((ieee->wpa_ie[0] == 0x30) &&
- (!memcmp(&ieee->wpa_ie[10], ccmp_rsn_ie, 4))))
+ if (((ieee->wpa_ie[0] == 0xdd) && (!memcmp(&ieee->wpa_ie[14], ccmp_ie, 4))) ||
+ ((ieee->wpa_ie[0] == 0x30) && (!memcmp(&ieee->wpa_ie[10], ccmp_rsn_ie, 4))))
return SEC_ALG_CCMP;
else
return SEC_ALG_TKIP;
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 5/6] staging: rtl8192e: rtllib_softmac_wx.c: Fix alignment to open parentheses
2024-09-20 19:36 [PATCH v2 0/6] staging: rtl8192e: Fix alignment to open parentheses Dominik Karol Piątkowski
` (3 preceding siblings ...)
2024-09-20 19:36 ` [PATCH v2 4/6] staging: rtl8192e: rtllib_softmac.c: " Dominik Karol Piątkowski
@ 2024-09-20 19:36 ` Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 6/6] staging: rtl8192e: rtllib_wx.c: " Dominik Karol Piątkowski
2024-10-09 9:53 ` [PATCH v2 0/6] staging: rtl8192e: " Greg KH
6 siblings, 0 replies; 10+ messages in thread
From: Dominik Karol Piątkowski @ 2024-09-20 19:36 UTC (permalink / raw)
To: gregkh, tdavies, philipp.g.hortmann, dan.carpenter
Cc: linux-staging, linux-kernel, Dominik Karol Piątkowski
This patch aligns the code to open parentheses to improve readability.
Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
---
drivers/staging/rtl8192e/rtllib_softmac_wx.c | 60 ++++++++++----------
1 file changed, 30 insertions(+), 30 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
index c59686d68a33..f66e2a74cdd9 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
@@ -16,7 +16,7 @@
#include "rtllib.h"
int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a,
- union iwreq_data *wrqu, char *b)
+ union iwreq_data *wrqu, char *b)
{
int ret;
struct iw_freq *fwrq = &wrqu->freq;
@@ -59,8 +59,8 @@ int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a,
EXPORT_SYMBOL(rtllib_wx_set_freq);
int rtllib_wx_get_freq(struct rtllib_device *ieee,
- struct iw_request_info *a,
- union iwreq_data *wrqu, char *b)
+ struct iw_request_info *a,
+ union iwreq_data *wrqu, char *b)
{
struct iw_freq *fwrq = &wrqu->freq;
@@ -74,8 +74,8 @@ int rtllib_wx_get_freq(struct rtllib_device *ieee,
EXPORT_SYMBOL(rtllib_wx_get_freq);
int rtllib_wx_get_wap(struct rtllib_device *ieee,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
{
unsigned long flags;
@@ -88,8 +88,8 @@ int rtllib_wx_get_wap(struct rtllib_device *ieee,
spin_lock_irqsave(&ieee->lock, flags);
if (ieee->link_state != MAC80211_LINKED &&
- ieee->link_state != MAC80211_LINKED_SCANNING &&
- ieee->wap_set == 0)
+ ieee->link_state != MAC80211_LINKED_SCANNING &&
+ ieee->wap_set == 0)
eth_zero_addr(wrqu->ap_addr.sa_data);
else
@@ -103,9 +103,9 @@ int rtllib_wx_get_wap(struct rtllib_device *ieee,
EXPORT_SYMBOL(rtllib_wx_get_wap);
int rtllib_wx_set_wap(struct rtllib_device *ieee,
- struct iw_request_info *info,
- union iwreq_data *awrq,
- char *extra)
+ struct iw_request_info *info,
+ union iwreq_data *awrq,
+ char *extra)
{
int ret = 0;
unsigned long flags;
@@ -155,7 +155,7 @@ int rtllib_wx_set_wap(struct rtllib_device *ieee,
EXPORT_SYMBOL(rtllib_wx_set_wap);
int rtllib_wx_get_essid(struct rtllib_device *ieee, struct iw_request_info *a,
- union iwreq_data *wrqu, char *b)
+ union iwreq_data *wrqu, char *b)
{
int len, ret = 0;
unsigned long flags;
@@ -167,14 +167,14 @@ int rtllib_wx_get_essid(struct rtllib_device *ieee, struct iw_request_info *a,
spin_lock_irqsave(&ieee->lock, flags);
if (ieee->current_network.ssid[0] == '\0' ||
- ieee->current_network.ssid_len == 0) {
+ ieee->current_network.ssid_len == 0) {
ret = -1;
goto out;
}
if (ieee->link_state != MAC80211_LINKED &&
- ieee->link_state != MAC80211_LINKED_SCANNING &&
- ieee->ssid_set == 0) {
+ ieee->link_state != MAC80211_LINKED_SCANNING &&
+ ieee->ssid_set == 0) {
ret = -1;
goto out;
}
@@ -191,8 +191,8 @@ int rtllib_wx_get_essid(struct rtllib_device *ieee, struct iw_request_info *a,
EXPORT_SYMBOL(rtllib_wx_get_essid);
int rtllib_wx_set_rate(struct rtllib_device *ieee,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
{
u32 target_rate = wrqu->bitrate.value;
@@ -202,13 +202,13 @@ int rtllib_wx_set_rate(struct rtllib_device *ieee,
EXPORT_SYMBOL(rtllib_wx_set_rate);
int rtllib_wx_get_rate(struct rtllib_device *ieee,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
{
u32 tmp_rate;
tmp_rate = tx_count_to_data_rate(ieee,
- ieee->softmac_stats.CurrentShowTxate);
+ ieee->softmac_stats.CurrentShowTxate);
wrqu->bitrate.value = tmp_rate * 500000;
return 0;
@@ -216,14 +216,14 @@ int rtllib_wx_get_rate(struct rtllib_device *ieee,
EXPORT_SYMBOL(rtllib_wx_get_rate);
int rtllib_wx_set_rts(struct rtllib_device *ieee,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
{
if (wrqu->rts.disabled || !wrqu->rts.fixed) {
ieee->rts = DEFAULT_RTS_THRESHOLD;
} else {
if (wrqu->rts.value < MIN_RTS_THRESHOLD ||
- wrqu->rts.value > MAX_RTS_THRESHOLD)
+ wrqu->rts.value > MAX_RTS_THRESHOLD)
return -EINVAL;
ieee->rts = wrqu->rts.value;
}
@@ -232,8 +232,8 @@ int rtllib_wx_set_rts(struct rtllib_device *ieee,
EXPORT_SYMBOL(rtllib_wx_set_rts);
int rtllib_wx_get_rts(struct rtllib_device *ieee,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
{
wrqu->rts.value = ieee->rts;
wrqu->rts.fixed = 0; /* no auto select */
@@ -243,7 +243,7 @@ int rtllib_wx_get_rts(struct rtllib_device *ieee,
EXPORT_SYMBOL(rtllib_wx_get_rts);
int rtllib_wx_set_mode(struct rtllib_device *ieee, struct iw_request_info *a,
- union iwreq_data *wrqu, char *b)
+ union iwreq_data *wrqu, char *b)
{
int set_mode_status = 0;
@@ -359,7 +359,7 @@ void rtllib_wx_sync_scan_wq(void *data)
}
int rtllib_wx_set_scan(struct rtllib_device *ieee, struct iw_request_info *a,
- union iwreq_data *wrqu, char *b)
+ union iwreq_data *wrqu, char *b)
{
int ret = 0;
@@ -447,8 +447,8 @@ EXPORT_SYMBOL(rtllib_wx_get_name);
/* this is mostly stolen from hostap */
int rtllib_wx_set_power(struct rtllib_device *ieee,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
{
int ret = 0;
@@ -499,8 +499,8 @@ EXPORT_SYMBOL(rtllib_wx_set_power);
/* this is stolen from hostap */
int rtllib_wx_get_power(struct rtllib_device *ieee,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
{
mutex_lock(&ieee->wx_mutex);
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 6/6] staging: rtl8192e: rtllib_wx.c: Fix alignment to open parentheses
2024-09-20 19:36 [PATCH v2 0/6] staging: rtl8192e: Fix alignment to open parentheses Dominik Karol Piątkowski
` (4 preceding siblings ...)
2024-09-20 19:36 ` [PATCH v2 5/6] staging: rtl8192e: rtllib_softmac_wx.c: " Dominik Karol Piątkowski
@ 2024-09-20 19:36 ` Dominik Karol Piątkowski
2024-10-09 9:53 ` [PATCH v2 0/6] staging: rtl8192e: " Greg KH
6 siblings, 0 replies; 10+ messages in thread
From: Dominik Karol Piątkowski @ 2024-09-20 19:36 UTC (permalink / raw)
To: gregkh, tdavies, philipp.g.hortmann, dan.carpenter
Cc: linux-staging, linux-kernel, Dominik Karol Piątkowski
This patch aligns the code to open parentheses to improve readability.
Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
---
drivers/staging/rtl8192e/rtllib_wx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c
index c730d921463d..b25343f01f8d 100644
--- a/drivers/staging/rtl8192e/rtllib_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_wx.c
@@ -134,8 +134,7 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
((ht_cap->short_gi_40mhz) ? 1 : 0) :
((ht_cap->short_gi_20mhz) ? 1 : 0);
- max_mcs = ht_get_highest_mcs_rate(ieee, ht_cap->MCS,
- MCS_FILTER_ALL);
+ max_mcs = ht_get_highest_mcs_rate(ieee, ht_cap->MCS, MCS_FILTER_ALL);
rate = MCS_DATA_RATE[is40M][isShortGI][max_mcs & 0x7f];
if (rate > max_rate)
max_rate = rate;
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v2 3/6] staging: rtl8192e: rtllib_rx.c: Fix alignment to open parentheses
2024-09-20 19:36 ` [PATCH v2 3/6] staging: rtl8192e: rtllib_rx.c: " Dominik Karol Piątkowski
@ 2024-09-21 13:51 ` Philipp Hortmann
2024-09-21 14:59 ` Dominik Karol Piątkowski
0 siblings, 1 reply; 10+ messages in thread
From: Philipp Hortmann @ 2024-09-21 13:51 UTC (permalink / raw)
To: Dominik Karol Piątkowski, gregkh, tdavies, dan.carpenter
Cc: linux-staging, linux-kernel
On 9/20/24 21:36, Dominik Karol Piątkowski wrote:
> This patch aligns the code to open parentheses to improve readability.
>
> Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
> ---
> drivers/staging/rtl8192e/rtllib_rx.c | 91 +++++++++++++---------------
> 1 file changed, 42 insertions(+), 49 deletions(-)
>
> diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
> index 8fe224a83dd6..e58be8e07917 100644
> --- a/drivers/staging/rtl8192e/rtllib_rx.c
> +++ b/drivers/staging/rtl8192e/rtllib_rx.c
> @@ -409,12 +409,10 @@ static bool add_reorder_entry(struct rx_ts_record *ts,
>
> while (list->next != &ts->rx_pending_pkt_list) {
> if (SN_LESS(reorder_entry->seq_num, ((struct rx_reorder_entry *)
> - list_entry(list->next, struct rx_reorder_entry,
> - list))->seq_num))
> + list_entry(list->next, struct rx_reorder_entry, list))->seq_num))
> list = list->next;
> - else if (SN_EQUAL(reorder_entry->seq_num,
> - ((struct rx_reorder_entry *)list_entry(list->next,
> - struct rx_reorder_entry, list))->seq_num))
> + else if (SN_EQUAL(reorder_entry->seq_num, ((struct rx_reorder_entry *)
> + list_entry(list->next, struct rx_reorder_entry, list))->seq_num))
> return false;
Hi Domenik,
I hope to not stress you beyond limits.
Thanks for deviding the patch. I can apply it now to my repo.
First two patches are looking good.
I prefer to have a comma at the end of the line. This line does not
increase readablility to me.
((struct rx_reorder_entry *)
list_entry(list->next, struct rx_reorder_entry, list))->seq_num))
Sometimes it is better to change less.
The change does not perfectly fit to the description: There you say
...aligns the code to open parentheses... but you do not need to remove
line breaks or shorten code to achieve this.
Smaller patches lead to an earlier acceptance. This typically leads to
more confidence at the beginning for newbies. There is no question about
that you know what you are doing. But there are some corners where the
kernel is special.
Find more below.
> ...
> @@ -876,9 +874,9 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
> frag = WLAN_GET_SEQ_FRAG(sc);
>
> if (!ieee->ht_info->cur_rx_reorder_enable ||
> - !ieee->current_network.qos_data.active ||
> - !is_data_frame(skb->data) ||
> - is_legacy_data_frame(skb->data)) {
> + !ieee->current_network.qos_data.active ||
> + !is_data_frame(skb->data) ||
> + is_legacy_data_frame(skb->data)) {
> if (!ieee80211_is_beacon(hdr->frame_control)) {
> if (is_duplicate_packet(ieee, hdr))
> return -1;
> @@ -887,7 +885,7 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
> struct rx_ts_record *ts = NULL;
>
> if (rtllib_get_ts(ieee, (struct ts_common_info **)&ts, hdr->addr2,
> - (u8)frame_qos_tid((u8 *)(skb->data)), RX_DIR, true)) {
> + (u8)frame_qos_tid((u8 *)(skb->data)), RX_DIR, true)) {
I am understanding the logic behind this but I cannot really say that
this increases the readability. It increases the readability of the if
condition but I am losing readability of the overall code and it
increases the issue with the too long lines.
I have not looked into the remaining patches.
I need some support from another reviewer.
Your patches are working fine on hardware.
Bye Philipp
> if ((fc & (1 << 11)) && (frag == ts->rx_last_frag_num) &&
> (WLAN_GET_SEQ_SEQ(sc) == ts->rx_last_seq_num))
> return -1;
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 3/6] staging: rtl8192e: rtllib_rx.c: Fix alignment to open parentheses
2024-09-21 13:51 ` Philipp Hortmann
@ 2024-09-21 14:59 ` Dominik Karol Piątkowski
0 siblings, 0 replies; 10+ messages in thread
From: Dominik Karol Piątkowski @ 2024-09-21 14:59 UTC (permalink / raw)
To: Philipp Hortmann
Cc: gregkh, tdavies, dan.carpenter, linux-staging, linux-kernel
Hi Philipp,
On Saturday, September 21st, 2024 at 15:51, Philipp Hortmann <philipp.g.hortmann@gmail.com> wrote:
<cut>
> Hi Domenik,
>
> I hope to not stress you beyond limits.
First of all, I want to thank you for fast, valuable reviews. I hope I am not
overusing your patience.
>
> Thanks for deviding the patch. I can apply it now to my repo.
> First two patches are looking good.
>
> I prefer to have a comma at the end of the line. This line does not
> increase readablility to me.
>
> ((struct rx_reorder_entry *)
> list_entry(list->next, struct rx_reorder_entry, list))->seq_num))
I understand your point. I made this line similar to one that already exists
above, see diff:
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 8fe224a83dd6..e58be8e07917 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -409,12 +409,10 @@ static bool add_reorder_entry(struct rx_ts_record *ts,
while (list->next != &ts->rx_pending_pkt_list) {
if (SN_LESS(reorder_entry->seq_num, ((struct rx_reorder_entry *)
- list_entry(list->next, struct rx_reorder_entry,
- list))->seq_num))
+ list_entry(list->next, struct rx_reorder_entry, list))->seq_num))
list = list->next;
- else if (SN_EQUAL(reorder_entry->seq_num,
- ((struct rx_reorder_entry *)list_entry(list->next,
- struct rx_reorder_entry, list))->seq_num))
+ else if (SN_EQUAL(reorder_entry->seq_num, ((struct rx_reorder_entry *)
+ list_entry(list->next, struct rx_reorder_entry, list))->seq_num))
return false;
else
break;
I can of course remove this change from patch.
>
>
> Sometimes it is better to change less.
True.
>
> The change does not perfectly fit to the description: There you say
> ...aligns the code to open parentheses... but you do not need to remove
> line breaks or shorten code to achieve this.
I agree. There are a few removed line breaks, where I thought it could
improve code readability. If these changes are not acceptable, I will
of course remove them.
>
> Smaller patches lead to an earlier acceptance. This typically leads to
> more confidence at the beginning for newbies. There is no question about
> that you know what you are doing. But there are some corners where the
> kernel is special.
Thank you, I will watch out for these corners.
>
> Find more below.
>
> > ...
> > @@ -876,9 +874,9 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
> > frag = WLAN_GET_SEQ_FRAG(sc);
> >
> > if (!ieee->ht_info->cur_rx_reorder_enable ||
> > - !ieee->current_network.qos_data.active ||
> > - !is_data_frame(skb->data) ||
> > - is_legacy_data_frame(skb->data)) {
> > + !ieee->current_network.qos_data.active ||
> > + !is_data_frame(skb->data) ||
> > + is_legacy_data_frame(skb->data)) {
> > if (!ieee80211_is_beacon(hdr->frame_control)) {
> > if (is_duplicate_packet(ieee, hdr))
> > return -1;
> > @@ -887,7 +885,7 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
> > struct rx_ts_record *ts = NULL;
> >
> > if (rtllib_get_ts(ieee, (struct ts_common_info **)&ts, hdr->addr2,
> > - (u8)frame_qos_tid((u8 *)(skb->data)), RX_DIR, true)) {
> > + (u8)frame_qos_tid((u8 *)(skb->data)), RX_DIR, true)) {
>
>
> I am understanding the logic behind this but I cannot really say that
> this increases the readability. It increases the readability of the if
> condition but I am losing readability of the overall code and it
> increases the issue with the too long lines.
I understand your point. If this change negatively impacts readability
of the overall code, I can of course remove it.
About the issue with too long lines - I am certain that none of the lines
I introduced were longer than 100 columns, unless we are trying to maintain
hard limit of 80 columns wherever possible. I know that line length of
80 columns is still preferred, though. Sometimes, these 20 additional
columns could increase readability, but I understand that it is not granted.
>
> I have not looked into the remaining patches.
>
> I need some support from another reviewer.
>
> Your patches are working fine on hardware.
Once again, thank you for thorough review, and I hope I am not overusing
your patience.
Thanks,
Dominik Karol
>
> Bye Philipp
>
> > if ((fc & (1 << 11)) && (frag == ts->rx_last_frag_num) &&
> > (WLAN_GET_SEQ_SEQ(sc) == ts->rx_last_seq_num))
> > return -1;
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v2 0/6] staging: rtl8192e: Fix alignment to open parentheses
2024-09-20 19:36 [PATCH v2 0/6] staging: rtl8192e: Fix alignment to open parentheses Dominik Karol Piątkowski
` (5 preceding siblings ...)
2024-09-20 19:36 ` [PATCH v2 6/6] staging: rtl8192e: rtllib_wx.c: " Dominik Karol Piątkowski
@ 2024-10-09 9:53 ` Greg KH
6 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2024-10-09 9:53 UTC (permalink / raw)
To: Dominik Karol Piątkowski
Cc: tdavies, philipp.g.hortmann, dan.carpenter, linux-staging,
linux-kernel
On Fri, Sep 20, 2024 at 07:36:17PM +0000, Dominik Karol Piątkowski wrote:
> This series aligns the code to open parentheses to improve readability.
>
> v2: Split patch into smaller patches and refine them, exclude files conflicting
> with https://lore.kernel.org/linux-staging/Zung-0ClV_527-_e@kernel-710/T/#t
>
> Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
Sorry, this driver is now deleted from the tree.
greg k-h
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-10-09 9:53 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-20 19:36 [PATCH v2 0/6] staging: rtl8192e: Fix alignment to open parentheses Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 1/6] staging: rtl8192e: r8190P_rtl8256.c: " Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 2/6] staging: rtl8192e: rtl_ps.c: " Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 3/6] staging: rtl8192e: rtllib_rx.c: " Dominik Karol Piątkowski
2024-09-21 13:51 ` Philipp Hortmann
2024-09-21 14:59 ` Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 4/6] staging: rtl8192e: rtllib_softmac.c: " Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 5/6] staging: rtl8192e: rtllib_softmac_wx.c: " Dominik Karol Piątkowski
2024-09-20 19:36 ` [PATCH v2 6/6] staging: rtl8192e: rtllib_wx.c: " Dominik Karol Piątkowski
2024-10-09 9:53 ` [PATCH v2 0/6] staging: rtl8192e: " Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox