Skip to contentSkip to conversation

rtlwifi: Replace hardcode value with macro

PATCH In review Souptick Joarder 3 participants 5 messages Aug 2, 2017 – Aug 3, 2017 Realtek wireless driver (rtlwifi family)

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 rtlwifi: Replace hardcode value with macro

In _rtl_init_mac80211(), hardcoded value for hw->max_listen_interval and hw->max_rate_tries are replaced by macro and removed the comment.

---
 drivers/net/wireless/realtek/rtlwifi/base.c | 5 ++---
 drivers/net/wireless/realtek/rtlwifi/base.h | 2 ++
 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/realtek/rtlwifi/base.c +2 -3
index 8b833e2..ea18aa7 100644
@@ -426,9 +426,8 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw)
 	hw->extra_tx_headroom = RTL_TX_HEADER_SIZE;
 
 	/* TODO: Correct this value for our hw */
-	/* TODO: define these hard code value */
-	hw->max_listen_interval = 10;
-	hw->max_rate_tries = 4;
+	hw->max_listen_interval = MAX_LISTEN_INTERVAL;
+	hw->max_rate_tries = MAX_RATE_TRIES;
 	/* hw->max_rates = 1; */
 	hw->sta_data_size = sizeof(struct rtl_sta_info);
 
drivers/net/wireless/realtek/rtlwifi/base.h +2 -0
index ab7d819..b56d1b7 100644
@@ -65,6 +65,8 @@ enum ap_peer {
 #define FRAME_OFFSET_ADDRESS3		16
 #define FRAME_OFFSET_SEQUENCE		22
 #define FRAME_OFFSET_ADDRESS4		24
+#define MAX_LISTEN_INTERVAL		10
+#define MAX_RATE_TRIES			4
 
 #define SET_80211_HDR_FRAME_CONTROL(_hdr, _val)		\
 	WRITEEF2BYTE(_hdr, _val)
Signature · 1 line
1.9.1
Acked-by on v5 1/1
#1 lore raw
Quoted 4 lines · Souptick Joarder

In _rtl_init_mac80211(), hardcoded value for hw->max_listen_interval and hw->max_rate_tries are replaced by macro and removed the comment.

Finally!

@Kalle: I'm sure you can work around this, but patchwork shows two different "v5" versions and a "v4" entry for this same patch. That may be due to no one formally rejecting the patch.

Larry

Quoted 35 lines
---
  drivers/net/wireless/realtek/rtlwifi/base.c | 5 ++---
  drivers/net/wireless/realtek/rtlwifi/base.h | 2 ++
  2 files changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/realtek/rtlwifi/base.c +2 -3
index 8b833e2..ea18aa7 100644
@@ -426,9 +426,8 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw)
  	hw->extra_tx_headroom = RTL_TX_HEADER_SIZE;
 
  	/* TODO: Correct this value for our hw */
-	/* TODO: define these hard code value */
-	hw->max_listen_interval = 10;
-	hw->max_rate_tries = 4;
+	hw->max_listen_interval = MAX_LISTEN_INTERVAL;
+	hw->max_rate_tries = MAX_RATE_TRIES;
  	/* hw->max_rates = 1; */
  	hw->sta_data_size = sizeof(struct rtl_sta_info);
 
drivers/net/wireless/realtek/rtlwifi/base.h +2 -0
index ab7d819..b56d1b7 100644
@@ -65,6 +65,8 @@ enum ap_peer {
  #define FRAME_OFFSET_ADDRESS3		16
  #define FRAME_OFFSET_SEQUENCE		22
  #define FRAME_OFFSET_ADDRESS4		24
+#define MAX_LISTEN_INTERVAL		10
+#define MAX_RATE_TRIES			4
 
  #define SET_80211_HDR_FRAME_CONTROL(_hdr, _val)		\
  	WRITEEF2BYTE(_hdr, _val)
#2 lore raw
Quoted 6 lines · Larry Finger
Quoted 4 lines · Souptick Joarder

In _rtl_init_mac80211(), hardcoded value for hw->max_listen_interval and hw->max_rate_tries are replaced by macro and removed the comment.

Quoted 7 lines

Finally!

@Kalle: I'm sure you can work around this, but patchwork shows two different "v5" versions and a "v4" entry for this same patch. That may be due to no one formally rejecting the patch.

It's because Souptick submitted two v5 patches, but yeah I can that sort it out.

Souptick, the idea with patch versions is that maintainers and reviewers can easily find the latest version and drop the rest so ALWAYS increase the version number. Submitting duplicate version numbers defeats the purpose and creates extra work for others.

Signature · 1 line
Kalle Valo
#3 lore raw
Quoted 16 lines · Kalle Valo
Quoted 6 lines · Larry Finger
Quoted 4 lines · Souptick Joarder

In _rtl_init_mac80211(), hardcoded value for hw->max_listen_interval and hw->max_rate_tries are replaced by macro and removed the comment.

Quoted 7 lines

Finally!

@Kalle: I'm sure you can work around this, but patchwork shows two different "v5" versions and a "v4" entry for this same patch. That may be due to no one formally rejecting the patch.

Quoted 7 lines

It's because Souptick submitted two v5 patches, but yeah I can that sort it out.

Souptick, the idea with patch versions is that maintainers and reviewers can easily find the latest version and drop the rest so ALWAYS increase the version number. Submitting duplicate version numbers defeats the purpose and creates extra work for others.

Noted. Thanks for the feedback.

Quoted 3 lines

--
Kalle Valo

#4 lore raw
In reply to Souptick Joarder
Quoted 5 lines · Souptick Joarder

In _rtl_init_mac80211(), hardcoded value for hw->max_listen_interval and hw->max_rate_tries are replaced by macro and removed the comment.

Patch applied to wireless-drivers-next.git, thanks.

9d546198705a rtlwifi: Replace hardcode value with macro

Signature · 3 lines
https://patchwork.kernel.org/patch/9876703/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches