All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ath11k: mac: fix too long line
@ 2022-05-03  6:04 ` Kalle Valo
  0 siblings, 0 replies; 16+ messages in thread
From: Kalle Valo @ 2022-05-03  6:04 UTC (permalink / raw)
  To: ath11k; +Cc: linux-wireless

From: Kalle Valo <quic_kvalo@quicinc.com>

checkpatch warns:

drivers/net/wireless/ath/ath11k/mac.c:7760: line length of 91 exceeds 90 columns

This was introduced by commit 046d2e7c50e3 ("mac80211: prepare sta handling for
MLO support").

Compile tested only.

Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
---
 drivers/net/wireless/ath/ath11k/mac.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index c76cac5d6849..32fb0142124d 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -7735,6 +7735,7 @@ ath11k_mac_validate_vht_he_fixed_rate_settings(struct ath11k *ar, enum nl80211_b
 	bool he_fixed_rate = false, vht_fixed_rate = false;
 	struct ath11k_peer *peer, *tmp;
 	const u16 *vht_mcs_mask, *he_mcs_mask;
+	struct ieee80211_link_sta *deflink;
 	u8 vht_nss, he_nss;
 	bool ret = true;
 
@@ -7757,13 +7758,16 @@ ath11k_mac_validate_vht_he_fixed_rate_settings(struct ath11k *ar, enum nl80211_b
 	spin_lock_bh(&ar->ab->base_lock);
 	list_for_each_entry_safe(peer, tmp, &ar->ab->peers, list) {
 		if (peer->sta) {
-			if (vht_fixed_rate && (!peer->sta->deflink.vht_cap.vht_supported ||
-					       peer->sta->deflink.rx_nss < vht_nss)) {
+			deflink = &peer->sta->deflink;
+
+			if (vht_fixed_rate && (!deflink->vht_cap.vht_supported ||
+					       deflink->rx_nss < vht_nss)) {
 				ret = false;
 				goto out;
 			}
-			if (he_fixed_rate && (!peer->sta->deflink.he_cap.has_he ||
-					      peer->sta->deflink.rx_nss < he_nss)) {
+
+			if (he_fixed_rate && (!deflink->he_cap.has_he ||
+					      deflink->rx_nss < he_nss)) {
 				ret = false;
 				goto out;
 			}

base-commit: f39af96d352dd4f36a4a43601ea90561e17e5ca6
-- 
2.30.2


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

* [PATCH 1/2] ath11k: mac: fix too long line
@ 2022-05-03  6:04 ` Kalle Valo
  0 siblings, 0 replies; 16+ messages in thread
From: Kalle Valo @ 2022-05-03  6:04 UTC (permalink / raw)
  To: ath11k; +Cc: linux-wireless

From: Kalle Valo <quic_kvalo@quicinc.com>

checkpatch warns:

drivers/net/wireless/ath/ath11k/mac.c:7760: line length of 91 exceeds 90 columns

This was introduced by commit 046d2e7c50e3 ("mac80211: prepare sta handling for
MLO support").

Compile tested only.

Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
---
 drivers/net/wireless/ath/ath11k/mac.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index c76cac5d6849..32fb0142124d 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -7735,6 +7735,7 @@ ath11k_mac_validate_vht_he_fixed_rate_settings(struct ath11k *ar, enum nl80211_b
 	bool he_fixed_rate = false, vht_fixed_rate = false;
 	struct ath11k_peer *peer, *tmp;
 	const u16 *vht_mcs_mask, *he_mcs_mask;
+	struct ieee80211_link_sta *deflink;
 	u8 vht_nss, he_nss;
 	bool ret = true;
 
@@ -7757,13 +7758,16 @@ ath11k_mac_validate_vht_he_fixed_rate_settings(struct ath11k *ar, enum nl80211_b
 	spin_lock_bh(&ar->ab->base_lock);
 	list_for_each_entry_safe(peer, tmp, &ar->ab->peers, list) {
 		if (peer->sta) {
-			if (vht_fixed_rate && (!peer->sta->deflink.vht_cap.vht_supported ||
-					       peer->sta->deflink.rx_nss < vht_nss)) {
+			deflink = &peer->sta->deflink;
+
+			if (vht_fixed_rate && (!deflink->vht_cap.vht_supported ||
+					       deflink->rx_nss < vht_nss)) {
 				ret = false;
 				goto out;
 			}
-			if (he_fixed_rate && (!peer->sta->deflink.he_cap.has_he ||
-					      peer->sta->deflink.rx_nss < he_nss)) {
+
+			if (he_fixed_rate && (!deflink->he_cap.has_he ||
+					      deflink->rx_nss < he_nss)) {
 				ret = false;
 				goto out;
 			}

base-commit: f39af96d352dd4f36a4a43601ea90561e17e5ca6
-- 
2.30.2


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

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

* [PATCH 2/2] ath10k: mac: fix too long lines
  2022-05-03  6:04 ` Kalle Valo
@ 2022-05-03  6:04   ` Kalle Valo
  -1 siblings, 0 replies; 16+ messages in thread
From: Kalle Valo @ 2022-05-03  6:04 UTC (permalink / raw)
  To: ath11k; +Cc: linux-wireless

From: Kalle Valo <quic_kvalo@quicinc.com>

checkpatch warns:

drivers/net/wireless/ath/ath10k/mac.c:2696: line length of 92 exceeds 90 columns
drivers/net/wireless/ath/ath10k/mac.c:6942: line length of 94 exceeds 90 columns
drivers/net/wireless/ath/ath10k/mac.c:6948: line length of 91 exceeds 90 columns

These were introduced by commit 046d2e7c50e3 ("mac80211: prepare sta handling
for MLO support").

Compile tested only.

Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
---
 drivers/net/wireless/ath/ath10k/mac.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 06a51a48c1d9..3570a5895ea8 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -2692,8 +2692,10 @@ static bool ath10k_mac_sta_has_ofdm_only(struct ieee80211_sta *sta)
 static enum wmi_phy_mode ath10k_mac_get_phymode_vht(struct ath10k *ar,
 						    struct ieee80211_sta *sta)
 {
+	struct ieee80211_sta_vht_cap *vht_cap = &sta->deflink.vht_cap;
+
 	if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160) {
-		switch (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK) {
+		switch (vht_cap->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK) {
 		case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ:
 			return MODE_11AC_VHT160;
 		case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ:
@@ -6926,6 +6928,9 @@ static int ath10k_mac_validate_rate_mask(struct ath10k *ar,
 					 struct ieee80211_sta *sta,
 					 u32 rate_ctrl_flag, u8 nss)
 {
+	struct ieee80211_sta_ht_cap *ht_cap = &sta->deflink.ht_cap;
+	struct ieee80211_sta_vht_cap *vht_cap = &sta->deflink.vht_cap;
+
 	if (nss > sta->deflink.rx_nss) {
 		ath10k_warn(ar, "Invalid nss field, configured %u limit %u\n",
 			    nss, sta->deflink.rx_nss);
@@ -6933,19 +6938,19 @@ static int ath10k_mac_validate_rate_mask(struct ath10k *ar,
 	}
 
 	if (ATH10K_HW_PREAMBLE(rate_ctrl_flag) == WMI_RATE_PREAMBLE_VHT) {
-		if (!sta->deflink.vht_cap.vht_supported) {
+		if (!vht_cap->vht_supported) {
 			ath10k_warn(ar, "Invalid VHT rate for sta %pM\n",
 				    sta->addr);
 			return -EINVAL;
 		}
 	} else if (ATH10K_HW_PREAMBLE(rate_ctrl_flag) == WMI_RATE_PREAMBLE_HT) {
-		if (!sta->deflink.ht_cap.ht_supported || sta->deflink.vht_cap.vht_supported) {
+		if (!ht_cap->ht_supported || vht_cap->vht_supported) {
 			ath10k_warn(ar, "Invalid HT rate for sta %pM\n",
 				    sta->addr);
 			return -EINVAL;
 		}
 	} else {
-		if (sta->deflink.ht_cap.ht_supported || sta->deflink.vht_cap.vht_supported)
+		if (ht_cap->ht_supported || vht_cap->vht_supported)
 			return -EINVAL;
 	}
 
-- 
2.30.2


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

* [PATCH 2/2] ath10k: mac: fix too long lines
@ 2022-05-03  6:04   ` Kalle Valo
  0 siblings, 0 replies; 16+ messages in thread
From: Kalle Valo @ 2022-05-03  6:04 UTC (permalink / raw)
  To: ath11k; +Cc: linux-wireless

From: Kalle Valo <quic_kvalo@quicinc.com>

checkpatch warns:

drivers/net/wireless/ath/ath10k/mac.c:2696: line length of 92 exceeds 90 columns
drivers/net/wireless/ath/ath10k/mac.c:6942: line length of 94 exceeds 90 columns
drivers/net/wireless/ath/ath10k/mac.c:6948: line length of 91 exceeds 90 columns

These were introduced by commit 046d2e7c50e3 ("mac80211: prepare sta handling
for MLO support").

Compile tested only.

Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
---
 drivers/net/wireless/ath/ath10k/mac.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 06a51a48c1d9..3570a5895ea8 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -2692,8 +2692,10 @@ static bool ath10k_mac_sta_has_ofdm_only(struct ieee80211_sta *sta)
 static enum wmi_phy_mode ath10k_mac_get_phymode_vht(struct ath10k *ar,
 						    struct ieee80211_sta *sta)
 {
+	struct ieee80211_sta_vht_cap *vht_cap = &sta->deflink.vht_cap;
+
 	if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160) {
-		switch (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK) {
+		switch (vht_cap->cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK) {
 		case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ:
 			return MODE_11AC_VHT160;
 		case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ:
@@ -6926,6 +6928,9 @@ static int ath10k_mac_validate_rate_mask(struct ath10k *ar,
 					 struct ieee80211_sta *sta,
 					 u32 rate_ctrl_flag, u8 nss)
 {
+	struct ieee80211_sta_ht_cap *ht_cap = &sta->deflink.ht_cap;
+	struct ieee80211_sta_vht_cap *vht_cap = &sta->deflink.vht_cap;
+
 	if (nss > sta->deflink.rx_nss) {
 		ath10k_warn(ar, "Invalid nss field, configured %u limit %u\n",
 			    nss, sta->deflink.rx_nss);
@@ -6933,19 +6938,19 @@ static int ath10k_mac_validate_rate_mask(struct ath10k *ar,
 	}
 
 	if (ATH10K_HW_PREAMBLE(rate_ctrl_flag) == WMI_RATE_PREAMBLE_VHT) {
-		if (!sta->deflink.vht_cap.vht_supported) {
+		if (!vht_cap->vht_supported) {
 			ath10k_warn(ar, "Invalid VHT rate for sta %pM\n",
 				    sta->addr);
 			return -EINVAL;
 		}
 	} else if (ATH10K_HW_PREAMBLE(rate_ctrl_flag) == WMI_RATE_PREAMBLE_HT) {
-		if (!sta->deflink.ht_cap.ht_supported || sta->deflink.vht_cap.vht_supported) {
+		if (!ht_cap->ht_supported || vht_cap->vht_supported) {
 			ath10k_warn(ar, "Invalid HT rate for sta %pM\n",
 				    sta->addr);
 			return -EINVAL;
 		}
 	} else {
-		if (sta->deflink.ht_cap.ht_supported || sta->deflink.vht_cap.vht_supported)
+		if (ht_cap->ht_supported || vht_cap->vht_supported)
 			return -EINVAL;
 	}
 
-- 
2.30.2


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

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

* Re: [PATCH 1/2] ath11k: mac: fix too long line
  2022-05-03  6:04 ` Kalle Valo
@ 2022-05-03 15:17   ` Jeff Johnson
  -1 siblings, 0 replies; 16+ messages in thread
From: Jeff Johnson @ 2022-05-03 15:17 UTC (permalink / raw)
  To: Kalle Valo, ath11k; +Cc: linux-wireless

On 5/2/2022 11:04 PM, Kalle Valo wrote:
> From: Kalle Valo <quic_kvalo@quicinc.com>
> 
> checkpatch warns:
> 
> drivers/net/wireless/ath/ath11k/mac.c:7760: line length of 91 exceeds 90 columns
> 
> This was introduced by commit 046d2e7c50e3 ("mac80211: prepare sta handling for
> MLO support").
> 
> Compile tested only.
> 
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
> ---
>   drivers/net/wireless/ath/ath11k/mac.c | 12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
> index c76cac5d6849..32fb0142124d 100644
> --- a/drivers/net/wireless/ath/ath11k/mac.c
> +++ b/drivers/net/wireless/ath/ath11k/mac.c
> @@ -7735,6 +7735,7 @@ ath11k_mac_validate_vht_he_fixed_rate_settings(struct ath11k *ar, enum nl80211_b
>   	bool he_fixed_rate = false, vht_fixed_rate = false;
>   	struct ath11k_peer *peer, *tmp;
>   	const u16 *vht_mcs_mask, *he_mcs_mask;
> +	struct ieee80211_link_sta *deflink;
>   	u8 vht_nss, he_nss;
>   	bool ret = true;
>   
> @@ -7757,13 +7758,16 @@ ath11k_mac_validate_vht_he_fixed_rate_settings(struct ath11k *ar, enum nl80211_b
>   	spin_lock_bh(&ar->ab->base_lock);
>   	list_for_each_entry_safe(peer, tmp, &ar->ab->peers, list) {
>   		if (peer->sta) {
> -			if (vht_fixed_rate && (!peer->sta->deflink.vht_cap.vht_supported ||
> -					       peer->sta->deflink.rx_nss < vht_nss)) {
> +			deflink = &peer->sta->deflink;


is there a reason to not declare deflink here?
then its scope of definition would equal the scope of usage


> +
> +			if (vht_fixed_rate && (!deflink->vht_cap.vht_supported ||
> +					       deflink->rx_nss < vht_nss)) {
>   				ret = false;
>   				goto out;
>   			}
> -			if (he_fixed_rate && (!peer->sta->deflink.he_cap.has_he ||
> -					      peer->sta->deflink.rx_nss < he_nss)) {
> +
> +			if (he_fixed_rate && (!deflink->he_cap.has_he ||
> +					      deflink->rx_nss < he_nss)) {
>   				ret = false;
>   				goto out;
>   			}
> 
> base-commit: f39af96d352dd4f36a4a43601ea90561e17e5ca6


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

* Re: [PATCH 1/2] ath11k: mac: fix too long line
@ 2022-05-03 15:17   ` Jeff Johnson
  0 siblings, 0 replies; 16+ messages in thread
From: Jeff Johnson @ 2022-05-03 15:17 UTC (permalink / raw)
  To: Kalle Valo, ath11k; +Cc: linux-wireless

On 5/2/2022 11:04 PM, Kalle Valo wrote:
> From: Kalle Valo <quic_kvalo@quicinc.com>
> 
> checkpatch warns:
> 
> drivers/net/wireless/ath/ath11k/mac.c:7760: line length of 91 exceeds 90 columns
> 
> This was introduced by commit 046d2e7c50e3 ("mac80211: prepare sta handling for
> MLO support").
> 
> Compile tested only.
> 
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
> ---
>   drivers/net/wireless/ath/ath11k/mac.c | 12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
> index c76cac5d6849..32fb0142124d 100644
> --- a/drivers/net/wireless/ath/ath11k/mac.c
> +++ b/drivers/net/wireless/ath/ath11k/mac.c
> @@ -7735,6 +7735,7 @@ ath11k_mac_validate_vht_he_fixed_rate_settings(struct ath11k *ar, enum nl80211_b
>   	bool he_fixed_rate = false, vht_fixed_rate = false;
>   	struct ath11k_peer *peer, *tmp;
>   	const u16 *vht_mcs_mask, *he_mcs_mask;
> +	struct ieee80211_link_sta *deflink;
>   	u8 vht_nss, he_nss;
>   	bool ret = true;
>   
> @@ -7757,13 +7758,16 @@ ath11k_mac_validate_vht_he_fixed_rate_settings(struct ath11k *ar, enum nl80211_b
>   	spin_lock_bh(&ar->ab->base_lock);
>   	list_for_each_entry_safe(peer, tmp, &ar->ab->peers, list) {
>   		if (peer->sta) {
> -			if (vht_fixed_rate && (!peer->sta->deflink.vht_cap.vht_supported ||
> -					       peer->sta->deflink.rx_nss < vht_nss)) {
> +			deflink = &peer->sta->deflink;


is there a reason to not declare deflink here?
then its scope of definition would equal the scope of usage


> +
> +			if (vht_fixed_rate && (!deflink->vht_cap.vht_supported ||
> +					       deflink->rx_nss < vht_nss)) {
>   				ret = false;
>   				goto out;
>   			}
> -			if (he_fixed_rate && (!peer->sta->deflink.he_cap.has_he ||
> -					      peer->sta->deflink.rx_nss < he_nss)) {
> +
> +			if (he_fixed_rate && (!deflink->he_cap.has_he ||
> +					      deflink->rx_nss < he_nss)) {
>   				ret = false;
>   				goto out;
>   			}
> 
> base-commit: f39af96d352dd4f36a4a43601ea90561e17e5ca6


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

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

* Re: [PATCH 2/2] ath10k: mac: fix too long lines
  2022-05-03  6:04   ` Kalle Valo
@ 2022-05-03 15:22     ` Jeff Johnson
  -1 siblings, 0 replies; 16+ messages in thread
From: Jeff Johnson @ 2022-05-03 15:22 UTC (permalink / raw)
  To: Kalle Valo, ath11k; +Cc: linux-wireless

On 5/2/2022 11:04 PM, Kalle Valo wrote:
> From: Kalle Valo <quic_kvalo@quicinc.com>
> 
> checkpatch warns:
> 
> drivers/net/wireless/ath/ath10k/mac.c:2696: line length of 92 exceeds 90 columns
> drivers/net/wireless/ath/ath10k/mac.c:6942: line length of 94 exceeds 90 columns
> drivers/net/wireless/ath/ath10k/mac.c:6948: line length of 91 exceeds 90 columns
> 
> These were introduced by commit 046d2e7c50e3 ("mac80211: prepare sta handling
> for MLO support").
> 
> Compile tested only.
> 

Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>

> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
> ---
>   drivers/net/wireless/ath/ath10k/mac.c | 13 +++++++++----
>   1 file changed, 9 insertions(+), 4 deletions(-)

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

* Re: [PATCH 2/2] ath10k: mac: fix too long lines
@ 2022-05-03 15:22     ` Jeff Johnson
  0 siblings, 0 replies; 16+ messages in thread
From: Jeff Johnson @ 2022-05-03 15:22 UTC (permalink / raw)
  To: Kalle Valo, ath11k; +Cc: linux-wireless

On 5/2/2022 11:04 PM, Kalle Valo wrote:
> From: Kalle Valo <quic_kvalo@quicinc.com>
> 
> checkpatch warns:
> 
> drivers/net/wireless/ath/ath10k/mac.c:2696: line length of 92 exceeds 90 columns
> drivers/net/wireless/ath/ath10k/mac.c:6942: line length of 94 exceeds 90 columns
> drivers/net/wireless/ath/ath10k/mac.c:6948: line length of 91 exceeds 90 columns
> 
> These were introduced by commit 046d2e7c50e3 ("mac80211: prepare sta handling
> for MLO support").
> 
> Compile tested only.
> 

Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>

> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
> ---
>   drivers/net/wireless/ath/ath10k/mac.c | 13 +++++++++----
>   1 file changed, 9 insertions(+), 4 deletions(-)

-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

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

* Re: [PATCH 1/2] ath11k: mac: fix too long line
  2022-05-03 15:17   ` Jeff Johnson
@ 2022-05-04  5:58     ` Kalle Valo
  -1 siblings, 0 replies; 16+ messages in thread
From: Kalle Valo @ 2022-05-04  5:58 UTC (permalink / raw)
  To: Jeff Johnson; +Cc: ath11k, linux-wireless

Jeff Johnson <quic_jjohnson@quicinc.com> writes:

> On 5/2/2022 11:04 PM, Kalle Valo wrote:
>> From: Kalle Valo <quic_kvalo@quicinc.com>
>>
>> checkpatch warns:
>>
>> drivers/net/wireless/ath/ath11k/mac.c:7760: line length of 91 exceeds 90 columns
>>
>> This was introduced by commit 046d2e7c50e3 ("mac80211: prepare sta handling for
>> MLO support").
>>
>> Compile tested only.
>>
>> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
>> ---
>>   drivers/net/wireless/ath/ath11k/mac.c | 12 ++++++++----
>>   1 file changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
>> index c76cac5d6849..32fb0142124d 100644
>> --- a/drivers/net/wireless/ath/ath11k/mac.c
>> +++ b/drivers/net/wireless/ath/ath11k/mac.c
>> @@ -7735,6 +7735,7 @@ ath11k_mac_validate_vht_he_fixed_rate_settings(struct ath11k *ar, enum nl80211_b
>>   	bool he_fixed_rate = false, vht_fixed_rate = false;
>>   	struct ath11k_peer *peer, *tmp;
>>   	const u16 *vht_mcs_mask, *he_mcs_mask;
>> +	struct ieee80211_link_sta *deflink;
>>   	u8 vht_nss, he_nss;
>>   	bool ret = true;
>>   @@ -7757,13 +7758,16 @@
>> ath11k_mac_validate_vht_he_fixed_rate_settings(struct ath11k *ar,
>> enum nl80211_b
>>   	spin_lock_bh(&ar->ab->base_lock);
>>   	list_for_each_entry_safe(peer, tmp, &ar->ab->peers, list) {
>>   		if (peer->sta) {
>> -			if (vht_fixed_rate && (!peer->sta->deflink.vht_cap.vht_supported ||
>> -					       peer->sta->deflink.rx_nss < vht_nss)) {
>> +			deflink = &peer->sta->deflink;
>
>
> is there a reason to not declare deflink here?
> then its scope of definition would equal the scope of usage

In ath10k and ath11k I have tried to avoid that and instead declare all
variables in the beginning of the function, this is to keep the code
simple. Of course there are few cases where a variable is declared in
the middle of the function, but that's just sloppy review on my part. I
feel that it's better to refactor the function into smaller functions
than start declaring variables in the middle of functions. Does that
make sense?

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

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

* Re: [PATCH 1/2] ath11k: mac: fix too long line
@ 2022-05-04  5:58     ` Kalle Valo
  0 siblings, 0 replies; 16+ messages in thread
From: Kalle Valo @ 2022-05-04  5:58 UTC (permalink / raw)
  To: Jeff Johnson; +Cc: ath11k, linux-wireless

Jeff Johnson <quic_jjohnson@quicinc.com> writes:

> On 5/2/2022 11:04 PM, Kalle Valo wrote:
>> From: Kalle Valo <quic_kvalo@quicinc.com>
>>
>> checkpatch warns:
>>
>> drivers/net/wireless/ath/ath11k/mac.c:7760: line length of 91 exceeds 90 columns
>>
>> This was introduced by commit 046d2e7c50e3 ("mac80211: prepare sta handling for
>> MLO support").
>>
>> Compile tested only.
>>
>> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
>> ---
>>   drivers/net/wireless/ath/ath11k/mac.c | 12 ++++++++----
>>   1 file changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
>> index c76cac5d6849..32fb0142124d 100644
>> --- a/drivers/net/wireless/ath/ath11k/mac.c
>> +++ b/drivers/net/wireless/ath/ath11k/mac.c
>> @@ -7735,6 +7735,7 @@ ath11k_mac_validate_vht_he_fixed_rate_settings(struct ath11k *ar, enum nl80211_b
>>   	bool he_fixed_rate = false, vht_fixed_rate = false;
>>   	struct ath11k_peer *peer, *tmp;
>>   	const u16 *vht_mcs_mask, *he_mcs_mask;
>> +	struct ieee80211_link_sta *deflink;
>>   	u8 vht_nss, he_nss;
>>   	bool ret = true;
>>   @@ -7757,13 +7758,16 @@
>> ath11k_mac_validate_vht_he_fixed_rate_settings(struct ath11k *ar,
>> enum nl80211_b
>>   	spin_lock_bh(&ar->ab->base_lock);
>>   	list_for_each_entry_safe(peer, tmp, &ar->ab->peers, list) {
>>   		if (peer->sta) {
>> -			if (vht_fixed_rate && (!peer->sta->deflink.vht_cap.vht_supported ||
>> -					       peer->sta->deflink.rx_nss < vht_nss)) {
>> +			deflink = &peer->sta->deflink;
>
>
> is there a reason to not declare deflink here?
> then its scope of definition would equal the scope of usage

In ath10k and ath11k I have tried to avoid that and instead declare all
variables in the beginning of the function, this is to keep the code
simple. Of course there are few cases where a variable is declared in
the middle of the function, but that's just sloppy review on my part. I
feel that it's better to refactor the function into smaller functions
than start declaring variables in the middle of functions. Does that
make sense?

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

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

* Re: [PATCH 1/2] ath11k: mac: fix too long line
  2022-05-04  5:58     ` Kalle Valo
@ 2022-05-04 16:30       ` Jeff Johnson
  -1 siblings, 0 replies; 16+ messages in thread
From: Jeff Johnson @ 2022-05-04 16:30 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath11k, linux-wireless

On 5/3/2022 10:58 PM, Kalle Valo wrote:
> Jeff Johnson <quic_jjohnson@quicinc.com> writes:
pe>> is there a reason to not declare deflink here?
>> then its scope of definition would equal the scope of usage
> 
> In ath10k and ath11k I have tried to avoid that and instead declare all
> variables in the beginning of the function, this is to keep the code
> simple. Of course there are few cases where a variable is declared in
> the middle of the function, but that's just sloppy review on my part. I
> feel that it's better to refactor the function into smaller functions
> than start declaring variables in the middle of functions. Does that
> make sense?
> 

This is really an academic question.

In the larger kernel community I'm seeing a push to reduce the scope of 
identifiers in some cases:
1) declaring loop control variables within the actual loop control operation
2) prohibiting the access to list iterators outside the list iteration loop

 From a software engineering perspective limiting scope can prevent some 
coding errors by preventing new code from being introduced which tries 
to access an identifier which has not been initialized.

To that end, I fully support the guidance to refactor into small 
functions where variable scope is not an issue.

Also consistency is extremely important, so I totally embrace having a 
consistent approach.

/jeff

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

* Re: [PATCH 1/2] ath11k: mac: fix too long line
@ 2022-05-04 16:30       ` Jeff Johnson
  0 siblings, 0 replies; 16+ messages in thread
From: Jeff Johnson @ 2022-05-04 16:30 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath11k, linux-wireless

On 5/3/2022 10:58 PM, Kalle Valo wrote:
> Jeff Johnson <quic_jjohnson@quicinc.com> writes:
pe>> is there a reason to not declare deflink here?
>> then its scope of definition would equal the scope of usage
> 
> In ath10k and ath11k I have tried to avoid that and instead declare all
> variables in the beginning of the function, this is to keep the code
> simple. Of course there are few cases where a variable is declared in
> the middle of the function, but that's just sloppy review on my part. I
> feel that it's better to refactor the function into smaller functions
> than start declaring variables in the middle of functions. Does that
> make sense?
> 

This is really an academic question.

In the larger kernel community I'm seeing a push to reduce the scope of 
identifiers in some cases:
1) declaring loop control variables within the actual loop control operation
2) prohibiting the access to list iterators outside the list iteration loop

 From a software engineering perspective limiting scope can prevent some 
coding errors by preventing new code from being introduced which tries 
to access an identifier which has not been initialized.

To that end, I fully support the guidance to refactor into small 
functions where variable scope is not an issue.

Also consistency is extremely important, so I totally embrace having a 
consistent approach.

/jeff

-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

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

* Re: [PATCH 1/2] ath11k: mac: fix too long line
  2022-05-03  6:04 ` Kalle Valo
@ 2022-05-06  6:17   ` Kalle Valo
  -1 siblings, 0 replies; 16+ messages in thread
From: Kalle Valo @ 2022-05-06  6:17 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath11k, linux-wireless

Kalle Valo <kvalo@kernel.org> wrote:

> checkpatch warns:
> 
> drivers/net/wireless/ath/ath11k/mac.c:7760: line length of 91 exceeds 90 columns
> 
> This was introduced by commit 046d2e7c50e3 ("mac80211: prepare sta handling for
> MLO support").
> 
> Compile tested only.
> 
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

2 patches applied to ath-next branch of ath.git, thanks.

80c5075f3999 ath11k: mac: fix too long line
d9e441855c64 ath10k: mac: fix too long lines

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20220503060415.24499-1-kvalo@kernel.org/

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


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

* Re: [PATCH 1/2] ath11k: mac: fix too long line
@ 2022-05-06  6:17   ` Kalle Valo
  0 siblings, 0 replies; 16+ messages in thread
From: Kalle Valo @ 2022-05-06  6:17 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath11k, linux-wireless

Kalle Valo <kvalo@kernel.org> wrote:

> checkpatch warns:
> 
> drivers/net/wireless/ath/ath11k/mac.c:7760: line length of 91 exceeds 90 columns
> 
> This was introduced by commit 046d2e7c50e3 ("mac80211: prepare sta handling for
> MLO support").
> 
> Compile tested only.
> 
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

2 patches applied to ath-next branch of ath.git, thanks.

80c5075f3999 ath11k: mac: fix too long line
d9e441855c64 ath10k: mac: fix too long lines

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20220503060415.24499-1-kvalo@kernel.org/

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


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

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

* Re: [PATCH 1/2] ath11k: mac: fix too long line
  2022-05-04 16:30       ` Jeff Johnson
@ 2022-05-06  9:04         ` Kalle Valo
  -1 siblings, 0 replies; 16+ messages in thread
From: Kalle Valo @ 2022-05-06  9:04 UTC (permalink / raw)
  To: Jeff Johnson; +Cc: ath11k, linux-wireless

Jeff Johnson <quic_jjohnson@quicinc.com> writes:

> On 5/3/2022 10:58 PM, Kalle Valo wrote:
>> Jeff Johnson <quic_jjohnson@quicinc.com> writes:
> pe>> is there a reason to not declare deflink here?
>>> then its scope of definition would equal the scope of usage
>>
>> In ath10k and ath11k I have tried to avoid that and instead declare all
>> variables in the beginning of the function, this is to keep the code
>> simple. Of course there are few cases where a variable is declared in
>> the middle of the function, but that's just sloppy review on my part. I
>> feel that it's better to refactor the function into smaller functions
>> than start declaring variables in the middle of functions. Does that
>> make sense?
>>
>
> This is really an academic question.
>
> In the larger kernel community I'm seeing a push to reduce the scope
> of identifiers in some cases:
> 1) declaring loop control variables within the actual loop control operation
> 2) prohibiting the access to list iterators outside the list iteration loop

Yeah, those are definitely good examples when to limit scope.

And of course this isn't a hard rule, in some cases we have to make
exceptions. For example ath11k_mac_op_bss_info_changed() and
ath11k_mac_op_sta_state() are long functions but trying to split them to
smaller functions most likely makes them harder to read. So for these
functions having variables declared within if blocks would sound like a
good idea, I think it would make the functions more readable.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

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

* Re: [PATCH 1/2] ath11k: mac: fix too long line
@ 2022-05-06  9:04         ` Kalle Valo
  0 siblings, 0 replies; 16+ messages in thread
From: Kalle Valo @ 2022-05-06  9:04 UTC (permalink / raw)
  To: Jeff Johnson; +Cc: ath11k, linux-wireless

Jeff Johnson <quic_jjohnson@quicinc.com> writes:

> On 5/3/2022 10:58 PM, Kalle Valo wrote:
>> Jeff Johnson <quic_jjohnson@quicinc.com> writes:
> pe>> is there a reason to not declare deflink here?
>>> then its scope of definition would equal the scope of usage
>>
>> In ath10k and ath11k I have tried to avoid that and instead declare all
>> variables in the beginning of the function, this is to keep the code
>> simple. Of course there are few cases where a variable is declared in
>> the middle of the function, but that's just sloppy review on my part. I
>> feel that it's better to refactor the function into smaller functions
>> than start declaring variables in the middle of functions. Does that
>> make sense?
>>
>
> This is really an academic question.
>
> In the larger kernel community I'm seeing a push to reduce the scope
> of identifiers in some cases:
> 1) declaring loop control variables within the actual loop control operation
> 2) prohibiting the access to list iterators outside the list iteration loop

Yeah, those are definitely good examples when to limit scope.

And of course this isn't a hard rule, in some cases we have to make
exceptions. For example ath11k_mac_op_bss_info_changed() and
ath11k_mac_op_sta_state() are long functions but trying to split them to
smaller functions most likely makes them harder to read. So for these
functions having variables declared within if blocks would sound like a
good idea, I think it would make the functions more readable.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

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

end of thread, other threads:[~2022-05-06  9:04 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-03  6:04 [PATCH 1/2] ath11k: mac: fix too long line Kalle Valo
2022-05-03  6:04 ` Kalle Valo
2022-05-03  6:04 ` [PATCH 2/2] ath10k: mac: fix too long lines Kalle Valo
2022-05-03  6:04   ` Kalle Valo
2022-05-03 15:22   ` Jeff Johnson
2022-05-03 15:22     ` Jeff Johnson
2022-05-03 15:17 ` [PATCH 1/2] ath11k: mac: fix too long line Jeff Johnson
2022-05-03 15:17   ` Jeff Johnson
2022-05-04  5:58   ` Kalle Valo
2022-05-04  5:58     ` Kalle Valo
2022-05-04 16:30     ` Jeff Johnson
2022-05-04 16:30       ` Jeff Johnson
2022-05-06  9:04       ` Kalle Valo
2022-05-06  9:04         ` Kalle Valo
2022-05-06  6:17 ` Kalle Valo
2022-05-06  6:17   ` Kalle Valo

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.