diff mbox series

[1/4] rtw88: pci: Change type of rtw_hw_queue_mapping() and ac_to_hwq to enum

Message ID 20220114234825.110502-2-martin.blumenstingl@googlemail.com
State Superseded
Headers show
Series rtw88: four small code-cleanups and refactorings | expand

Commit Message

Martin Blumenstingl Jan. 14, 2022, 11:48 p.m. UTC
rtw_hw_queue_mapping() and ac_to_hwq[] hold values of type enum
rtw_tx_queue_type. Change their types to reflect this to make it easier
to understand this part of the code.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 drivers/net/wireless/realtek/rtw88/pci.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Kalle Valo Jan. 17, 2022, 12:11 p.m. UTC | #1
Martin Blumenstingl <martin.blumenstingl@googlemail.com> writes:

> rtw_hw_queue_mapping() and ac_to_hwq[] hold values of type enum
> rtw_tx_queue_type. Change their types to reflect this to make it easier
> to understand this part of the code.
>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
>  drivers/net/wireless/realtek/rtw88/pci.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c
> index a0991d3f15c0..13f1f50b2867 100644
> --- a/drivers/net/wireless/realtek/rtw88/pci.c
> +++ b/drivers/net/wireless/realtek/rtw88/pci.c
> @@ -669,7 +669,7 @@ static void rtw_pci_deep_ps(struct rtw_dev *rtwdev, bool enter)
>  	spin_unlock_bh(&rtwpci->irq_lock);
>  }
>  
> -static u8 ac_to_hwq[] = {
> +static enum rtw_tx_queue_type ac_to_hwq[] = {
>  	[IEEE80211_AC_VO] = RTW_TX_QUEUE_VO,
>  	[IEEE80211_AC_VI] = RTW_TX_QUEUE_VI,
>  	[IEEE80211_AC_BE] = RTW_TX_QUEUE_BE,

Shouldn't ac_to_hwq be static const?
Martin Blumenstingl Jan. 17, 2022, 5:48 p.m. UTC | #2
Hi Kalle,

On Mon, Jan 17, 2022 at 1:11 PM Kalle Valo <kvalo@kernel.org> wrote:
[...]
> > -static u8 ac_to_hwq[] = {
> > +static enum rtw_tx_queue_type ac_to_hwq[] = {
> >       [IEEE80211_AC_VO] = RTW_TX_QUEUE_VO,
> >       [IEEE80211_AC_VI] = RTW_TX_QUEUE_VI,
> >       [IEEE80211_AC_BE] = RTW_TX_QUEUE_BE,
>
> Shouldn't ac_to_hwq be static const?
Good point, thanks for this suggestion!
I will include that in v2 of this series (which I will send in a few
days so others can share their thoughts about these patches as well).


Best regards,
Martin
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c
index a0991d3f15c0..13f1f50b2867 100644
--- a/drivers/net/wireless/realtek/rtw88/pci.c
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
@@ -669,7 +669,7 @@  static void rtw_pci_deep_ps(struct rtw_dev *rtwdev, bool enter)
 	spin_unlock_bh(&rtwpci->irq_lock);
 }
 
-static u8 ac_to_hwq[] = {
+static enum rtw_tx_queue_type ac_to_hwq[] = {
 	[IEEE80211_AC_VO] = RTW_TX_QUEUE_VO,
 	[IEEE80211_AC_VI] = RTW_TX_QUEUE_VI,
 	[IEEE80211_AC_BE] = RTW_TX_QUEUE_BE,
@@ -678,12 +678,12 @@  static u8 ac_to_hwq[] = {
 
 static_assert(ARRAY_SIZE(ac_to_hwq) == IEEE80211_NUM_ACS);
 
-static u8 rtw_hw_queue_mapping(struct sk_buff *skb)
+static enum rtw_tx_queue_type rtw_hw_queue_mapping(struct sk_buff *skb)
 {
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
 	__le16 fc = hdr->frame_control;
 	u8 q_mapping = skb_get_queue_mapping(skb);
-	u8 queue;
+	enum rtw_tx_queue_type queue;
 
 	if (unlikely(ieee80211_is_beacon(fc)))
 		queue = RTW_TX_QUEUE_BCN;