diff mbox

[v5] rtlwifi: Replace hardcode value with macro

Message ID 20170802122915.GA4759@symbol-HP-ZBook-15 (mailing list archive)
State Accepted
Commit 9d546198705a79630cb29b1cc47a43e75b8afb89
Delegated to: Kalle Valo
Headers show

Commit Message

Souptick Joarder Aug. 2, 2017, 12:29 p.m. UTC
In _rtl_init_mac80211(), hardcoded value for hw->max_listen_interval
and hw->max_rate_tries are replaced by macro and removed the comment.

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
---
 drivers/net/wireless/realtek/rtlwifi/base.c | 5 ++---
 drivers/net/wireless/realtek/rtlwifi/base.h | 2 ++
 2 files changed, 4 insertions(+), 3 deletions(-)

Comments

Larry Finger Aug. 2, 2017, 2:35 p.m. UTC | #1
On 08/02/2017 07:29 AM, Souptick Joarder wrote:
> In _rtl_init_mac80211(), hardcoded value for hw->max_listen_interval
> and hw->max_rate_tries are replaced by macro and removed the comment.
> 
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>

Finally!

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

@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

> ---
>   drivers/net/wireless/realtek/rtlwifi/base.c | 5 ++---
>   drivers/net/wireless/realtek/rtlwifi/base.h | 2 ++
>   2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c
> index 8b833e2..ea18aa7 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/base.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/base.c
> @@ -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);
>   
> diff --git a/drivers/net/wireless/realtek/rtlwifi/base.h b/drivers/net/wireless/realtek/rtlwifi/base.h
> index ab7d819..b56d1b7 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/base.h
> +++ b/drivers/net/wireless/realtek/rtlwifi/base.h
> @@ -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)
>
Kalle Valo Aug. 3, 2017, 10:18 a.m. UTC | #2
Larry Finger <Larry.Finger@lwfinger.net> writes:

> On 08/02/2017 07:29 AM, Souptick Joarder wrote:
>> In _rtl_init_mac80211(), hardcoded value for hw->max_listen_interval
>> and hw->max_rate_tries are replaced by macro and removed the comment.
>>
>> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
>
> Finally!
>
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
>
> @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.
Kalle Valo Aug. 3, 2017, 10:21 a.m. UTC | #3
Souptick Joarder <jrdr.linux@gmail.com> wrote:

> In _rtl_init_mac80211(), hardcoded value for hw->max_listen_interval
> and hw->max_rate_tries are replaced by macro and removed the comment.
> 
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

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

9d546198705a rtlwifi: Replace hardcode value with macro
Souptick Joarder Aug. 3, 2017, 10:43 a.m. UTC | #4
On Thu, Aug 3, 2017 at 3:48 PM, Kalle Valo <kvalo@codeaurora.org> wrote:
> Larry Finger <Larry.Finger@lwfinger.net> writes:
>
>> On 08/02/2017 07:29 AM, Souptick Joarder wrote:
>>> In _rtl_init_mac80211(), hardcoded value for hw->max_listen_interval
>>> and hw->max_rate_tries are replaced by macro and removed the comment.
>>>
>>> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
>>
>> Finally!
>>
>> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
>>
>> @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.

Noted. Thanks for the feedback.

>
> --
> Kalle Valo
diff mbox

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c
index 8b833e2..ea18aa7 100644
--- a/drivers/net/wireless/realtek/rtlwifi/base.c
+++ b/drivers/net/wireless/realtek/rtlwifi/base.c
@@ -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);
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/base.h b/drivers/net/wireless/realtek/rtlwifi/base.h
index ab7d819..b56d1b7 100644
--- a/drivers/net/wireless/realtek/rtlwifi/base.h
+++ b/drivers/net/wireless/realtek/rtlwifi/base.h
@@ -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)