From bc6b124b6863fc9c1f22d11c5e4e258986ccc76e Mon Sep 17 00:00:00 2001 From: Bhanusree Pola Date: Mon, 11 Mar 2019 21:11:35 +0530 Subject: staging: rtl8192u: Remove typedef for struct _bandwidth_autoswitch -Avoid typedefs for structure types to maintain kernel coding style. -Remove typedefs bandwidth_autoswitch and *pbandwidth_autoswitch of struct _bandwidth_autoswitch. -Change Structure name _bandwidth_autoswitch to bandwidth_autoswitch to maintain Linux kernel Coding Style. -Replace occurence of bandwidth_autoswitch to struct bandwidth_autoswitch. Signed-off-by: Bhanusree Pola Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index 8aa536d79900..ce79b8321961 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -1462,12 +1462,12 @@ struct tx_pending { struct ieee80211_txb *txb; }; -typedef struct _bandwidth_autoswitch { +struct bandwidth_autoswitch { long threshold_20Mhzto40Mhz; long threshold_40Mhzto20Mhz; bool bforced_tx20Mhz; bool bautoswitch_enable; -} bandwidth_autoswitch, *pbandwidth_autoswitch; +}; //added by amy for order @@ -1871,7 +1871,7 @@ struct ieee80211_device { Fsync_State fsync_state; bool bis_any_nonbepkts; //20Mhz 40Mhz AutoSwitch Threshold - bandwidth_autoswitch bandwidth_auto_switch; + struct bandwidth_autoswitch bandwidth_auto_switch; //for txpower tracking bool FwRWRF; -- cgit From d83908ed0fc6bf8abe682f2cfa36721851c02d25 Mon Sep 17 00:00:00 2001 From: Bhanusree Pola Date: Mon, 11 Mar 2019 21:11:36 +0530 Subject: staging: rtl8192u: Remove typedef for struct _IbssParms -Avoid typedefs for structure types to maintain kernel coding style. -Remove typedefs IbssParms and *PIbssParms of struct _IbssParms. -Change Structure name _IbssParms to ibss_parms to maintain Linux kernel Coding Style. -Replace occurence of IbssParms to struct ibss_parms. Signed-off-by: Bhanusree Pola Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index ce79b8321961..d78bc976cc69 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -1506,9 +1506,9 @@ typedef enum _RT_JOIN_ACTION { RT_NO_ACTION = 4, } RT_JOIN_ACTION; -typedef struct _IbssParms { +struct ibss_parms { u16 atimWin; -} IbssParms, *PIbssParms; +}; #define MAX_NUM_RATES 264 // Max num of support rates element: 8, Max num of ext. support rate: 255. 061122, by rcnjko. // RF state. @@ -1554,7 +1554,7 @@ typedef struct _RT_POWER_SAVE_CONTROL { struct octet_string tmpSuppRateSet; u8 tmpSuppRateBuf[MAX_NUM_RATES]; bool bTmpSuppRate; - IbssParms tmpIbpm; + struct ibss_parms tmpIbpm; bool bTmpIbpm; // -- cgit From 82ec1977b3938d10f90142b272bd0f6886e38e15 Mon Sep 17 00:00:00 2001 From: Bhanusree Pola Date: Mon, 11 Mar 2019 21:11:37 +0530 Subject: staging: rtl8192u: Remove typedef for struct _RT_POWER_SAVE_CONTROL -Avoid typedefs for structure types to maintain kernel coding style. -Remove typedefs RT_POWER_SAVE_CONTROL and *PRT_POWER_SAVE_CONTROL of struct _RT_POWER_SAVE_CONTROL. -Change Structure name _RT_POWER_SAVE_CONTROL to rt_power_save_control to maintain Linux kernel Coding Style. -Replace occurence of _RT_POWER_SAVE_CONTROL to struct rt_power_save_control. Signed-off-by: Bhanusree Pola Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index d78bc976cc69..c8c0e4282fea 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -1518,7 +1518,7 @@ typedef enum _RT_RF_POWER_STATE { eRfOff } RT_RF_POWER_STATE; -typedef struct _RT_POWER_SAVE_CONTROL { +struct rt_power_save_control { // // Inactive Power Save(IPS) : Disable RF when disconnected @@ -1562,7 +1562,7 @@ typedef struct _RT_POWER_SAVE_CONTROL { // bool bLeisurePs; -} RT_POWER_SAVE_CONTROL, *PRT_POWER_SAVE_CONTROL; +}; typedef u32 RT_RF_CHANGE_SOURCE; #define RF_CHANGE_BY_SW BIT(31) @@ -1876,9 +1876,9 @@ struct ieee80211_device { bool FwRWRF; //added by amy for AP roaming - RT_LINK_DETECT_T LinkDetectInfo; + RT_LINK_DETECT_T LinkDetectInfo; //added by amy for ps - RT_POWER_SAVE_CONTROL PowerSaveControl; + struct rt_power_save_control PowerSaveControl; //} /* used if IEEE_SOFTMAC_TX_QUEUE is set */ struct tx_pending tx_pending; -- cgit From 00b0f841b7403b762a2b9a02e79b126703c075ea Mon Sep 17 00:00:00 2001 From: Bhanusree Pola Date: Mon, 11 Mar 2019 21:11:38 +0530 Subject: staging: rtl8192u: Remove typedef for struct _RT_LINK_DETECT_T -Avoid typedefs for structure types to maintain kernel coding style. -Remove typedefs RT_LINK_DETECT_T and *PRT_LINK_DETECT_T of struct _RT_LINK_DETECT_T. -Change Structure name _RT_LINK_DETECT_T to rt_link_detect to maintain Linux kernel Coding Style. -Replace occurence of RT_LINK_DETECT_T to struct rt_link_detect. Signed-off-by: Bhanusree Pola Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index c8c0e4282fea..fc24df42ca8d 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -1586,7 +1586,7 @@ typedef enum { } country_code_type_t; #define RT_MAX_LD_SLOT_NUM 10 -typedef struct _RT_LINK_DETECT_T { +struct rt_link_detect { u32 NumRecvBcnInPeriod; u32 NumRecvDataInPeriod; @@ -1599,7 +1599,7 @@ typedef struct _RT_LINK_DETECT_T { u32 NumTxOkInPeriod; u32 NumRxOkInPeriod; bool bBusyTraffic; -} RT_LINK_DETECT_T, *PRT_LINK_DETECT_T; +}; struct ieee80211_device { @@ -1876,7 +1876,7 @@ struct ieee80211_device { bool FwRWRF; //added by amy for AP roaming - RT_LINK_DETECT_T LinkDetectInfo; + struct rt_link_detect LinkDetectInfo; //added by amy for ps struct rt_power_save_control PowerSaveControl; //} -- cgit From 3eb9aa00daaefc86ec8c734125d5c9b0dae76228 Mon Sep 17 00:00:00 2001 From: Bhanusree Pola Date: Mon, 11 Mar 2019 21:11:39 +0530 Subject: staging: rtl8192u: Remove typedef for struct _RX_REORDER_ENTRY -Avoid typedefs for structure types to maintain kernel coding style. -Remove typedefs RX_REORDER_ENTRY and *PRX_REORDER_ENTRY of struct _RX_REORDER_ENTRY . -Change Structure name _RX_REORDER_ENTRY to rx_reorder_entry to maintain Linux kernel Coding Style. -Replace occurences of RX_REORDER_ENTRY to struct rx_reorder_entry. -Replace occurences of PRX_REORDER_ENTRY to struct rx_reorder_entry *. Signed-off-by: Bhanusree Pola Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 +++--- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 12 ++++++------ drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index fc24df42ca8d..ad5a3ae14804 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -1474,11 +1474,11 @@ struct bandwidth_autoswitch { #define REORDER_WIN_SIZE 128 #define REORDER_ENTRY_NUM 128 -typedef struct _RX_REORDER_ENTRY { +struct rx_reorder_entry { struct list_head List; u16 SeqNum; struct ieee80211_rxb *prxb; -} RX_REORDER_ENTRY, *PRX_REORDER_ENTRY; +}; //added by amy for order typedef enum _Fsync_State { Default_Fsync, @@ -1654,7 +1654,7 @@ struct ieee80211_device { struct list_head Rx_TS_Unused_List; struct rx_ts_record RxTsRecord[TOTAL_TS_NUM]; //#ifdef TO_DO_LIST - RX_REORDER_ENTRY RxReorderEntry[128]; + struct rx_reorder_entry RxReorderEntry[128]; struct list_head RxReorder_Unused_List; //#endif // Qos related. Added by Annie, 2005-11-01. diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c index 5147f7c01e31..c2483da9394e 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c @@ -508,16 +508,16 @@ drop: return 1; } -static bool AddReorderEntry(struct rx_ts_record *pTS, PRX_REORDER_ENTRY pReorderEntry) +static bool AddReorderEntry(struct rx_ts_record *pTS, struct rx_reorder_entry *pReorderEntry) { struct list_head *pList = &pTS->rx_pending_pkt_list; while(pList->next != &pTS->rx_pending_pkt_list) { - if( SN_LESS(pReorderEntry->SeqNum, ((PRX_REORDER_ENTRY)list_entry(pList->next,RX_REORDER_ENTRY,List))->SeqNum) ) + if( SN_LESS(pReorderEntry->SeqNum, ((struct rx_reorder_entry *)list_entry(pList->next, struct rx_reorder_entry, List))->SeqNum) ) { pList = pList->next; } - else if( SN_EQUAL(pReorderEntry->SeqNum, ((PRX_REORDER_ENTRY)list_entry(pList->next,RX_REORDER_ENTRY,List))->SeqNum) ) + else if( SN_EQUAL(pReorderEntry->SeqNum, ((struct rx_reorder_entry *)list_entry(pList->next, struct rx_reorder_entry, List))->SeqNum) ) { return false; } @@ -589,7 +589,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee, struct rx_ts_record *pTS, u16 SeqNum) { PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; - PRX_REORDER_ENTRY pReorderEntry = NULL; + struct rx_reorder_entry *pReorderEntry = NULL; struct ieee80211_rxb **prxbIndicateArray; u8 WinSize = pHTInfo->RxReorderWinSize; u16 WinEnd = (pTS->rx_indicate_seq + WinSize - 1) % 4096; @@ -663,7 +663,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee, /* Current packet is going to be inserted into pending list.*/ //IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): We RX no ordered packed, insert to ordered list\n",__func__); if(!list_empty(&ieee->RxReorder_Unused_List)) { - pReorderEntry = (PRX_REORDER_ENTRY)list_entry(ieee->RxReorder_Unused_List.next,RX_REORDER_ENTRY,List); + pReorderEntry = (struct rx_reorder_entry *)list_entry(ieee->RxReorder_Unused_List.next, struct rx_reorder_entry, List); list_del_init(&pReorderEntry->List); /* Make a reorder entry and insert into a the packet list.*/ @@ -709,7 +709,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee, /* Check if there is any packet need indicate.*/ while(!list_empty(&pTS->rx_pending_pkt_list)) { IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): start RREORDER indicate\n",__func__); - pReorderEntry = (PRX_REORDER_ENTRY)list_entry(pTS->rx_pending_pkt_list.prev,RX_REORDER_ENTRY,List); + pReorderEntry = (struct rx_reorder_entry *)list_entry(pTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List); if (SN_LESS(pReorderEntry->SeqNum, pTS->rx_indicate_seq) || SN_EQUAL(pReorderEntry->SeqNum, pTS->rx_indicate_seq)) { diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c index c76715ffa08b..aefa37b285b3 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c @@ -28,7 +28,7 @@ static void RxPktPendingTimeout(struct timer_list *t) struct rx_ts_record *pRxTs = from_timer(pRxTs, t, rx_pkt_pending_timer); struct ieee80211_device *ieee = container_of(pRxTs, struct ieee80211_device, RxTsRecord[pRxTs->num]); - PRX_REORDER_ENTRY pReorderEntry = NULL; + struct rx_reorder_entry *pReorderEntry = NULL; //u32 flags = 0; unsigned long flags = 0; @@ -40,7 +40,7 @@ static void RxPktPendingTimeout(struct timer_list *t) if(pRxTs->rx_timeout_indicate_seq != 0xffff) { // Indicate the pending packets sequentially according to SeqNum until meet the gap. while(!list_empty(&pRxTs->rx_pending_pkt_list)) { - pReorderEntry = (PRX_REORDER_ENTRY)list_entry(pRxTs->rx_pending_pkt_list.prev, RX_REORDER_ENTRY, List); + pReorderEntry = (struct rx_reorder_entry *)list_entry(pRxTs->rx_pending_pkt_list.prev, struct rx_reorder_entry, List); if(index == 0) pRxTs->rx_indicate_seq = pReorderEntry->SeqNum; @@ -133,7 +133,7 @@ void TSInitialize(struct ieee80211_device *ieee) { struct tx_ts_record *pTxTS = ieee->TxTsRecord; struct rx_ts_record *pRxTS = ieee->RxTsRecord; - PRX_REORDER_ENTRY pRxReorderEntry = ieee->RxReorderEntry; + struct rx_reorder_entry *pRxReorderEntry = ieee->RxReorderEntry; u8 count = 0; IEEE80211_DEBUG(IEEE80211_DL_TS, "==========>%s()\n", __func__); // Initialize Tx TS related info. @@ -418,7 +418,7 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info * if(TxRxSelect == RX_DIR) { //#ifdef TO_DO_LIST - PRX_REORDER_ENTRY pRxReorderEntry; + struct rx_reorder_entry *pRxReorderEntry; struct rx_ts_record *pRxTS = (struct rx_ts_record *)pTs; if(timer_pending(&pRxTS->rx_pkt_pending_timer)) del_timer_sync(&pRxTS->rx_pkt_pending_timer); @@ -426,7 +426,7 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info * while(!list_empty(&pRxTS->rx_pending_pkt_list)) { spin_lock_irqsave(&(ieee->reorder_spinlock), flags); //pRxReorderEntry = list_entry(&pRxTS->rx_pending_pkt_list.prev,RX_REORDER_ENTRY,List); - pRxReorderEntry = (PRX_REORDER_ENTRY)list_entry(pRxTS->rx_pending_pkt_list.prev, RX_REORDER_ENTRY, List); + pRxReorderEntry = (struct rx_reorder_entry *)list_entry(pRxTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List); list_del_init(&pRxReorderEntry->List); { int i = 0; -- cgit From a279fc9d051bfd62ca0676caf75408b1208c70f5 Mon Sep 17 00:00:00 2001 From: Bhanusree Pola Date: Mon, 11 Mar 2019 21:11:40 +0530 Subject: staging: rtl8192u: Remove casts on the return values of list_entry Remove casts return values of on all occurances of list_entry. Casts on the return values of list_entry are useless. list_entry is a macro and already casts its return value to the type mentioned in its second argument. Signed-off-by: Bhanusree Pola Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 8 ++++---- drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c index c2483da9394e..52c655b423ce 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c @@ -513,11 +513,11 @@ static bool AddReorderEntry(struct rx_ts_record *pTS, struct rx_reorder_entry *p struct list_head *pList = &pTS->rx_pending_pkt_list; while(pList->next != &pTS->rx_pending_pkt_list) { - if( SN_LESS(pReorderEntry->SeqNum, ((struct rx_reorder_entry *)list_entry(pList->next, struct rx_reorder_entry, List))->SeqNum) ) + if( SN_LESS(pReorderEntry->SeqNum, list_entry(pList->next, struct rx_reorder_entry, List)->SeqNum) ) { pList = pList->next; } - else if( SN_EQUAL(pReorderEntry->SeqNum, ((struct rx_reorder_entry *)list_entry(pList->next, struct rx_reorder_entry, List))->SeqNum) ) + else if( SN_EQUAL(pReorderEntry->SeqNum, list_entry(pList->next, struct rx_reorder_entry, List)->SeqNum) ) { return false; } @@ -663,7 +663,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee, /* Current packet is going to be inserted into pending list.*/ //IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): We RX no ordered packed, insert to ordered list\n",__func__); if(!list_empty(&ieee->RxReorder_Unused_List)) { - pReorderEntry = (struct rx_reorder_entry *)list_entry(ieee->RxReorder_Unused_List.next, struct rx_reorder_entry, List); + pReorderEntry = list_entry(ieee->RxReorder_Unused_List.next, struct rx_reorder_entry, List); list_del_init(&pReorderEntry->List); /* Make a reorder entry and insert into a the packet list.*/ @@ -709,7 +709,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee, /* Check if there is any packet need indicate.*/ while(!list_empty(&pTS->rx_pending_pkt_list)) { IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): start RREORDER indicate\n",__func__); - pReorderEntry = (struct rx_reorder_entry *)list_entry(pTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List); + pReorderEntry = list_entry(pTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List); if (SN_LESS(pReorderEntry->SeqNum, pTS->rx_indicate_seq) || SN_EQUAL(pReorderEntry->SeqNum, pTS->rx_indicate_seq)) { diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c index aefa37b285b3..0368e5e3e95d 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c @@ -40,7 +40,7 @@ static void RxPktPendingTimeout(struct timer_list *t) if(pRxTs->rx_timeout_indicate_seq != 0xffff) { // Indicate the pending packets sequentially according to SeqNum until meet the gap. while(!list_empty(&pRxTs->rx_pending_pkt_list)) { - pReorderEntry = (struct rx_reorder_entry *)list_entry(pRxTs->rx_pending_pkt_list.prev, struct rx_reorder_entry, List); + pReorderEntry = list_entry(pRxTs->rx_pending_pkt_list.prev, struct rx_reorder_entry, List); if(index == 0) pRxTs->rx_indicate_seq = pReorderEntry->SeqNum; @@ -426,7 +426,7 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info * while(!list_empty(&pRxTS->rx_pending_pkt_list)) { spin_lock_irqsave(&(ieee->reorder_spinlock), flags); //pRxReorderEntry = list_entry(&pRxTS->rx_pending_pkt_list.prev,RX_REORDER_ENTRY,List); - pRxReorderEntry = (struct rx_reorder_entry *)list_entry(pRxTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List); + pRxReorderEntry = list_entry(pRxTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List); list_del_init(&pRxReorderEntry->List); { int i = 0; -- cgit From e8ca82a1348b07d64613d6af1303edf5097b476a Mon Sep 17 00:00:00 2001 From: Bhanusree Pola Date: Mon, 11 Mar 2019 21:11:41 +0530 Subject: staging: rtl8192u: Adjust 'if' to follow Kernel coding Style -Adjust spaces around if and the condition expression to maintain Linux Kernel Coding style. -Remove unnecessary braces around if-else as only single statement is executed. Signed-off-by: Bhanusree Pola Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c index 52c655b423ce..6009fe0e1d4f 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c @@ -513,18 +513,12 @@ static bool AddReorderEntry(struct rx_ts_record *pTS, struct rx_reorder_entry *p struct list_head *pList = &pTS->rx_pending_pkt_list; while(pList->next != &pTS->rx_pending_pkt_list) { - if( SN_LESS(pReorderEntry->SeqNum, list_entry(pList->next, struct rx_reorder_entry, List)->SeqNum) ) - { + if (SN_LESS(pReorderEntry->SeqNum, list_entry(pList->next, struct rx_reorder_entry, List)->SeqNum)) pList = pList->next; - } - else if( SN_EQUAL(pReorderEntry->SeqNum, list_entry(pList->next, struct rx_reorder_entry, List)->SeqNum) ) - { + else if (SN_EQUAL(pReorderEntry->SeqNum, list_entry(pList->next, struct rx_reorder_entry, List)->SeqNum)) return false; - } else - { break; - } } pReorderEntry->List.next = pList->next; pReorderEntry->List.next->prev = &pReorderEntry->List; -- cgit From d5469036124d0e3a644f6e00b64f0033d9429bfe Mon Sep 17 00:00:00 2001 From: Sidong Yang Date: Tue, 12 Mar 2019 14:11:50 +0000 Subject: staging: rtl8192u: Add required spaces before open parenthesis Fix error reported by checkpatch.pl Signed-off-by: Sidong Yang Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c | 22 +++---- .../staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 68 +++++++++++----------- 2 files changed, 45 insertions(+), 45 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c index 024fa2702546..ea9c69eeceae 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c @@ -318,17 +318,17 @@ static void ieee80211_tx_query_agg_cap(struct ieee80211_device *ieee, return; //check packet and mode later #ifdef TO_DO_LIST - if(pTcb->PacketLength >= 4096) + if (pTcb->PacketLength >= 4096) return; // For RTL819X, if pairwisekey = wep/tkip, we don't aggrregation. - if(!Adapter->HalFunc.GetNmodeSupportBySecCfgHandler(Adapter)) + if (!Adapter->HalFunc.GetNmodeSupportBySecCfgHandler(Adapter)) return; #endif - if(!ieee->GetNmodeSupportBySecCfg(ieee->dev)) + if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) { return; } - if(pHTInfo->bCurrentAMPDUEnable) + if (pHTInfo->bCurrentAMPDUEnable) { if (!GetTs(ieee, (struct ts_common_info **)(&pTxTs), hdr->addr1, skb->priority, TX_DIR, true)) { @@ -398,18 +398,18 @@ ieee80211_query_HTCapShortGI(struct ieee80211_device *ieee, struct cb_desc *tcb_ tcb_desc->bUseShortGI = false; - if(!pHTInfo->bCurrentHTSupport||!pHTInfo->bEnableHT) + if (!pHTInfo->bCurrentHTSupport||!pHTInfo->bEnableHT) return; - if(pHTInfo->bForcedShortGI) + if (pHTInfo->bForcedShortGI) { tcb_desc->bUseShortGI = true; return; } - if((pHTInfo->bCurBW40MHz==true) && pHTInfo->bCurShortGI40MHz) + if ((pHTInfo->bCurBW40MHz==true) && pHTInfo->bCurShortGI40MHz) tcb_desc->bUseShortGI = true; - else if((pHTInfo->bCurBW40MHz==false) && pHTInfo->bCurShortGI20MHz) + else if ((pHTInfo->bCurBW40MHz==false) && pHTInfo->bCurShortGI20MHz) tcb_desc->bUseShortGI = true; } @@ -420,13 +420,13 @@ static void ieee80211_query_BandwidthMode(struct ieee80211_device *ieee, tcb_desc->bPacketBW = false; - if(!pHTInfo->bCurrentHTSupport||!pHTInfo->bEnableHT) + if (!pHTInfo->bCurrentHTSupport||!pHTInfo->bEnableHT) return; - if(tcb_desc->bMulticast || tcb_desc->bBroadcast) + if (tcb_desc->bMulticast || tcb_desc->bBroadcast) return; - if((tcb_desc->data_rate & 0x80)==0) // If using legacy rate, it shall use 20MHz channel. + if ((tcb_desc->data_rate & 0x80)==0) // If using legacy rate, it shall use 20MHz channel. return; //BandWidthAutoSwitch is for auto switch to 20 or 40 in long distance if(pHTInfo->bCurBW40MHz && pHTInfo->bCurTxBW40MHz && !ieee->bandwidth_auto_switch.bforced_tx20Mhz) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c index 0368e5e3e95d..4bb6c32b9bf0 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c @@ -37,18 +37,18 @@ static void RxPktPendingTimeout(struct timer_list *t) spin_lock_irqsave(&(ieee->reorder_spinlock), flags); IEEE80211_DEBUG(IEEE80211_DL_REORDER, "==================>%s()\n", __func__); - if(pRxTs->rx_timeout_indicate_seq != 0xffff) { + if (pRxTs->rx_timeout_indicate_seq != 0xffff) { // Indicate the pending packets sequentially according to SeqNum until meet the gap. - while(!list_empty(&pRxTs->rx_pending_pkt_list)) { + while (!list_empty(&pRxTs->rx_pending_pkt_list)) { pReorderEntry = list_entry(pRxTs->rx_pending_pkt_list.prev, struct rx_reorder_entry, List); - if(index == 0) + if (index == 0) pRxTs->rx_indicate_seq = pReorderEntry->SeqNum; - if( SN_LESS(pReorderEntry->SeqNum, pRxTs->rx_indicate_seq) || - SN_EQUAL(pReorderEntry->SeqNum, pRxTs->rx_indicate_seq) ) { + if (SN_LESS(pReorderEntry->SeqNum, pRxTs->rx_indicate_seq) || + SN_EQUAL(pReorderEntry->SeqNum, pRxTs->rx_indicate_seq)) { list_del_init(&pReorderEntry->List); - if(SN_EQUAL(pReorderEntry->SeqNum, pRxTs->rx_indicate_seq)) + if (SN_EQUAL(pReorderEntry->SeqNum, pRxTs->rx_indicate_seq)) pRxTs->rx_indicate_seq = (pRxTs->rx_indicate_seq + 1) % 4096; IEEE80211_DEBUG(IEEE80211_DL_REORDER, "RxPktPendingTimeout(): IndicateSeq: %d\n", pReorderEntry->SeqNum); @@ -63,12 +63,12 @@ static void RxPktPendingTimeout(struct timer_list *t) } } - if(index>0) { + if (index>0) { // Set rx_timeout_indicate_seq to 0xffff to indicate no pending packets in buffer now. pRxTs->rx_timeout_indicate_seq = 0xffff; // Indicate packets - if(index > REORDER_WIN_SIZE) { + if (index > REORDER_WIN_SIZE) { IEEE80211_DEBUG(IEEE80211_DL_ERR, "RxReorderIndicatePacket(): Rx Reorder buffer full!! \n"); spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); return; @@ -76,7 +76,7 @@ static void RxPktPendingTimeout(struct timer_list *t) ieee80211_indicate_packets(ieee, ieee->stats_IndicateArray, index); } - if(bPktInBuf && (pRxTs->rx_timeout_indicate_seq == 0xffff)) { + if (bPktInBuf && (pRxTs->rx_timeout_indicate_seq == 0xffff)) { pRxTs->rx_timeout_indicate_seq = pRxTs->rx_indicate_seq; mod_timer(&pRxTs->rx_pkt_pending_timer, jiffies + msecs_to_jiffies(ieee->pHTInfo->RxReorderPendingTime)); @@ -141,7 +141,7 @@ void TSInitialize(struct ieee80211_device *ieee) INIT_LIST_HEAD(&ieee->Tx_TS_Pending_List); INIT_LIST_HEAD(&ieee->Tx_TS_Unused_List); - for(count = 0; count < TOTAL_TS_NUM; count++) { + for (count = 0; count < TOTAL_TS_NUM; count++) { // pTxTS->num = count; // The timers for the operation of Traffic Stream and Block Ack. @@ -164,7 +164,7 @@ void TSInitialize(struct ieee80211_device *ieee) INIT_LIST_HEAD(&ieee->Rx_TS_Admit_List); INIT_LIST_HEAD(&ieee->Rx_TS_Pending_List); INIT_LIST_HEAD(&ieee->Rx_TS_Unused_List); - for(count = 0; count < TOTAL_TS_NUM; count++) { + for (count = 0; count < TOTAL_TS_NUM; count++) { pRxTS->num = count; INIT_LIST_HEAD(&pRxTS->rx_pending_pkt_list); timer_setup(&pRxTS->ts_common_info.setup_timer, TsSetupTimeOut, @@ -181,9 +181,9 @@ void TSInitialize(struct ieee80211_device *ieee) // Initialize unused Rx Reorder List. INIT_LIST_HEAD(&ieee->RxReorder_Unused_List); //#ifdef TO_DO_LIST - for(count = 0; count < REORDER_ENTRY_NUM; count++) { - list_add_tail( &pRxReorderEntry->List,&ieee->RxReorder_Unused_List); - if(count == (REORDER_ENTRY_NUM-1)) + for (count = 0; count < REORDER_ENTRY_NUM; count++) { + list_add_tail(&pRxReorderEntry->List,&ieee->RxReorder_Unused_List); + if (count == (REORDER_ENTRY_NUM-1)) break; pRxReorderEntry = &ieee->RxReorderEntry[count+1]; } @@ -196,7 +196,7 @@ static void AdmitTS(struct ieee80211_device *ieee, del_timer_sync(&pTsCommonInfo->setup_timer); del_timer_sync(&pTsCommonInfo->inact_timer); - if(InactTime!=0) + if (InactTime!=0) mod_timer(&pTsCommonInfo->inact_timer, jiffies + msecs_to_jiffies(InactTime)); } @@ -211,21 +211,21 @@ static struct ts_common_info *SearchAdmitTRStream(struct ieee80211_device *ieee, bool search_dir[4] = {0}; struct list_head *psearch_list; //FIXME struct ts_common_info *pRet = NULL; - if(ieee->iw_mode == IW_MODE_MASTER) { //ap mode - if(TxRxSelect == TX_DIR) { + if (ieee->iw_mode == IW_MODE_MASTER) { //ap mode + if (TxRxSelect == TX_DIR) { search_dir[DIR_DOWN] = true; search_dir[DIR_BI_DIR]= true; } else { search_dir[DIR_UP] = true; search_dir[DIR_BI_DIR]= true; } - } else if(ieee->iw_mode == IW_MODE_ADHOC) { + } else if (ieee->iw_mode == IW_MODE_ADHOC) { if(TxRxSelect == TX_DIR) search_dir[DIR_UP] = true; else search_dir[DIR_DOWN] = true; } else { - if(TxRxSelect == TX_DIR) { + if (TxRxSelect == TX_DIR) { search_dir[DIR_UP] = true; search_dir[DIR_BI_DIR]= true; search_dir[DIR_DIRECT]= true; @@ -236,29 +236,29 @@ static struct ts_common_info *SearchAdmitTRStream(struct ieee80211_device *ieee, } } - if(TxRxSelect == TX_DIR) + if (TxRxSelect == TX_DIR) psearch_list = &ieee->Tx_TS_Admit_List; else psearch_list = &ieee->Rx_TS_Admit_List; //for(dir = DIR_UP; dir <= DIR_BI_DIR; dir++) - for(dir = 0; dir <= DIR_BI_DIR; dir++) { + for (dir = 0; dir <= DIR_BI_DIR; dir++) { if (!search_dir[dir]) continue; - list_for_each_entry(pRet, psearch_list, list){ + list_for_each_entry(pRet, psearch_list, list) { // IEEE80211_DEBUG(IEEE80211_DL_TS, "ADD:%pM, TID:%d, dir:%d\n", pRet->Addr, pRet->TSpec.ts_info.ucTSID, pRet->TSpec.ts_info.ucDirection); if (memcmp(pRet->addr, Addr, 6) == 0) if (pRet->t_spec.ts_info.uc_tsid == TID) - if(pRet->t_spec.ts_info.uc_direction == dir) { + if (pRet->t_spec.ts_info.uc_direction == dir) { // printk("Bingo! got it\n"); break; } } - if(&pRet->list != psearch_list) + if (&pRet->list != psearch_list) break; } - if(&pRet->list != psearch_list) + if (&pRet->list != psearch_list) return pRet ; else return NULL; @@ -270,15 +270,15 @@ static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *Addr, { u8 count; - if(pTsCommonInfo == NULL) + if (pTsCommonInfo == NULL) return; memcpy(pTsCommonInfo->addr, Addr, 6); - if(pTSPEC != NULL) + if (pTSPEC != NULL) memcpy((u8 *)(&(pTsCommonInfo->t_spec)), (u8 *)pTSPEC, sizeof(struct tspec_body)); - for(count = 0; count < TCLAS_Num; count++) + for (count = 0; count < TCLAS_Num; count++) memcpy((u8 *)(&(pTsCommonInfo->t_class[count])), (u8 *)pTCLAS, sizeof(union qos_tclas)); pTsCommonInfo->t_clas_proc = TCLAS_Proc; @@ -342,7 +342,7 @@ bool GetTs( Addr, UP, TxRxSelect); - if(*ppTS != NULL) { + if (*ppTS != NULL) { return true; } else { if (!bAddNewTs) { @@ -416,14 +416,14 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info * del_timer_sync(&pTs->inact_timer); TsInitDelBA(ieee, pTs, TxRxSelect); - if(TxRxSelect == RX_DIR) { + if (TxRxSelect == RX_DIR) { //#ifdef TO_DO_LIST struct rx_reorder_entry *pRxReorderEntry; struct rx_ts_record *pRxTS = (struct rx_ts_record *)pTs; - if(timer_pending(&pRxTS->rx_pkt_pending_timer)) + if (timer_pending(&pRxTS->rx_pkt_pending_timer)) del_timer_sync(&pRxTS->rx_pkt_pending_timer); - while(!list_empty(&pRxTS->rx_pending_pkt_list)) { + while (!list_empty(&pRxTS->rx_pending_pkt_list)) { spin_lock_irqsave(&(ieee->reorder_spinlock), flags); //pRxReorderEntry = list_entry(&pRxTS->rx_pending_pkt_list.prev,RX_REORDER_ENTRY,List); pRxReorderEntry = list_entry(pRxTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List); @@ -522,9 +522,9 @@ void RemoveAllTS(struct ieee80211_device *ieee) void TsStartAddBaProcess(struct ieee80211_device *ieee, struct tx_ts_record *pTxTS) { - if(!pTxTS->add_ba_req_in_progress) { + if (!pTxTS->add_ba_req_in_progress) { pTxTS->add_ba_req_in_progress = true; - if(pTxTS->add_ba_req_delayed) { + if (pTxTS->add_ba_req_delayed) { IEEE80211_DEBUG(IEEE80211_DL_BA, "TsStartAddBaProcess(): Delayed Start ADDBA after 60 sec!!\n"); mod_timer(&pTxTS->ts_add_ba_timer, jiffies + msecs_to_jiffies(TS_ADDBA_DELAY)); -- cgit From fe77a268cbaf6065d8ec69f7dc4b85fb5b7b4877 Mon Sep 17 00:00:00 2001 From: Sanjana Sanikommu Date: Tue, 19 Mar 2019 18:04:18 +0530 Subject: Staging: rtl8192u: r8180_93cx6.c: Fix space around '<<'. Fix the check as per Linux kernel style for use of spaces. Issue found by checkpatch.pl CHECK:spaces preffered around that '<<' Signed-off-by: Sanjana Sanikommu Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/r8180_93cx6.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c b/drivers/staging/rtl8192u/r8180_93cx6.c index c414efc0662e..163daed789b4 100644 --- a/drivers/staging/rtl8192u/r8180_93cx6.c +++ b/drivers/staging/rtl8192u/r8180_93cx6.c @@ -125,21 +125,21 @@ int eprom_read(struct net_device *dev, u32 addr) if (priv->epromtype == EPROM_93c56) { addr_str[7] = addr & 1; - addr_str[6] = addr & (1<<1); - addr_str[5] = addr & (1<<2); - addr_str[4] = addr & (1<<3); - addr_str[3] = addr & (1<<4); - addr_str[2] = addr & (1<<5); - addr_str[1] = addr & (1<<6); - addr_str[0] = addr & (1<<7); + addr_str[6] = addr & (1 << 1); + addr_str[5] = addr & (1 << 2); + addr_str[4] = addr & (1 << 3); + addr_str[3] = addr & (1 << 4); + addr_str[2] = addr & (1 << 5); + addr_str[1] = addr & (1 << 6); + addr_str[0] = addr & (1 << 7); addr_len = 8; } else { addr_str[5] = addr & 1; - addr_str[4] = addr & (1<<1); - addr_str[3] = addr & (1<<2); - addr_str[2] = addr & (1<<3); - addr_str[1] = addr & (1<<4); - addr_str[0] = addr & (1<<5); + addr_str[4] = addr & (1 << 1); + addr_str[3] = addr & (1 << 2); + addr_str[2] = addr & (1 << 3); + addr_str[1] = addr & (1 << 4); + addr_str[0] = addr & (1 << 5); addr_len = 6; } eprom_cs(dev, 1); -- cgit From f981a79eff0bfb686852a23b6362668ce5d285a9 Mon Sep 17 00:00:00 2001 From: Sanjana Sanikommu Date: Tue, 19 Mar 2019 20:53:55 +0530 Subject: staging: rtl8192u: r8192U_dm: Fix alignment issue. Ajdust alignment to match open paranthesis. Issue found by checkpatch.pl CHECK: Alignment should match open paranthesis. Signed-off-by: Sanjana Sanikommu Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/r8192U_dm.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index 6c9f9d82477d..0f1318865dd1 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -1454,7 +1454,7 @@ static void dm_CCKTxPowerAdjust_ThermalMeter(struct net_device *dev, bool bInCH rtl8192_setBBreg(dev, rCCK0_TxFilter1, bMaskHWord, TempVal); RT_TRACE(COMP_POWER_TRACKING, "CCK chnl 14, reg 0x%x = 0x%x\n", - rCCK0_TxFilter1, TempVal); + rCCK0_TxFilter1, TempVal); /* Write 0xa24 ~ 0xa27 */ TempVal = CCKSwingTable_Ch14[priv->CCK_index][2] + (CCKSwingTable_Ch14[priv->CCK_index][3]<<8) + @@ -1462,14 +1462,14 @@ static void dm_CCKTxPowerAdjust_ThermalMeter(struct net_device *dev, bool bInCH (CCKSwingTable_Ch14[priv->CCK_index][5]<<24); rtl8192_setBBreg(dev, rCCK0_TxFilter2, bMaskDWord, TempVal); RT_TRACE(COMP_POWER_TRACKING, "CCK chnl 14, reg 0x%x = 0x%x\n", - rCCK0_TxFilter2, TempVal); + rCCK0_TxFilter2, TempVal); /* Write 0xa28 0xa29 */ TempVal = CCKSwingTable_Ch14[priv->CCK_index][6] + (CCKSwingTable_Ch14[priv->CCK_index][7]<<8); rtl8192_setBBreg(dev, rCCK0_DebugPort, bMaskLWord, TempVal); RT_TRACE(COMP_POWER_TRACKING, "CCK chnl 14, reg 0x%x = 0x%x\n", - rCCK0_DebugPort, TempVal); + rCCK0_DebugPort, TempVal); } } @@ -1520,7 +1520,7 @@ void dm_restore_dynamic_mechanism_state(struct net_device *dev) return; /* TODO: Only 11n mode is implemented currently, */ if (!(priv->ieee80211->mode == WIRELESS_MODE_N_24G || - priv->ieee80211->mode == WIRELESS_MODE_N_5G)) + priv->ieee80211->mode == WIRELESS_MODE_N_5G)) return; { @@ -1751,7 +1751,7 @@ static void dm_ctrl_initgain_byrssi_by_fwfalse_alarm( /* For smooth, we can not change DIG state. */ if ((priv->undecorated_smoothed_pwdb > dm_digtable.rssi_low_thresh) && - (priv->undecorated_smoothed_pwdb < dm_digtable.rssi_high_thresh)) + (priv->undecorated_smoothed_pwdb < dm_digtable.rssi_high_thresh)) return; /*DbgPrint("Dig by Fw False Alarm\n");*/ @@ -1814,7 +1814,7 @@ static void dm_ctrl_initgain_byrssi_by_fwfalse_alarm( u8 reset_flag = 0; if (dm_digtable.dig_state == DM_STA_DIG_ON && - (priv->reset_count == reset_cnt)) { + (priv->reset_count == reset_cnt)) { dm_ctrl_initgain_byrssi_highpwr(dev); return; } @@ -1912,7 +1912,7 @@ static void dm_ctrl_initgain_byrssi_highpwr( */ if (priv->undecorated_smoothed_pwdb >= dm_digtable.rssi_high_power_highthresh) { if (dm_digtable.dig_highpwr_state == DM_STA_DIG_ON && - (priv->reset_count == reset_cnt_highpwr)) + (priv->reset_count == reset_cnt_highpwr)) return; dm_digtable.dig_highpwr_state = DM_STA_DIG_ON; @@ -1928,7 +1928,7 @@ static void dm_ctrl_initgain_byrssi_highpwr( write_nic_byte(dev, rOFDM0_RxDetector1, 0x43); } else { if (dm_digtable.dig_highpwr_state == DM_STA_DIG_OFF && - (priv->reset_count == reset_cnt_highpwr)) + (priv->reset_count == reset_cnt_highpwr)) return; dm_digtable.dig_highpwr_state = DM_STA_DIG_OFF; @@ -2129,7 +2129,7 @@ static void dm_cs_ratio( { if ((dm_digtable.precs_ratio_state != dm_digtable.curcs_ratio_state) || - !initialized || force_write) { + !initialized || force_write) { /*DbgPrint("Write CS_ratio state = %d\n", DM_DigTable.CurCS_ratioState);*/ if (dm_digtable.curcs_ratio_state == DIG_CS_RATIO_LOWER) { /* Lower CS ratio for CCK. */ @@ -2646,7 +2646,7 @@ void dm_fsync_timer_callback(struct timer_list *t) bool bDoubleTimeInterval = false; if (priv->ieee80211->state == IEEE80211_LINKED && - priv->ieee80211->bfsync_enable && + priv->ieee80211->bfsync_enable && (priv->ieee80211->pHTInfo->IOTAction & HT_IOT_ACT_CDD_FSYNC)) { /* Count rate 54, MCS [7], [12, 13, 14, 15] */ u32 rate_bitmap; -- cgit From b6ed32ab49f54616d893b5f7d6112a2b0f79ee7d Mon Sep 17 00:00:00 2001 From: Sanjana Sanikommu Date: Tue, 19 Mar 2019 20:55:17 +0530 Subject: staging: rtl8192u: r8192U_dm: Fix space issue around operators. Add spaces around the operators. Issue found by checkpatch.pl CHECK: spaces preferred around that '+' CHECK: spaces preferred around that '*' Signed-off-by: Sanjana Sanikommu Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/r8192U_dm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index 0f1318865dd1..50a9fe667062 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -2936,17 +2936,17 @@ void dm_shadow_init(struct net_device *dev) for (page = 0; page < 5; page++) for (offset = 0; offset < 256; offset++) { - read_nic_byte(dev, offset+page*256, &dm_shadow[page][offset]); + read_nic_byte(dev, offset + page * 256, &dm_shadow[page][offset]); /*DbgPrint("P-%d/O-%02x=%02x\r\n", page, offset, DM_Shadow[page][offset]);*/ } for (page = 8; page < 11; page++) for (offset = 0; offset < 256; offset++) - read_nic_byte(dev, offset+page*256, &dm_shadow[page][offset]); + read_nic_byte(dev, offset + page * 256, &dm_shadow[page][offset]); for (page = 12; page < 15; page++) for (offset = 0; offset < 256; offset++) - read_nic_byte(dev, offset+page*256, &dm_shadow[page][offset]); + read_nic_byte(dev, offset + page * 256, &dm_shadow[page][offset]); } /* dm_shadow_init */ -- cgit From 993798a511621d574b772f9072a98551fd1df522 Mon Sep 17 00:00:00 2001 From: Sanjana Sanikommu Date: Tue, 19 Mar 2019 20:56:48 +0530 Subject: staging: rtl8192u: r8192U_dm: Remove unnecessary blank lines. Remove unnecessary blank lines. Issue found by checkpatch.pl Signed-off-by: Sanjana Sanikommu Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/r8192U_dm.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index 50a9fe667062..546bf5428848 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -45,17 +45,14 @@ static struct dynamic_rx_path_sel DM_RxPathSelTable; /*------------------------Define global variable-----------------------------*/ - /*------------------------Define local variable------------------------------*/ /*------------------------Define local variable------------------------------*/ - /*--------------------Define export function prototype-----------------------*/ extern void dm_check_fsync(struct net_device *dev); /*--------------------Define export function prototype-----------------------*/ - /*---------------------Define local function prototype-----------------------*/ /* DM --> Rate Adaptive */ static void dm_check_rate_adaptive(struct net_device *dev); -- cgit From c0fb0459cb0c19427fc8a9a947a46af92d4ab04e Mon Sep 17 00:00:00 2001 From: Sanjana Sanikommu Date: Tue, 19 Mar 2019 22:35:26 +0530 Subject: staging: rtl8192u: ieee80211: ieee80211_rx.c: Fix NULL comparisions. Replace NULL comparisons in the file. Issue found by checkpatch.pl Signed-off-by: Sanjana Sanikommu Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c index 6009fe0e1d4f..e3e40d183871 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c @@ -151,7 +151,7 @@ ieee80211_frag_cache_get(struct ieee80211_device *ieee, * should have already been received */ entry = ieee80211_frag_cache_find(ieee, seq, frag, tid,hdr->addr2, hdr->addr1); - if (entry != NULL) { + if (entry) { entry->last_frag = frag; skb = entry->skb; } @@ -190,7 +190,7 @@ static int ieee80211_frag_cache_invalidate(struct ieee80211_device *ieee, entry = ieee80211_frag_cache_find(ieee, seq, -1, tid, hdr->addr2, hdr->addr1); - if (entry == NULL) { + if (!entry) { IEEE80211_DEBUG_FRAG( "could not invalidate fragment cache " "entry (seq=%u)\n", seq); -- cgit From e655d23dbac83d8d5511055f0943764253fb878e Mon Sep 17 00:00:00 2001 From: Sanjana Sanikommu Date: Tue, 19 Mar 2019 23:16:28 +0530 Subject: staging: rtl8192u: ieee80211: ieee80211_tx.c: Adjust space around else. Fix the spacce around else. Issue found by checkpatch.pl ERROR: spaces required before that open brace '{' ERROR: spaces required before that close brace '}' Signed-off-by: Sanjana Sanikommu Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c index ea9c69eeceae..29ee9fd89f7b 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c @@ -851,7 +851,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) else ieee->seq_ctrl[0]++; } - }else{ + } else { if (unlikely(skb->len < sizeof(struct rtl_80211_hdr_3addr))) { printk(KERN_WARNING "%s: skb too small (%d).\n", ieee->dev->name, skb->len); -- cgit From 40a3483b194ea793e3909b0256f536b430b14532 Mon Sep 17 00:00:00 2001 From: Sanjana Sanikommu Date: Wed, 20 Mar 2019 16:46:18 +0530 Subject: staging: rtl8192u: ieee80211: ieee80211_rx.c: Remove unnecessary braces. Remove braces around single statement block. Issue found by checkpatch.pl WARNING: braces {} are not necessary for a single statement block Signed-off-by: Sanjana Sanikommu Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c index e3e40d183871..b41d20e832c8 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c @@ -598,9 +598,8 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee, return; /* Rx Reorder initialize condition.*/ - if (pTS->rx_indicate_seq == 0xffff) { + if (pTS->rx_indicate_seq == 0xffff) pTS->rx_indicate_seq = SeqNum; - } /* Drop out the packet which SeqNum is smaller than WinStart */ if (SN_LESS(SeqNum, pTS->rx_indicate_seq)) { -- cgit From 2fd37c9d4335c0b5a4c6ce382de81ccdc5a2db9e Mon Sep 17 00:00:00 2001 From: Sanjana Sanikommu Date: Wed, 20 Mar 2019 18:48:18 +0530 Subject: staging: rtl8192u: r8192U_dm: Remove unnecessary comments. Remove comments which are not necessary. Signed-off-by: Sanjana Sanikommu Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/r8192U_dm.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index 546bf5428848..2ba01041406b 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -43,17 +43,8 @@ u8 dm_shadow[16][256] = { {0} }; /* For Dynamic Rx Path Selection by Signal Strength */ static struct dynamic_rx_path_sel DM_RxPathSelTable; -/*------------------------Define global variable-----------------------------*/ - -/*------------------------Define local variable------------------------------*/ -/*------------------------Define local variable------------------------------*/ - -/*--------------------Define export function prototype-----------------------*/ extern void dm_check_fsync(struct net_device *dev); -/*--------------------Define export function prototype-----------------------*/ - -/*---------------------Define local function prototype-----------------------*/ /* DM --> Rate Adaptive */ static void dm_check_rate_adaptive(struct net_device *dev); -- cgit From 49103a816a49c6f3da420dbcab97c47038109a61 Mon Sep 17 00:00:00 2001 From: Sanjana Sanikommu Date: Tue, 26 Mar 2019 22:39:42 +0530 Subject: staging: rtl8192u: Remove typedef for struct. Challenge suggested by coccinelle. Linux kernel coding style guidelines suggest not using typedefs for structure. The following Coccinelle semantic patch detects the cases for struct type: @tn@ identifier i; type td; @@ -typedef struct i { ... } -td ; @@ type tn.td; identifier tn.i; @@ -td + struct i Signed-off-by: Sanjana Sanikommu Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index ad5a3ae14804..638cad6df1c4 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -296,7 +296,7 @@ struct cb_desc { #define ieee80211_wx_get_encode_ext ieee80211_wx_get_encode_ext_rsl -typedef struct ieee_param { +struct ieee_param { u32 cmd; u8 sta_addr[ETH_ALEN]; union { @@ -323,7 +323,7 @@ typedef struct ieee_param { u8 key[0]; } crypt; } u; -} ieee_param; +}; // linux under 2.6.9 release may not support it, so modify it for common use -- cgit From 7a4f9419eb9458b4497f6b84e1d2831cae45deda Mon Sep 17 00:00:00 2001 From: Julius Hemanth Pitti Date: Wed, 27 Mar 2019 15:40:17 -0700 Subject: staging: rtl8192u: ieee80211: ieee80211_wx: add space before open brace Fix checkpatch error "ERROR: space required before the open brace '{'" in ieee80211_wx.c. Signed-off-by: Julius Hemanth Pitti Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index fa59c712c74b..ebcc642e0215 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -195,7 +195,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, if (iwe.u.data.length) start = iwe_stream_add_point(info, start, stop, &iwe, custom); - if (ieee->wpa_enabled && network->wpa_ie_len){ + if (ieee->wpa_enabled && network->wpa_ie_len) { char buf[MAX_WPA_IE_LEN * 2 + 30]; // printk("WPA IE\n"); u8 *p = buf; @@ -210,7 +210,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, start = iwe_stream_add_point(info, start, stop, &iwe, buf); } - if (ieee->wpa_enabled && network->rsn_ie_len){ + if (ieee->wpa_enabled && network->rsn_ie_len) { char buf[MAX_WPA_IE_LEN * 2 + 30]; u8 *p = buf; @@ -766,15 +766,13 @@ int ieee80211_wx_set_auth(struct ieee80211_device *ieee, case IW_AUTH_80211_AUTH_ALG: //printk("======>%s():data->value is %d\n",__func__,data->value); // ieee->open_wep = (data->value&IW_AUTH_ALG_OPEN_SYSTEM)?1:0; - if(data->value & IW_AUTH_ALG_SHARED_KEY){ + if (data->value & IW_AUTH_ALG_SHARED_KEY) { ieee->open_wep = 0; ieee->auth_mode = 1; - } - else if(data->value & IW_AUTH_ALG_OPEN_SYSTEM){ + } else if (data->value & IW_AUTH_ALG_OPEN_SYSTEM) { ieee->open_wep = 1; ieee->auth_mode = 0; - } - else if(data->value & IW_AUTH_ALG_LEAP){ + } else if (data->value & IW_AUTH_ALG_LEAP) { ieee->open_wep = 1; ieee->auth_mode = 2; } -- cgit From 4e1a0d1142584d686f4e76063891787d45860611 Mon Sep 17 00:00:00 2001 From: Madhumitha Prabakaran Date: Thu, 28 Mar 2019 10:53:33 -0500 Subject: Staging: rtl8192u: Use BIT macro Use BIT macro, as kernel provides the macro for improving uniform and more readable way to define these constants. Issue suggested by Coccinelle. Signed-off-by: Madhumitha Prabakaran Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/r8180_93cx6.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c b/drivers/staging/rtl8192u/r8180_93cx6.c index 163daed789b4..f98bb11a66af 100644 --- a/drivers/staging/rtl8192u/r8180_93cx6.c +++ b/drivers/staging/rtl8192u/r8180_93cx6.c @@ -125,21 +125,21 @@ int eprom_read(struct net_device *dev, u32 addr) if (priv->epromtype == EPROM_93c56) { addr_str[7] = addr & 1; - addr_str[6] = addr & (1 << 1); - addr_str[5] = addr & (1 << 2); - addr_str[4] = addr & (1 << 3); - addr_str[3] = addr & (1 << 4); - addr_str[2] = addr & (1 << 5); - addr_str[1] = addr & (1 << 6); - addr_str[0] = addr & (1 << 7); + addr_str[6] = addr & BIT(1); + addr_str[5] = addr & BIT(2); + addr_str[4] = addr & BIT(3); + addr_str[3] = addr & BIT(4); + addr_str[2] = addr & BIT(5); + addr_str[1] = addr & BIT(6); + addr_str[0] = addr & BIT(7); addr_len = 8; } else { addr_str[5] = addr & 1; - addr_str[4] = addr & (1 << 1); - addr_str[3] = addr & (1 << 2); - addr_str[2] = addr & (1 << 3); - addr_str[1] = addr & (1 << 4); - addr_str[0] = addr & (1 << 5); + addr_str[4] = addr & BIT(1); + addr_str[3] = addr & BIT(2); + addr_str[2] = addr & BIT(3); + addr_str[1] = addr & BIT(4); + addr_str[0] = addr & BIT(5); addr_len = 6; } eprom_cs(dev, 1); -- cgit From bdcca44e16a2e701724ee305c265e07c36beace7 Mon Sep 17 00:00:00 2001 From: Vatsala Narang Date: Fri, 29 Mar 2019 00:39:43 +0530 Subject: staging: rtl8192u: ieee80211: Use !x in place of NULL comparison Change NULL comparison to Boolean negation.Issue found using Coccinelle Semantic patch used to solve the problem is as follows: @replace_rule@ expression e; @@ - e == NULL + !e Signed-off-by: Vatsala Narang Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c index b41d20e832c8..b7316b21565f 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c @@ -341,7 +341,7 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, struct sk_buff *skb, struct rtl_80211_hdr_4addr *hdr; int res, hdrlen; - if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL) + if (!crypt || !crypt->ops->decrypt_mpdu) return 0; if (ieee->hwsec_active) { @@ -388,7 +388,7 @@ ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device *ieee, struct sk_buff *s struct rtl_80211_hdr_4addr *hdr; int res, hdrlen; - if (crypt == NULL || crypt->ops->decrypt_msdu == NULL) + if (!crypt || !crypt->ops->decrypt_msdu) return 0; if (ieee->hwsec_active) { @@ -982,8 +982,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, /* allow NULL decrypt to indicate an station specific override * for default encryption */ - if (crypt && (crypt->ops == NULL || - crypt->ops->decrypt_mpdu == NULL)) + if (crypt && (!crypt->ops || !crypt->ops->decrypt_mpdu)) crypt = NULL; if (!crypt && (fc & IEEE80211_FCTL_WEP)) { @@ -1284,7 +1283,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, } //added by amy for reorder - if (!ieee->pHTInfo->bCurRxReorderEnable || pTS == NULL){ + if (!ieee->pHTInfo->bCurRxReorderEnable || !pTS) { //added by amy for reorder for(i = 0; inr_subframes; i++) { struct sk_buff *sub_skb = rxb->subframes[i]; @@ -1420,9 +1419,9 @@ static int ieee80211_read_qos_info_element(struct int ret = 0; u16 size = sizeof(struct ieee80211_qos_information_element) - 2; - if (element_info == NULL) + if (!element_info) return -1; - if (info_element == NULL) + if (!info_element) return -1; if ((info_element->id == QOS_ELEMENT_ID) && (info_element->len == size)) { -- cgit From d247b0357fa61814b8be8a61a2a68b9e1520083c Mon Sep 17 00:00:00 2001 From: Madhumitha Prabakaran Date: Fri, 29 Mar 2019 11:55:29 -0500 Subject: Staging: rtl8192u: ieee80211: Remove custom macro IEEE80211_DEBUG Remove the custom macro IEEE80211_DEBUG for printing message in dev_alloc_skb in order to maintain Linux kernel coding style based on which kernel does not print failure warning. Issue suggested by Coccinelle Signed-off-by: Madhumitha Prabakaran Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c index 109445407cec..af396c53a929 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c @@ -118,10 +118,8 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, s return NULL; } skb = dev_alloc_skb(len + sizeof(struct rtl_80211_hdr_3addr)); //need to add something others? FIXME - if (!skb) { - IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc skb for ADDBA_REQ\n"); + if (!skb) return NULL; - } memset(skb->data, 0, sizeof(struct rtl_80211_hdr_3addr)); //I wonder whether it's necessary. Apparently kernel will not do it when alloc a skb. skb_reserve(skb, ieee->tx_headroom); @@ -205,10 +203,8 @@ static struct sk_buff *ieee80211_DELBA( DelbaParamSet.field.tid = pBA->param_set.field.tid; skb = dev_alloc_skb(len + sizeof(struct rtl_80211_hdr_3addr)); //need to add something others? FIXME - if (!skb) { - IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc skb for ADDBA_REQ\n"); + if (!skb) return NULL; - } // memset(skb->data, 0, len+sizeof( struct rtl_80211_hdr_3addr)); skb_reserve(skb, ieee->tx_headroom); -- cgit From 9361076277c04720a4e546d076b0effc3feef1e1 Mon Sep 17 00:00:00 2001 From: Payal Kshirsagar Date: Tue, 2 Apr 2019 18:58:32 +0530 Subject: staging: rtl8192u: ieee80211: ieee80211_rx.c: Replace bit shifting with BIT macro Challenge suggested by coccinelle. Prefer using BIT and replace bit shifting with the BIT(x) macro. Signed-off-by: Payal Kshirsagar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 32 +++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c index b7316b21565f..ed01ac0a14c5 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c @@ -2397,22 +2397,22 @@ static inline void ieee80211_process_probe_response( "'%s' (%pM): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n", escape_essid(info_element->data, info_element->len), beacon->header.addr3, - (capability & (1 << 0xf)) ? '1' : '0', - (capability & (1 << 0xe)) ? '1' : '0', - (capability & (1 << 0xd)) ? '1' : '0', - (capability & (1 << 0xc)) ? '1' : '0', - (capability & (1 << 0xb)) ? '1' : '0', - (capability & (1 << 0xa)) ? '1' : '0', - (capability & (1 << 0x9)) ? '1' : '0', - (capability & (1 << 0x8)) ? '1' : '0', - (capability & (1 << 0x7)) ? '1' : '0', - (capability & (1 << 0x6)) ? '1' : '0', - (capability & (1 << 0x5)) ? '1' : '0', - (capability & (1 << 0x4)) ? '1' : '0', - (capability & (1 << 0x3)) ? '1' : '0', - (capability & (1 << 0x2)) ? '1' : '0', - (capability & (1 << 0x1)) ? '1' : '0', - (capability & (1 << 0x0)) ? '1' : '0'); + (capability & BIT(0xf)) ? '1' : '0', + (capability & BIT(0xe)) ? '1' : '0', + (capability & BIT(0xd)) ? '1' : '0', + (capability & BIT(0xc)) ? '1' : '0', + (capability & BIT(0xb)) ? '1' : '0', + (capability & BIT(0xa)) ? '1' : '0', + (capability & BIT(0x9)) ? '1' : '0', + (capability & BIT(0x8)) ? '1' : '0', + (capability & BIT(0x7)) ? '1' : '0', + (capability & BIT(0x6)) ? '1' : '0', + (capability & BIT(0x5)) ? '1' : '0', + (capability & BIT(0x4)) ? '1' : '0', + (capability & BIT(0x3)) ? '1' : '0', + (capability & BIT(0x2)) ? '1' : '0', + (capability & BIT(0x1)) ? '1' : '0', + (capability & BIT(0x0)) ? '1' : '0'); if (ieee80211_network_init(ieee, beacon, network, stats)) { IEEE80211_DEBUG_SCAN("Dropped '%s' (%pM) via %s.\n", -- cgit From 9f383969ae908d48f52ba61403734858a6dc674f Mon Sep 17 00:00:00 2001 From: Payal Kshirsagar Date: Tue, 2 Apr 2019 18:58:33 +0530 Subject: staging: rtl8192u: ieee80211: ieee80211_crypt_ccmp.c: Replace bit shifting with BIT macro Challenge suggested by coccinelle. Prefer using BIT and replace bit shifting with the BIT(x) macro. Signed-off-by: Payal Kshirsagar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c index 3534ddb900d1..e154df823a95 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c @@ -216,7 +216,7 @@ static int ieee80211_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv) *pos++ = key->tx_pn[5]; *pos++ = key->tx_pn[4]; *pos++ = 0; - *pos++ = (key->key_idx << 6) | (1 << 5) /* Ext IV included */; + *pos++ = (key->key_idx << 6) | BIT(5) /* Ext IV included */; *pos++ = key->tx_pn[3]; *pos++ = key->tx_pn[2]; *pos++ = key->tx_pn[1]; @@ -274,7 +274,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv) hdr = (struct rtl_80211_hdr_4addr *)skb->data; pos = skb->data + hdr_len; keyidx = pos[3]; - if (!(keyidx & (1 << 5))) { + if (!(keyidx & BIT(5))) { if (net_ratelimit()) { netdev_dbg(skb->dev, "CCMP: received packet without ExtIV flag from %pM\n", hdr->addr2); -- cgit From 37b299c7c49acffa675c61018132e6de4f88a1ed Mon Sep 17 00:00:00 2001 From: Payal Kshirsagar Date: Tue, 2 Apr 2019 18:58:34 +0530 Subject: staging: rtl8192u: ieee80211: ieee80211_crypt_tkip.c: Replace bit shifting with BIT macro Challenge suggested by coccinelle. Prefer using BIT and replace bit shifting with the BIT(x) macro. Signed-off-by: Payal Kshirsagar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c index 829fa4bd253c..320c179c9a4f 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c @@ -331,7 +331,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) *pos++ = rc4key[2]; } - *pos++ = (tkey->key_idx << 6) | (1 << 5) /* Ext IV included */; + *pos++ = (tkey->key_idx << 6) | BIT(5) /* Ext IV included */; *pos++ = tkey->tx_iv32 & 0xff; *pos++ = (tkey->tx_iv32 >> 8) & 0xff; *pos++ = (tkey->tx_iv32 >> 16) & 0xff; @@ -390,7 +390,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) hdr = (struct rtl_80211_hdr_4addr *) skb->data; pos = skb->data + hdr_len; keyidx = pos[3]; - if (!(keyidx & (1 << 5))) { + if (!(keyidx & BIT(5))) { if (net_ratelimit()) { printk(KERN_DEBUG "TKIP: received packet without ExtIV" " flag from %pM\n", hdr->addr2); -- cgit From 99b75a4e3275e85814db0fa2f49274bd3d5359d3 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 2 Apr 2019 12:31:48 +0200 Subject: staging: add missing SPDX lines to Kconfig files There are a few remaining drivers/staging/*/Kconfig files that do not have SPDX identifiers in them. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/Kconfig b/drivers/staging/rtl8192u/Kconfig index 97df6507a485..22c2165e8b1c 100644 --- a/drivers/staging/rtl8192u/Kconfig +++ b/drivers/staging/rtl8192u/Kconfig @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 config RTL8192U tristate "RealTek RTL8192U Wireless LAN NIC driver" depends on PCI && WLAN && USB -- cgit From 21baa36d92a0264347d916d8377e420f09bbb5b7 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 2 Apr 2019 12:31:56 +0200 Subject: staging: rtl8192u: add proper SPDX identifiers on files that did not have them. There were a few files for the rtl8192u driver that did not have SPDX identifiers on them, so fix that up. At the same time, remove the "free form" text that specified the license of the file, as that is impossible for any tool to properly parse. Cc: John Whitmore Cc: Bhanusree Pola Cc: Sanjana Sanikommu Cc: Jia-Ju Bai Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 6 +----- drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c | 7 +------ drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.h | 6 +----- .../staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | 6 +----- .../staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 6 +----- .../staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c | 6 +----- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 6 +----- drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 3 +-- .../staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 3 +-- drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c | 17 +---------------- drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 17 +---------------- drivers/staging/rtl8192u/r8180_93cx6.c | 2 +- drivers/staging/rtl8192u/r8190_rtl8256.c | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 16 +--------------- drivers/staging/rtl8192u/r8192U_hw.h | 2 +- drivers/staging/rtl8192u/r8192U_wx.c | 2 +- drivers/staging/rtl8192u/r8192U_wx.h | 2 +- 17 files changed, 17 insertions(+), 92 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index 638cad6df1c4..d36963469015 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Merged with mainline ieee80211.h in Aug 2004. Original ieee802_11 * remains copyright by the original authors @@ -15,11 +16,6 @@ * * Modified for Realtek's wi-fi cards by Andrea Merello * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. See README and COPYING for - * more details. */ #ifndef IEEE80211_H #define IEEE80211_H diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c index 6f457812e5a3..36987fccac5d 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c @@ -1,14 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Host AP crypto routines * * Copyright (c) 2002-2003, Jouni Malinen * Portions Copyright (C) 2004, Intel Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. See README and COPYING for - * more details. - * */ #include diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.h b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.h index 1f2aea7e0e55..d3bd5598b25b 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Original code based on Host AP (software wireless LAN access point) driver * for Intersil Prism2/2.5/3. @@ -10,11 +11,6 @@ * * * Copyright (c) 2004, Intel Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. See README and COPYING for - * more details. */ /* diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c index e154df823a95..d7188b3f3190 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c @@ -1,12 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Host AP crypt: host-based CCMP encryption implementation for Host AP driver * * Copyright (c) 2003-2004, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. See README and COPYING for - * more details. */ #include diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c index 320c179c9a4f..5dca4b9a6007 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c @@ -1,12 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Host AP crypt: host-based TKIP encryption implementation for Host AP driver * * Copyright (c) 2003-2004, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. See README and COPYING for - * more details. */ #include diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c index d4a1bf0caa7a..805493a0870d 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c @@ -1,12 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Host AP crypt: host-based WEP encryption implementation for Host AP driver * * Copyright (c) 2002-2004, Jouni Malinen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. See README and COPYING for - * more details. */ #include diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c index ed01ac0a14c5..0e762e559675 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Original code based Host AP (software wireless LAN access point) driver * for Intersil Prism2/2.5/3 - hostap.o module, common routines @@ -6,11 +7,6 @@ * * Copyright (c) 2002-2003, Jouni Malinen * Copyright (c) 2004, Intel Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. See README and COPYING for - * more details. ****************************************************************************** Few modifications for Realtek's Wi-Fi drivers by diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index 8635faf84316..944c8894f9ff 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* IEEE 802.11 SoftMAC layer * Copyright (c) 2005 Andrea Merello * @@ -9,8 +10,6 @@ * * WPA code stolen from the ipw2200 driver. * Copyright who own it's copyright. - * - * released under the GPL */ #include "ieee80211.h" diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c index 81020fbcdc20..aab1586fe0dd 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* IEEE 802.11 SoftMAC layer * Copyright (c) 2005 Andrea Merello * @@ -9,8 +10,6 @@ * * PS wx handler mostly stolen from hostap, copyright who * own it's copyright ;-) - * - * released under the GPL */ diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c index 29ee9fd89f7b..8e1ec4409b4f 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c @@ -1,23 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0 /****************************************************************************** * * Copyright(c) 2003 - 2004 Intel Corporation. All rights reserved. * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 - * Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The full GNU General Public License is included in this distribution in the - * file called LICENSE. - * * Contact Information: * James P. Ketrenos * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index ebcc642e0215..90c7ab2189cc 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /****************************************************************************** Copyright(c) 2004 Intel Corporation. All rights reserved. @@ -8,22 +9,6 @@ Copyright (c) 2002-2003, Jouni Malinen - This program is free software; you can redistribute it and/or modify it - under the terms of version 2 of the GNU General Public License as - published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 59 - Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - The full GNU General Public License is included in this distribution in the - file called LICENSE. - Contact Information: James P. Ketrenos Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c b/drivers/staging/rtl8192u/r8180_93cx6.c index f98bb11a66af..de83daa0c9ed 100644 --- a/drivers/staging/rtl8192u/r8180_93cx6.c +++ b/drivers/staging/rtl8192u/r8180_93cx6.c @@ -1,10 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0 /* * This files contains card eeprom (93c46 or 93c56) programming routines, * memory is addressed by 16 bits words. * * This is part of rtl8180 OpenSource driver. * Copyright (C) Andrea Merello 2004 - * Released under the terms of GPL (General Public Licence) * * Parts of this driver are based on the GPL part of the * official realtek driver. diff --git a/drivers/staging/rtl8192u/r8190_rtl8256.c b/drivers/staging/rtl8192u/r8190_rtl8256.c index a8c8e8c0660d..92de92a3325a 100644 --- a/drivers/staging/rtl8192u/r8190_rtl8256.c +++ b/drivers/staging/rtl8192u/r8190_rtl8256.c @@ -1,6 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0 /* * This is part of the rtl8192 driver - * released under the GPL (See file COPYING for details). * * This files contains programming code for the rtl8256 * radio frontend. diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index f1eaab337dca..4065a4710142 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -1,24 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0 /****************************************************************************** * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved. * Linux device driver for RTL8192U * * Based on the r8187 driver, which is: * Copyright 2004-2005 Andrea Merello , et al. - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * The full GNU General Public License is included in this distribution in the - * file called LICENSE. * * Contact Information: * Jerry chuang diff --git a/drivers/staging/rtl8192u/r8192U_hw.h b/drivers/staging/rtl8192u/r8192U_hw.h index 5a958335681d..95a2d2ee3c65 100644 --- a/drivers/staging/rtl8192u/r8192U_hw.h +++ b/drivers/staging/rtl8192u/r8192U_hw.h @@ -1,7 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This is part of rtl8187 OpenSource driver. * Copyright (C) Andrea Merello 2004-2005 - * Released under the terms of GPL (General Public Licence) * * Parts of this driver are based on the GPL part of the * official Realtek driver. diff --git a/drivers/staging/rtl8192u/r8192U_wx.c b/drivers/staging/rtl8192u/r8192U_wx.c index e4e6c979bedf..5822bb7984b9 100644 --- a/drivers/staging/rtl8192u/r8192U_wx.c +++ b/drivers/staging/rtl8192u/r8192U_wx.c @@ -1,10 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0 /****************************************************************************** * * This file contains wireless extension handlers. * * This is part of rtl8180 OpenSource driver. * Copyright (C) Andrea Merello 2004-2005 - * Released under the terms of GPL (General Public Licence) * * Parts of this driver are based on the GPL part * of the official realtek driver. diff --git a/drivers/staging/rtl8192u/r8192U_wx.h b/drivers/staging/rtl8192u/r8192U_wx.h index a6c2b95e2e69..27423cd64b4c 100644 --- a/drivers/staging/rtl8192u/r8192U_wx.h +++ b/drivers/staging/rtl8192u/r8192U_wx.h @@ -1,7 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This is part of rtl8180 OpenSource driver - v 0.3 * Copyright (C) Andrea Merello 2004 - * Released under the terms of GPL (General Public Licence) * * Parts of this driver are based on the GPL part of the official realtek driver * Parts of this driver are based on the rtl8180 driver skeleton from Patric -- cgit From 9e6aac6796a721ed05ca62b17c210198f072d2c1 Mon Sep 17 00:00:00 2001 From: Gabriel Siqueira Date: Thu, 4 Apr 2019 14:19:07 -0300 Subject: staging: rtl8192u: Add missing space Fix checkpatch error: "ERROR: space required after that close brace '}'". Signed-off-by: Gabriel Siqueira Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index 64d5359cf7e2..b7769bca9740 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -107,13 +107,13 @@ typedef struct _HT_INFORMATION_ELE { typedef enum _HT_SPEC_VER { HT_SPEC_VER_IEEE = 0, HT_SPEC_VER_EWC = 1, -}HT_SPEC_VER, *PHT_SPEC_VER; +} HT_SPEC_VER, *PHT_SPEC_VER; typedef enum _HT_AGGRE_MODE_E { HT_AGG_AUTO = 0, HT_AGG_FORCE_ENABLE = 1, HT_AGG_FORCE_DISABLE = 2, -}HT_AGGRE_MODE_E, *PHT_AGGRE_MODE_E; +} HT_AGGRE_MODE_E, *PHT_AGGRE_MODE_E; /* * The Data structure is used to keep HT related variables when card is -- cgit From cd62878c9d6f2c1b0ec213bc43804ae56f7f2742 Mon Sep 17 00:00:00 2001 From: Caio Salvador Rohwedder Date: Thu, 4 Apr 2019 22:56:46 -0300 Subject: staging: rtl8192u: ieee80211: add space around '==' and before '(' Fix checkpatch coding style errors on rtl819x_TSProc.c - space required before the open parenthesis '(' - spaces required around that '==' Signed-off-by: Caio Salvador Rohwedder Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c index 4bb6c32b9bf0..418c92403904 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c @@ -373,7 +373,7 @@ bool GetTs( if(!list_empty(pUnusedList)) { (*ppTS) = list_entry(pUnusedList->next, struct ts_common_info, list); list_del_init(&(*ppTS)->list); - if(TxRxSelect==TX_DIR) { + if (TxRxSelect == TX_DIR) { struct tx_ts_record *tmp = container_of(*ppTS, struct tx_ts_record, ts_common_info); ResetTxTsEntry(tmp); } else { -- cgit From 8dd4305041250898bc1d664d0a285469073ed962 Mon Sep 17 00:00:00 2001 From: Vatsala Narang Date: Fri, 26 Apr 2019 14:12:01 +0530 Subject: staging: rtl8192u: ieee80211: Replace bit shifting with BIT macro Change suggested by coccinelle. Replace bit shifting on 1 with the BIT(x) macro. Coccinelle script: @@ expression c; @@ -(1 << c) +BIT(c) Signed-off-by: Vatsala Narang Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index 90c7ab2189cc..644282ca4a9d 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -71,7 +71,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, /* Add the protocol name */ iwe.cmd = SIOCGIWNAME; for(i=0; imode&(1<mode & BIT(i)) { sprintf(pname,ieee80211_modes[i].mode_string,ieee80211_modes[i].mode_size); pname +=ieee80211_modes[i].mode_size; } @@ -379,7 +379,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, sec.key_sizes[key] = len; (*crypt)->ops->set_key(sec.keys[key], len, NULL, (*crypt)->priv); - sec.flags |= (1 << key); + sec.flags |= BIT(key); /* This ensures a key will be activated if no key is * explicitely set */ if (key == sec.active_key) @@ -400,7 +400,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, (*crypt)->ops->set_key(sec.keys[key], 13, NULL, (*crypt)->priv); sec.key_sizes[key] = 13; - sec.flags |= (1 << key); + sec.flags |= BIT(key); } /* No key data - just set the default TX key index */ @@ -621,7 +621,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, if (ext->alg != IW_ENCODE_ALG_NONE) { //memcpy(sec.keys[idx], ext->key, ext->key_len); sec.key_sizes[idx] = ext->key_len; - sec.flags |= (1 << idx); + sec.flags |= BIT(idx); if (ext->alg == IW_ENCODE_ALG_WEP) { // sec.encode_alg[idx] = SEC_ALG_WEP; sec.flags |= SEC_LEVEL; -- cgit From 41dff4d6b8e2af7687e626df4f149dd26c130b43 Mon Sep 17 00:00:00 2001 From: Vatsala Narang Date: Fri, 26 Apr 2019 14:13:03 +0530 Subject: staging: rtl8192u: ieee80211: Fix spelling mistake Replace explicitely with explicitly to get rid of checkpatch warning. Signed-off-by: Vatsala Narang Acked-by: Gustavo A. R. Silva Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index 644282ca4a9d..dead134f6de0 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -381,7 +381,8 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, (*crypt)->priv); sec.flags |= BIT(key); /* This ensures a key will be activated if no key is - * explicitely set */ + * explicitly set + */ if (key == sec.active_key) sec.flags |= SEC_ACTIVE_KEY; ieee->tx_keyidx = key; -- cgit From 0580db2cb6b300708f5f3dca8b8fa79b04433037 Mon Sep 17 00:00:00 2001 From: Vandana BN Date: Tue, 30 Apr 2019 23:59:44 +0530 Subject: staging: rtl8192u: ieee80211: Resolve ERROR reported by checkpatch This patch resolves coding style space ERRORs reported by checkpatch ERROR: spaces required around that '>' (ctx:VxV) ERROR: space required after that ',' (ctx:VxO) ERROR: space required before that '&' (ctx:OxV) ERROR: spaces required around that '!=' (ctx:VxV) ERROR: spaces required around that '=' (ctx:VxW) ERROR: space required before the open parenthesis '(' ERROR: spaces required around that '?' (ctx:VxE) ERROR: spaces required around that ':' (ctx:VxE) ERROR: spaces required around that '==' (ctx:VxV) Signed-off-by: Vandana BN Signed-off-by: Greg Kroah-Hartman --- .../staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c index 418c92403904..7cac668bfb0b 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c @@ -63,7 +63,7 @@ static void RxPktPendingTimeout(struct timer_list *t) } } - if (index>0) { + if (index > 0) { // Set rx_timeout_indicate_seq to 0xffff to indicate no pending packets in buffer now. pRxTs->rx_timeout_indicate_seq = 0xffff; @@ -182,7 +182,7 @@ void TSInitialize(struct ieee80211_device *ieee) INIT_LIST_HEAD(&ieee->RxReorder_Unused_List); //#ifdef TO_DO_LIST for (count = 0; count < REORDER_ENTRY_NUM; count++) { - list_add_tail(&pRxReorderEntry->List,&ieee->RxReorder_Unused_List); + list_add_tail(&pRxReorderEntry->List, &ieee->RxReorder_Unused_List); if (count == (REORDER_ENTRY_NUM-1)) break; pRxReorderEntry = &ieee->RxReorderEntry[count+1]; @@ -196,7 +196,7 @@ static void AdmitTS(struct ieee80211_device *ieee, del_timer_sync(&pTsCommonInfo->setup_timer); del_timer_sync(&pTsCommonInfo->inact_timer); - if (InactTime!=0) + if (InactTime != 0) mod_timer(&pTsCommonInfo->inact_timer, jiffies + msecs_to_jiffies(InactTime)); } @@ -214,25 +214,25 @@ static struct ts_common_info *SearchAdmitTRStream(struct ieee80211_device *ieee, if (ieee->iw_mode == IW_MODE_MASTER) { //ap mode if (TxRxSelect == TX_DIR) { search_dir[DIR_DOWN] = true; - search_dir[DIR_BI_DIR]= true; + search_dir[DIR_BI_DIR] = true; } else { search_dir[DIR_UP] = true; - search_dir[DIR_BI_DIR]= true; + search_dir[DIR_BI_DIR] = true; } } else if (ieee->iw_mode == IW_MODE_ADHOC) { - if(TxRxSelect == TX_DIR) + if (TxRxSelect == TX_DIR) search_dir[DIR_UP] = true; else search_dir[DIR_DOWN] = true; } else { if (TxRxSelect == TX_DIR) { search_dir[DIR_UP] = true; - search_dir[DIR_BI_DIR]= true; - search_dir[DIR_DIRECT]= true; + search_dir[DIR_BI_DIR] = true; + search_dir[DIR_DIRECT] = true; } else { search_dir[DIR_DOWN] = true; - search_dir[DIR_BI_DIR]= true; - search_dir[DIR_DIRECT]= true; + search_dir[DIR_BI_DIR] = true; + search_dir[DIR_DIRECT] = true; } } @@ -357,20 +357,20 @@ bool GetTs( struct tspec_body TSpec; struct qos_tsinfo *pTSInfo = &TSpec.ts_info; struct list_head *pUnusedList = - (TxRxSelect == TX_DIR)? - (&ieee->Tx_TS_Unused_List): + (TxRxSelect == TX_DIR) ? + (&ieee->Tx_TS_Unused_List) : (&ieee->Rx_TS_Unused_List); struct list_head *pAddmitList = - (TxRxSelect == TX_DIR)? - (&ieee->Tx_TS_Admit_List): + (TxRxSelect == TX_DIR) ? + (&ieee->Tx_TS_Admit_List) : (&ieee->Rx_TS_Admit_List); - enum direction_value Dir = (ieee->iw_mode == IW_MODE_MASTER)? - ((TxRxSelect==TX_DIR)?DIR_DOWN:DIR_UP): - ((TxRxSelect==TX_DIR)?DIR_UP:DIR_DOWN); + enum direction_value Dir = (ieee->iw_mode == IW_MODE_MASTER) ? + ((TxRxSelect == TX_DIR)?DIR_DOWN:DIR_UP) : + ((TxRxSelect == TX_DIR)?DIR_UP:DIR_DOWN); IEEE80211_DEBUG(IEEE80211_DL_TS, "to add Ts\n"); - if(!list_empty(pUnusedList)) { + if (!list_empty(pUnusedList)) { (*ppTS) = list_entry(pUnusedList->next, struct ts_common_info, list); list_del_init(&(*ppTS)->list); if (TxRxSelect == TX_DIR) { @@ -435,13 +435,13 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info * spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); return; } - for(i =0; i < prxb->nr_subframes; i++) + for (i = 0; i < prxb->nr_subframes; i++) dev_kfree_skb(prxb->subframes[i]); kfree(prxb); prxb = NULL; } - list_add_tail(&pRxReorderEntry->List,&ieee->RxReorder_Unused_List); + list_add_tail(&pRxReorderEntry->List, &ieee->RxReorder_Unused_List); spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); } -- cgit From 922fe878c78653fda011b176d3e4e355ba8f7479 Mon Sep 17 00:00:00 2001 From: Puranjay Mohan Date: Thu, 2 May 2019 01:53:49 +0530 Subject: Staging: rtl8192u: ieee80211: Fix indentation errors by removing extra spaces Remove extra spaces before statements to fix following indentation warnings reported by checkpatch.pl. WARNING: Statements should start on a tabstop + struct rtl_80211_hdr_3addr *delba = NULL; WARNING: Statements should start on a tabstop + struct rtl_80211_hdr_3addr *rsp = NULL; WARNING: Statements should start on a tabstop + struct rtl_80211_hdr_3addr *req = NULL; WARNING: Statements should start on a tabstop + struct rtl_80211_hdr_3addr *Delba = NULL; WARNING: Statements should start on a tabstop + struct rtl_80211_hdr_3addr *BAReq = NULL; Signed-off-by: Puranjay Mohan Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c index af396c53a929..37ec3eee8651 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c @@ -108,7 +108,7 @@ void ResetBaEntry(struct ba_record *pBA) static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, struct ba_record *pBA, u16 StatusCode, u8 type) { struct sk_buff *skb = NULL; - struct rtl_80211_hdr_3addr *BAReq = NULL; + struct rtl_80211_hdr_3addr *BAReq = NULL; u8 *tag = NULL; u16 len = ieee->tx_headroom + 9; //category(1) + action field(1) + Dialog Token(1) + BA Parameter Set(2) + BA Timeout Value(2) + BA Start SeqCtrl(2)(or StatusCode(2)) @@ -187,7 +187,7 @@ static struct sk_buff *ieee80211_DELBA( { union delba_param_set DelbaParamSet; struct sk_buff *skb = NULL; - struct rtl_80211_hdr_3addr *Delba = NULL; + struct rtl_80211_hdr_3addr *Delba = NULL; u8 *tag = NULL; //len = head len + DELBA Parameter Set(2) + Reason Code(2) u16 len = 6 + ieee->tx_headroom; @@ -314,7 +314,7 @@ static void ieee80211_send_DELBA(struct ieee80211_device *ieee, u8 *dst, ********************************************************************************************************************/ int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb) { - struct rtl_80211_hdr_3addr *req = NULL; + struct rtl_80211_hdr_3addr *req = NULL; u16 rc = 0; u8 *dst = NULL, *pDialogToken = NULL, *tag = NULL; struct ba_record *pBA = NULL; @@ -414,7 +414,7 @@ OnADDBAReq_Fail: ********************************************************************************************************************/ int ieee80211_rx_ADDBARsp(struct ieee80211_device *ieee, struct sk_buff *skb) { - struct rtl_80211_hdr_3addr *rsp = NULL; + struct rtl_80211_hdr_3addr *rsp = NULL; struct ba_record *pPendingBA, *pAdmittedBA; struct tx_ts_record *pTS = NULL; u8 *dst = NULL, *pDialogToken = NULL, *tag = NULL; @@ -538,7 +538,7 @@ OnADDBARsp_Reject: ********************************************************************************************************************/ int ieee80211_rx_DELBA(struct ieee80211_device *ieee, struct sk_buff *skb) { - struct rtl_80211_hdr_3addr *delba = NULL; + struct rtl_80211_hdr_3addr *delba = NULL; union delba_param_set *pDelBaParamSet = NULL; u8 *dst = NULL; -- cgit From eca4e5f58b758e74e6065eb8bcab57067f1427f6 Mon Sep 17 00:00:00 2001 From: Puranjay Mohan Date: Thu, 2 May 2019 02:16:20 +0530 Subject: Staging: rtl8192u: ieee80211: Fix if-else indentation warning Add tabs after if and else statements to fix the following warnings from checkpatch.pl WARNING: suspect code indent for conditional statements (8, 8) + if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) + pBA->param_set.field.buffer_size = 1; WARNING: suspect code indent for conditional statements (8, 8) + else + pBA->param_set.field.buffer_size = 32; Signed-off-by: Puranjay Mohan Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/staging/rtl8192u') diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c index 37ec3eee8651..53869b3c985c 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c @@ -384,9 +384,9 @@ int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb) pBA->start_seq_ctrl = *pBaStartSeqCtrl; //for half N mode we only aggregate 1 frame if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) - pBA->param_set.field.buffer_size = 1; + pBA->param_set.field.buffer_size = 1; else - pBA->param_set.field.buffer_size = 32; + pBA->param_set.field.buffer_size = 32; ActivateBAEntry(ieee, pBA, pBA->timeout_value); ieee80211_send_ADDBARsp(ieee, dst, pBA, ADDBA_STATUS_SUCCESS); -- cgit