staging: vt6655: desc.h replace typedef struct tagTDES0
authorMalcolm Priestley <tvboxspy@gmail.com>
Fri, 14 Aug 2015 21:58:46 +0000 (22:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Aug 2015 02:31:10 +0000 (19:31 -0700)
create struct vnt_tdes0 replacing used members
byTSR0 -> tsr0
byTSR1 -> tsr1
f1Owner -> owner

Narrowing endian differences to inside structure.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6655/card.c
drivers/staging/vt6655/desc.h
drivers/staging/vt6655/device_main.c

index ae8fd7f491a386c98a228675086ee41a8408f755..e3ff4ad2e317990adbfb1b1695da1e4a42567857 100644 (file)
@@ -525,12 +525,12 @@ CARDvSafeResetTx(
 
        for (uu = 0; uu < pDevice->sOpts.nTxDescs[0]; uu++) {
                pCurrTD = &(pDevice->apTD0Rings[uu]);
-               pCurrTD->m_td0TD0.f1Owner = OWNED_BY_HOST;
+               pCurrTD->td0.owner = OWNED_BY_HOST;
                /* init all Tx Packet pointer to NULL */
        }
        for (uu = 0; uu < pDevice->sOpts.nTxDescs[1]; uu++) {
                pCurrTD = &(pDevice->apTD1Rings[uu]);
-               pCurrTD->m_td0TD0.f1Owner = OWNED_BY_HOST;
+               pCurrTD->td0.owner = OWNED_BY_HOST;
                /* init all Tx Packet pointer to NULL */
        }
 
index c9162149eb616f68c1e7fcaef08a3f8632f5f7eb..00fa348f466926b2fa195315ad10f87b779d269c 100644 (file)
@@ -216,33 +216,23 @@ typedef struct tagSRxDesc {
 SRxDesc, *PSRxDesc;
 typedef const SRxDesc *PCSRxDesc;
 
+struct vnt_tdes0 {
+       volatile u8 tsr0;
+       volatile u8 tsr1;
 #ifdef __BIG_ENDIAN
-
-typedef struct tagTDES0 {
-       volatile    unsigned char byTSR0;
-       volatile    unsigned char byTSR1;
        union {
-               volatile u16    f15Txtime;
+               volatile u16 f15_txtime;
                struct {
-                       volatile u8 f8Reserved1;
-                       volatile u8 f1Owner:1;
-                       volatile u8 f7Reserved:7;
-               } __attribute__ ((__packed__));
-       } __attribute__ ((__packed__));
-} __attribute__ ((__packed__))
-STDES0, PSTDES0;
-
+                       volatile u8 f8_reserved;
+                       volatile u8 owner:1;
+                       volatile u8 f7_reserved:7;
+               } __packed;
+       } __packed;
 #else
-
-typedef struct tagTDES0 {
-       volatile    unsigned char byTSR0;
-       volatile    unsigned char byTSR1;
-       volatile    unsigned short f15Txtime:15;
-       volatile    unsigned short f1Owner:1;
-} __attribute__ ((__packed__))
-STDES0;
-
+       volatile u16 f15_txtime:15;
+       volatile u16 owner:1;
 #endif
+} __packed;
 
 typedef struct tagTDES1 {
        volatile    __le16        wReqCount;
@@ -263,7 +253,7 @@ typedef struct tagDEVICE_TD_INFO {
 
 /* transmit descriptor */
 typedef struct tagSTxDesc {
-       volatile    STDES0  m_td0TD0;
+       volatile struct vnt_tdes0 td0;
        volatile    STDES1  m_td1TD1;
        volatile    __le32  buff_addr;
        volatile    __le32  next_desc;
index b74af8d89fe6d91e063904c51788f66f6ba6a215..842e0524a31fed5f91955a1b2b596da7380a1c75 100644 (file)
@@ -906,13 +906,13 @@ static int device_tx_srv(struct vnt_private *pDevice, unsigned int uIdx)
        unsigned char byTsr1;
 
        for (pTD = pDevice->apTailTD[uIdx]; pDevice->iTDUsed[uIdx] > 0; pTD = pTD->next) {
-               if (pTD->m_td0TD0.f1Owner == OWNED_BY_NIC)
+               if (pTD->td0.owner == OWNED_BY_NIC)
                        break;
                if (works++ > 15)
                        break;
 
-               byTsr0 = pTD->m_td0TD0.byTSR0;
-               byTsr1 = pTD->m_td0TD0.byTSR1;
+               byTsr0 = pTD->td0.tsr0;
+               byTsr1 = pTD->td0.tsr1;
 
                /* Only the status of first TD in the chain is correct */
                if (pTD->m_td1TD1.byTCR & TCR_STP) {
@@ -1200,7 +1200,7 @@ static int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
 
        /* Poll Transmit the adapter */
        wmb();
-       head_td->m_td0TD0.f1Owner = OWNED_BY_NIC;
+       head_td->td0.owner = OWNED_BY_NIC;
        wmb(); /* second memory barrier */
 
        if (head_td->pTDInfo->byFlags & TD_FLAGS_NETIF_SKB)