staging: vt6656: WCTLbIsDuplicate fix PSCacheEntry base types and warnings
authorMalcolm Priestley <tvboxspy@gmail.com>
Tue, 27 May 2014 20:05:17 +0000 (21:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 May 2014 21:10:45 +0000 (14:10 -0700)
Fix wFmSequence and wFrameCtl to __le16

Don't restrict to u8, if packet is a duplicate both bytes of __le16 will be
the same.

Fixes warnings
wctl.c:66:9: warning: restricted __le16 degrades to integer
wctl.c:71:56: warning: restricted __le16 degrades to integer
wctl.c:73:49: warning: cast from restricted __le16
wctl.c:83:30: warning: incorrect type in assignment (different base types)
wctl.c:83:30:    expected unsigned short [unsigned] [usertype] wFmSequence
wctl.c:83:30:    got restricted __le16 [usertype] seq_ctrl
wctl.c:85:28: warning: incorrect type in assignment (different base types)
wctl.c:85:28:    expected unsigned short [unsigned] [usertype] wFrameCtl
wctl.c:85:28:    got restricted __le16 [usertype] frame_control

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/device.h
drivers/staging/vt6656/wctl.c

index e5f84f5b377df1fa06f0063fd9163fef278a902e..5b64ca7b62f38dd01f371e24799b00ff2e6600ad 100644 (file)
@@ -340,9 +340,9 @@ typedef struct tagSPMKIDCandidateEvent {
 
 /* The receive duplicate detection cache entry */
 typedef struct tagSCacheEntry{
-    u16        wFmSequence;
-    u8        abyAddr2[ETH_ALEN];
-    u16        wFrameCtl;
+       __le16 wFmSequence;
+       u8 abyAddr2[ETH_ALEN];
+       __le16 wFrameCtl;
 } SCacheEntry, *PSCacheEntry;
 
 typedef struct tagSCache{
index 814342cd948ed9509d175d8ece30734b05d9f69a..efdc5d5d38eeefed6ed1354da9e2551599e8716d 100644 (file)
@@ -70,7 +70,7 @@ bool WCTLbIsDuplicate (PSCache pCache, struct ieee80211_hdr *pMACHeader)
             pCacheEntry = &(pCache->asCacheEntry[uIndex]);
             if ((pCacheEntry->wFmSequence == pMACHeader->seq_ctrl) &&
                ether_addr_equal(pCacheEntry->abyAddr2, pMACHeader->addr2) &&
-                (LOBYTE(pCacheEntry->wFrameCtl) == LOBYTE(pMACHeader->frame_control))
+               (pCacheEntry->wFrameCtl == pMACHeader->frame_control)
                 ) {
                 /* Duplicate match */
                 return true;