diff options
author | John Whitmore <johnfwhitmore@gmail.com> | 2018-07-31 21:59:54 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-08-02 09:46:00 +0200 |
commit | 893ce9394b3cba7722f9ce01ecba84f35c0211a6 (patch) | |
tree | ebb1555c3cd0094bab288f9d00c367323a365a3a /drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | |
parent | staging:rtl8192u: Remove union from aci_aifsn - Style (diff) | |
download | linux-dev-893ce9394b3cba7722f9ce01ecba84f35c0211a6.tar.xz linux-dev-893ce9394b3cba7722f9ce01ecba84f35c0211a6.zip |
staging:rtl8192u: Remove union from qos_tsinfo - Style
The union is never used as a union but only as a bitfield struct.
One side of the union (u8 charData[3];) Only seems to be present to
ensure that the structures size is 3 bytes in length. That length, of
the structure is dictated by the largest element of the union, so the
byte array only dictates size if it's the largest element of the union.
The byte array and union add nothing.
The union has therefore been removed and the structure and access to
the structure simplified.
Additionally since one of the bitfield variables (ucAccessPolicy)
spans a byte boundary the base type of the bitfield has been changed
from u8 to u16. Compilers have probably moved on from having an issue
with this, call it OCD.
The changes are coding style in nature and should not impact runtime
code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c')
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c index c21bf3d3b242..39a074621b3b 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c @@ -246,10 +246,10 @@ static struct ts_common_info *SearchAdmitTRStream(struct ieee80211_device *ieee, if (!search_dir[dir]) continue; list_for_each_entry(pRet, psearch_list, list){ - // IEEE80211_DEBUG(IEEE80211_DL_TS, "ADD:%pM, TID:%d, dir:%d\n", pRet->Addr, pRet->TSpec.f.TSInfo.field.ucTSID, pRet->TSpec.f.TSInfo.field.ucDirection); + // IEEE80211_DEBUG(IEEE80211_DL_TS, "ADD:%pM, TID:%d, dir:%d\n", pRet->Addr, pRet->TSpec.f.TSInfo.ucTSID, pRet->TSpec.f.TSInfo.ucDirection); if (memcmp(pRet->addr, Addr, 6) == 0) - if (pRet->t_spec.f.TSInfo.field.ucTSID == TID) - if(pRet->t_spec.f.TSInfo.field.ucDirection == dir) { + if (pRet->t_spec.f.TSInfo.ucTSID == TID) + if(pRet->t_spec.f.TSInfo.ucDirection == dir) { // printk("Bingo! got it\n"); break; } @@ -355,7 +355,7 @@ bool GetTs( // For HCCA or WMMSA, TS cannot be addmit without negotiation. // TSPEC_BODY TSpec; - union qos_tsinfo *pTSInfo = &TSpec.f.TSInfo; + struct qos_tsinfo *pTSInfo = &TSpec.f.TSInfo; struct list_head *pUnusedList = (TxRxSelect == TX_DIR)? (&ieee->Tx_TS_Unused_List): @@ -383,15 +383,15 @@ bool GetTs( IEEE80211_DEBUG(IEEE80211_DL_TS, "to init current TS, UP:%d, Dir:%d, addr:%pM\n", UP, Dir, Addr); // Prepare TS Info releated field - pTSInfo->field.ucTrafficType = 0; // Traffic type: WMM is reserved in this field - pTSInfo->field.ucTSID = UP; // TSID - pTSInfo->field.ucDirection = Dir; // Direction: if there is DirectLink, this need additional consideration. - pTSInfo->field.ucAccessPolicy = 1; // Access policy - pTSInfo->field.ucAggregation = 0; // Aggregation - pTSInfo->field.ucPSB = 0; // Aggregation - pTSInfo->field.ucUP = UP; // User priority - pTSInfo->field.ucTSInfoAckPolicy = 0; // Ack policy - pTSInfo->field.ucSchedule = 0; // Schedule + pTSInfo->ucTrafficType = 0; // Traffic type: WMM is reserved in this field + pTSInfo->ucTSID = UP; // TSID + pTSInfo->ucDirection = Dir; // Direction: if there is DirectLink, this need additional consideration. + pTSInfo->ucAccessPolicy = 1; // Access policy + pTSInfo->ucAggregation = 0; // Aggregation + pTSInfo->ucPSB = 0; // Aggregation + pTSInfo->ucUP = UP; // User priority + pTSInfo->ucTSInfoAckPolicy = 0; // Ack policy + pTSInfo->ucSchedule = 0; // Schedule MakeTSEntry(*ppTS, Addr, &TSpec, NULL, 0, 0); AdmitTS(ieee, *ppTS, 0); |