staging: r8188eu: make numNQ a u8
authorMartin Kaiser <martin@kaiser.cx>
Mon, 8 Aug 2022 20:14:02 +0000 (22:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Aug 2022 13:18:29 +0000 (15:18 +0200)
The numNQ variable in _InitQueueReservedPage is defined as u32. It is
either set to 0 or to 0x1C. Change its type to u8 and remove the code that
casts the u32 value to u8.

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220808201405.68966-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/hal/usb_halinit.c
drivers/staging/r8188eu/include/rtl8188e_spec.h

index b63f5bb..18465e5 100644 (file)
@@ -156,10 +156,9 @@ static void _InitQueueReservedPage(struct adapter *Adapter)
        struct registry_priv    *pregistrypriv = &Adapter->registrypriv;
        u32 numHQ       = 0;
        u32 numLQ       = 0;
-       u32 numNQ       = 0;
+       u8 numNQ = 0;
        u32 numPubQ;
        u32 value32;
-       u8 value8;
 
        if (pregistrypriv->wifi_spec) {
                if (haldata->OutEpQueueSel & TX_SELE_HQ)
@@ -171,8 +170,8 @@ static void _InitQueueReservedPage(struct adapter *Adapter)
                /*  NOTE: This step shall be proceed before writing REG_RQPN. */
                if (haldata->OutEpQueueSel & TX_SELE_NQ)
                        numNQ = 0x1C;
-               value8 = (u8)_NPQ(numNQ);
-               rtw_write8(Adapter, REG_RQPN_NPQ, value8);
+
+               rtw_write8(Adapter, REG_RQPN_NPQ, numNQ);
 
                numPubQ = 0xA8 - numHQ - numLQ - numNQ;
 
index 9e7b1f8..d9a85fd 100644 (file)
@@ -928,8 +928,6 @@ Current IOREG MAP
 #define _HPQ(x)                                ((x) & 0xFF)
 #define _LPQ(x)                                (((x) & 0xFF) << 8)
 #define _PUBQ(x)                       (((x) & 0xFF) << 16)
-/*  NOTE: in RQPN_NPQ register */
-#define _NPQ(x)                                ((x) & 0xFF)
 
 #define HPQ_PUBLIC_DIS                 BIT(24)
 #define LPQ_PUBLIC_DIS                 BIT(25)