All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] staging: rtl8192e: some coding style cleanups
@ 2024-02-01  8:18 Michael Straube
  2024-02-01  8:18 ` [PATCH 1/3] staging: rtl8192e: remove braces from single statement blocks Michael Straube
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Michael Straube @ 2024-02-01  8:18 UTC (permalink / raw)
  To: gregkh; +Cc: philipp.g.hortmann, linux-staging, linux-kernel, Michael Straube

This series contains some simple coding style cleanups to clear some
checkpatch warnings. Compile-tested only.

Michael Straube (3):
  staging: rtl8192e: remove braces from single statement blocks
  staging: rtl8192e: remove return from void function rtl92e_set_channel
  staging: rtl8192e: initialize variables at declaration

 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 5 ++---
 drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 1 -
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c   | 3 +--
 drivers/staging/rtl8192e/rtl819x_HTProc.c      | 4 ++--
 drivers/staging/rtl8192e/rtllib_rx.c           | 5 ++---
 5 files changed, 7 insertions(+), 11 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] staging: rtl8192e: remove braces from single statement blocks
  2024-02-01  8:18 [PATCH 0/3] staging: rtl8192e: some coding style cleanups Michael Straube
@ 2024-02-01  8:18 ` Michael Straube
  2024-02-01  8:18 ` [PATCH 2/3] staging: rtl8192e: remove return from void function rtl92e_set_channel Michael Straube
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Straube @ 2024-02-01  8:18 UTC (permalink / raw)
  To: gregkh; +Cc: philipp.g.hortmann, linux-staging, linux-kernel, Michael Straube

Remove braces from single statement blocks to clear some checkpatch
warnings.

WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 5 ++---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c   | 3 +--
 drivers/staging/rtl8192e/rtl819x_HTProc.c      | 4 ++--
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index 9b9d95ba06df..080fe9c4585e 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -693,11 +693,10 @@ void rtl92e_link_change(struct net_device *dev)
 		u32 reg;
 
 		reg = rtl92e_readl(dev, RCR);
-		if (priv->rtllib->link_state == MAC80211_LINKED) {
+		if (priv->rtllib->link_state == MAC80211_LINKED)
 			priv->receive_config = reg |= RCR_CBSSID;
-		} else {
+		else
 			priv->receive_config = reg &= ~RCR_CBSSID;
-		}
 
 		rtl92e_writel(dev, RCR, reg);
 	}
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 32acba4ce3f7..9b528cf4dbca 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -964,9 +964,8 @@ static void _rtl92e_watchdog_wq_cb(void *data)
 		     MAC80211_NOLINK) &&
 		     (ieee->rf_power_state == rf_on) && !ieee->is_set_key &&
 		     (!ieee->proto_stoppping) && !ieee->wx_set_enc) {
-			if (ieee->pwr_save_ctrl.ReturnPoint == IPS_CALLBACK_NONE) {
+			if (ieee->pwr_save_ctrl.ReturnPoint == IPS_CALLBACK_NONE)
 				rtl92e_ips_enter(dev);
-			}
 		}
 	}
 	if ((ieee->link_state == MAC80211_LINKED) && (ieee->iw_mode == IW_MODE_INFRA)) {
diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index 6d0912f90198..49b882c363bf 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -480,9 +480,9 @@ void ht_on_assoc_rsp(struct rtllib_device *ieee)
 	}
 
 	ht_info->current_mpdu_density = pPeerHTCap->MPDUDensity;
-	if (ht_info->iot_action & HT_IOT_ACT_TX_USE_AMSDU_8K) {
+	if (ht_info->iot_action & HT_IOT_ACT_TX_USE_AMSDU_8K)
 		ht_info->current_ampdu_enable = false;
-	}
+
 	ht_info->cur_rx_reorder_enable = 1;
 
 	if (pPeerHTCap->MCS[0] == 0)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] staging: rtl8192e: remove return from void function rtl92e_set_channel
  2024-02-01  8:18 [PATCH 0/3] staging: rtl8192e: some coding style cleanups Michael Straube
  2024-02-01  8:18 ` [PATCH 1/3] staging: rtl8192e: remove braces from single statement blocks Michael Straube
@ 2024-02-01  8:18 ` Michael Straube
  2024-02-01  8:18 ` [PATCH 3/3] staging: rtl8192e: initialize variables at declaration Michael Straube
  2024-02-01 21:07 ` [PATCH 0/3] staging: rtl8192e: some coding style cleanups Philipp Hortmann
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Straube @ 2024-02-01  8:18 UTC (permalink / raw)
  To: gregkh; +Cc: philipp.g.hortmann, linux-staging, linux-kernel, Michael Straube

Remove return from the void function rtl92e_set_channel.
Found by checkpatch.

WARNING: void function return statements are not generally useful

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index e1bd4d67e862..18b948d4d86d 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -714,7 +714,6 @@ void rtl92e_set_channel(struct net_device *dev, u8 channel)
 	if (priv->up)
 		_rtl92e_phy_switch_channel_work_item(dev);
 	priv->sw_chnl_in_progress = false;
-	return;
 }
 
 static void _rtl92e_cck_tx_power_track_bw_switch_tssi(struct net_device *dev)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] staging: rtl8192e: initialize variables at declaration
  2024-02-01  8:18 [PATCH 0/3] staging: rtl8192e: some coding style cleanups Michael Straube
  2024-02-01  8:18 ` [PATCH 1/3] staging: rtl8192e: remove braces from single statement blocks Michael Straube
  2024-02-01  8:18 ` [PATCH 2/3] staging: rtl8192e: remove return from void function rtl92e_set_channel Michael Straube
@ 2024-02-01  8:18 ` Michael Straube
  2024-02-01 21:07 ` [PATCH 0/3] staging: rtl8192e: some coding style cleanups Philipp Hortmann
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Straube @ 2024-02-01  8:18 UTC (permalink / raw)
  To: gregkh; +Cc: philipp.g.hortmann, linux-staging, linux-kernel, Michael Straube

Initialize two variables at declaration instead of first declare
and then initialize them. This saves a line of code and clears a
checkpatch warning.

WARNING: Missing a blank line after declarations

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8192e/rtllib_rx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index f777febcfe3b..f94fdf27214c 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -943,10 +943,9 @@ static void rtllib_rx_extract_addr(struct rtllib_device *ieee,
 static int rtllib_rx_data_filter(struct rtllib_device *ieee, struct ieee80211_hdr *hdr,
 				 u8 *dst, u8 *src, u8 *bssid, u8 *addr2)
 {
-	u8 type, stype;
 	u16 fc = le16_to_cpu(hdr->frame_control);
-	type = WLAN_FC_GET_TYPE(fc);
-	stype = WLAN_FC_GET_STYPE(fc);
+	u8 type = WLAN_FC_GET_TYPE(fc);
+	u8 stype = WLAN_FC_GET_STYPE(fc);
 
 	/* Filter frames from different BSS */
 	if (ieee80211_has_a4(hdr->frame_control) &&
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] staging: rtl8192e: some coding style cleanups
  2024-02-01  8:18 [PATCH 0/3] staging: rtl8192e: some coding style cleanups Michael Straube
                   ` (2 preceding siblings ...)
  2024-02-01  8:18 ` [PATCH 3/3] staging: rtl8192e: initialize variables at declaration Michael Straube
@ 2024-02-01 21:07 ` Philipp Hortmann
  3 siblings, 0 replies; 5+ messages in thread
From: Philipp Hortmann @ 2024-02-01 21:07 UTC (permalink / raw)
  To: Michael Straube, gregkh; +Cc: linux-staging, linux-kernel

On 2/1/24 09:18, Michael Straube wrote:
> This series contains some simple coding style cleanups to clear some
> checkpatch warnings. Compile-tested only.
> 
> Michael Straube (3):
>    staging: rtl8192e: remove braces from single statement blocks
>    staging: rtl8192e: remove return from void function rtl92e_set_channel
>    staging: rtl8192e: initialize variables at declaration
> 
>   drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 5 ++---
>   drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 1 -
>   drivers/staging/rtl8192e/rtl8192e/rtl_core.c   | 3 +--
>   drivers/staging/rtl8192e/rtl819x_HTProc.c      | 4 ++--
>   drivers/staging/rtl8192e/rtllib_rx.c           | 5 ++---
>   5 files changed, 7 insertions(+), 11 deletions(-)
> 

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-01 21:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-01  8:18 [PATCH 0/3] staging: rtl8192e: some coding style cleanups Michael Straube
2024-02-01  8:18 ` [PATCH 1/3] staging: rtl8192e: remove braces from single statement blocks Michael Straube
2024-02-01  8:18 ` [PATCH 2/3] staging: rtl8192e: remove return from void function rtl92e_set_channel Michael Straube
2024-02-01  8:18 ` [PATCH 3/3] staging: rtl8192e: initialize variables at declaration Michael Straube
2024-02-01 21:07 ` [PATCH 0/3] staging: rtl8192e: some coding style cleanups Philipp Hortmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.