[PATCH] Staging: rtl8192u: use %s and __func__

2021-01-24 Thread Puranjay Mohan
Change function's name to %s and __func__ to fix checkpatch.pl errors.

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8192u/r8190_rtl8256.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8190_rtl8256.c 
b/drivers/staging/rtl8192u/r8190_rtl8256.c
index 63e0f7b1b852..fee3bfb99075 100644
--- a/drivers/staging/rtl8192u/r8190_rtl8256.c
+++ b/drivers/staging/rtl8192u/r8190_rtl8256.c
@@ -58,7 +58,7 @@ void phy_set_rf8256_bandwidth(struct net_device *dev, enum 
ht_channel_width Band
(enum rf90_radio_path_e)eRFPath,
0x14, bMask12Bits, 0x5ab);
} else {
-   RT_TRACE(COMP_ERR, 
"phy_set_rf8256_bandwidth(): unknown hardware version\n");
+   RT_TRACE(COMP_ERR, "%s(): unknown 
hardware version\n", __func__);
}
break;
case HT_CHANNEL_WIDTH_20_40:
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8723bs: os_dep: Fix switch-case indentation error

2019-05-03 Thread Puranjay Mohan
Fix indentation for switch-case statements to fix following
checkpatch.pl Error:
ERROR: switch and case should be at the same indent

Signed-off-by: Puranjay Mohan 
---
 .../staging/rtl8723bs/os_dep/ioctl_linux.c| 442 +-
 1 file changed, 221 insertions(+), 221 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c 
b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index e3d356952875..9a1192e10e13 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -1671,45 +1671,45 @@ static int rtw_wx_set_rate(struct net_device *dev,
target_rate = target_rate/10;
 
switch (target_rate) {
-   case 10:
-   ratevalue = 0;
-   break;
-   case 20:
-   ratevalue = 1;
-   break;
-   case 55:
-   ratevalue = 2;
-   break;
-   case 60:
-   ratevalue = 3;
-   break;
-   case 90:
-   ratevalue = 4;
-   break;
-   case 110:
-   ratevalue = 5;
-   break;
-   case 120:
-   ratevalue = 6;
-   break;
-   case 180:
-   ratevalue = 7;
-   break;
-   case 240:
-   ratevalue = 8;
-   break;
-   case 360:
-   ratevalue = 9;
-   break;
-   case 480:
-   ratevalue = 10;
-   break;
-   case 540:
-   ratevalue = 11;
-   break;
-   default:
-   ratevalue = 11;
-   break;
+   case 10:
+   ratevalue = 0;
+   break;
+   case 20:
+   ratevalue = 1;
+   break;
+   case 55:
+   ratevalue = 2;
+   break;
+   case 60:
+   ratevalue = 3;
+   break;
+   case 90:
+   ratevalue = 4;
+   break;
+   case 110:
+   ratevalue = 5;
+   break;
+   case 120:
+   ratevalue = 6;
+   break;
+   case 180:
+   ratevalue = 7;
+   break;
+   case 240:
+   ratevalue = 8;
+   break;
+   case 360:
+   ratevalue = 9;
+   break;
+   case 480:
+   ratevalue = 10;
+   break;
+   case 540:
+   ratevalue = 11;
+   break;
+   default:
+   ratevalue = 11;
+   break;
}
 
 set_rate:
@@ -2267,22 +2267,22 @@ static int rtw_wx_read32(struct net_device *dev,
sscanf(ptmp, "%d,%x", &bytes, &addr);
 
switch (bytes) {
-   case 1:
-   data32 = rtw_read8(padapter, addr);
-   sprintf(extra, "0x%02X", data32);
-   break;
-   case 2:
-   data32 = rtw_read16(padapter, addr);
-   sprintf(extra, "0x%04X", data32);
-   break;
-   case 4:
-   data32 = rtw_read32(padapter, addr);
-   sprintf(extra, "0x%08X", data32);
-   break;
-   default:
-   DBG_871X(KERN_INFO "%s: usage> read 
[bytes],[address(hex)]\n", __func__);
-   ret = -EINVAL;
-   goto exit;
+   case 1:
+   data32 = rtw_read8(padapter, addr);
+   sprintf(extra, "0x%02X", data32);
+   break;
+   case 2:
+   data32 = rtw_read16(padapter, addr);
+   sprintf(extra, "0x%04X", data32);
+   break;
+   case 4:
+   data32 = rtw_read32(padapter, addr);
+   sprintf(extra, "0x%08X", data32);
+   break;
+   default:
+   DBG_871X(KERN_INFO "%s: usage> read [bytes],[address(hex)]\n", 
__func__);
+   ret = -EINVAL;
+   goto exit;
}
DBG_871X(KERN_INFO "%s: addr = 0x%08X data =%s\n", __func__, addr, 
extra);
 
@@ -2309,21 +2309,21 @@ static int rtw_wx_write32(struct net_device *dev,
sscanf(extra, "%d,%x,%x", &bytes, &addr, &data32);
 
switch (bytes) {
-   case 1:
-   rtw_write8(padapter, addr, (u8)data32);
-   DBG_871X(KERN_INFO "%s: addr = 0x%08X data = 0x%02X\n", 
__func__, addr, (u8)data32);
-   break;
-

[PATCH] Staging: rtl8723bs: core: Fix Spelling mistake in comments

2019-05-04 Thread Puranjay Mohan
Change spelling of 'associcated' to 'associated', to fix the spelling
mistake.

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8723bs/core/rtw_ap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c 
b/drivers/staging/rtl8723bs/core/rtw_ap.c
index bc0230672457..d4bf05462739 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -1914,7 +1914,7 @@ static int rtw_ht_operation_update(struct adapter 
*padapter)
 
 void associated_clients_update(struct adapter *padapter, u8 updated)
 {
-   /* update associcated stations cap. */
+   /* update associated stations cap. */
if (updated) {
struct list_head*phead, *plist;
struct sta_info *psta = NULL;
@@ -2072,7 +2072,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, 
struct sta_info *psta)
update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, true);
}
 
-   /* update associcated stations cap. */
+   /* update associated stations cap. */
associated_clients_update(padapter,  beacon_updated);
 
DBG_871X("%s, updated =%d\n", __func__, beacon_updated);
@@ -2136,7 +2136,7 @@ u8 bss_cap_update_on_sta_leave(struct adapter *padapter, 
struct sta_info *psta)
update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, true);
}
 
-   /* update associcated stations cap. */
+   /* update associated stations cap. */
/* associated_clients_update(padapter,  beacon_updated); //move it to 
avoid deadlock */
 
DBG_871X("%s, updated =%d\n", __func__, beacon_updated);
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8723bs: os_dep: Remove braces from single if statement

2019-05-07 Thread Puranjay Mohan
Remove braces from single if statement to solve style issue found using
checkpatch,pl

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c 
b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index 052482554f74..96e989d1d53d 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -489,9 +489,8 @@ static int rtw_drv_init(
 
/* dev_alloc_name && register_netdev */
status = rtw_drv_register_netdev(if1);
-   if (status != _SUCCESS) {
+   if (status != _SUCCESS)
goto free_if2;
-   }
 
if (sdio_alloc_irq(dvobj) != _SUCCESS)
goto free_if2;
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/5] Staging: rtl8192u: ieee80211: Fix coding style warning

2019-05-13 Thread Puranjay Mohan
Remove braces around a single if statement to fix following
checkpatch.pl warning.
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 0e762e559675..bd97531a254f 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -2577,9 +2577,9 @@ static inline void ieee80211_process_probe_response(
spin_unlock_irqrestore(&ieee->lock, flags);
if 
(is_beacon(beacon->header.frame_ctl)&&is_same_network(&ieee->current_network, 
network, ieee)&&\
(ieee->state == IEEE80211_LINKED)) {
-   if (ieee->handle_beacon != NULL) {
+   if (ieee->handle_beacon != NULL)

ieee->handle_beacon(ieee->dev,beacon,&ieee->current_network);
-   }
+
}
 
 out:
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/5] Staging: rtl8192u: ieee80211: Fix spelling mistake

2019-05-13 Thread Puranjay Mohan
Correct spelling mistakes at two places in comments.

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index bd97531a254f..72f418e5b49e 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -557,7 +557,7 @@ void ieee80211_indicate_packets(struct ieee80211_device 
*ieee, struct ieee80211_
//stats->rx_packets++;
//stats->rx_bytes += sub_skb->len;
 
-   /* Indicat the packets to upper layer */
+   /* Indicate the packets to upper layer */
if (sub_skb) {
sub_skb->protocol = eth_type_trans(sub_skb, 
ieee->dev);
memset(sub_skb->cb, 0, sizeof(sub_skb->cb));
@@ -1311,7 +1311,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
stats->multicast++;
}
 
-   /* Indicat the packets to upper layer */
+   /* Indicate the packets to upper layer */
sub_skb->protocol = eth_type_trans(sub_skb, 
dev);
memset(sub_skb->cb, 0, sizeof(sub_skb->cb));
sub_skb->dev = dev;
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/5] Staging: rtl8192u: ieee80211: Fix coding style errors

2019-05-13 Thread Puranjay Mohan
Fix coding style errors related to braces for if-else statements.

Signed-off-by: Puranjay Mohan 
---
 .../staging/rtl8192u/ieee80211/ieee80211_tx.c | 60 +++
 1 file changed, 22 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
index 8e1ec4409b4f..b0668cf4a857 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
@@ -169,8 +169,7 @@ int ieee80211_encrypt_fragment(
struct ieee80211_crypt_data *crypt = ieee->crypt[ieee->tx_keyidx];
int res;
 
-   if (!(crypt && crypt->ops))
-   {
+   if (!(crypt && crypt->ops)) {
printk("=>%s(), crypt is null\n", __func__);
return -1;
}
@@ -309,32 +308,25 @@ static void ieee80211_tx_query_agg_cap(struct 
ieee80211_device *ieee,
if (!Adapter->HalFunc.GetNmodeSupportBySecCfgHandler(Adapter))
return;
 #endif
-   if (!ieee->GetNmodeSupportBySecCfg(ieee->dev))
-   {
+   if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) {
return;
}
-   if (pHTInfo->bCurrentAMPDUEnable)
-   {
-   if (!GetTs(ieee, (struct ts_common_info **)(&pTxTs), 
hdr->addr1, skb->priority, TX_DIR, true))
-   {
+   if (pHTInfo->bCurrentAMPDUEnable) {
+   if (!GetTs(ieee, (struct ts_common_info **)(&pTxTs), 
hdr->addr1, skb->priority, TX_DIR, true)) {
printk("===>can't get TS\n");
return;
}
-   if (!pTxTs->tx_admitted_ba_record.valid)
-   {
+   if (!pTxTs->tx_admitted_ba_record.valid) {
TsStartAddBaProcess(ieee, pTxTs);
goto FORCED_AGG_SETTING;
-   }
-   else if (!pTxTs->using_ba)
-   {
+   } else if (!pTxTs->using_ba) {
if 
(SN_LESS(pTxTs->tx_admitted_ba_record.start_seq_ctrl.field.seq_num, 
(pTxTs->tx_cur_seq + 1) % 4096))
pTxTs->using_ba = true;
else
goto FORCED_AGG_SETTING;
}
 
-   if (ieee->iw_mode == IW_MODE_INFRA)
-   {
+   if (ieee->iw_mode == IW_MODE_INFRA) {
tcb_desc->bAMPDUEnable = true;
tcb_desc->ampdu_factor = pHTInfo->CurrentAMPDUFactor;
tcb_desc->ampdu_density = pHTInfo->CurrentMPDUDensity;
@@ -366,12 +358,9 @@ static void ieee80211_qurey_ShortPreambleMode(struct 
ieee80211_device *ieee,
  struct cb_desc *tcb_desc)
 {
tcb_desc->bUseShortPreamble = false;
-   if (tcb_desc->data_rate == 2)
-   { 1M can only use Long Preamble. 11B spec
+   if (tcb_desc->data_rate == 2) { 1M can only use Long Preamble. 11B 
spec
return;
-   }
-   else if (ieee->current_network.capability & 
WLAN_CAPABILITY_SHORT_PREAMBLE)
-   {
+   } else if (ieee->current_network.capability & 
WLAN_CAPABILITY_SHORT_PREAMBLE) {
tcb_desc->bUseShortPreamble = true;
}
return;
@@ -386,8 +375,7 @@ ieee80211_query_HTCapShortGI(struct ieee80211_device *ieee, 
struct cb_desc *tcb_
if (!pHTInfo->bCurrentHTSupport||!pHTInfo->bEnableHT)
return;
 
-   if (pHTInfo->bForcedShortGI)
-   {
+   if (pHTInfo->bForcedShortGI) {
tcb_desc->bUseShortGI = true;
return;
}
@@ -535,27 +523,25 @@ static void ieee80211_txrate_selectmode(struct 
ieee80211_device *ieee,
struct cb_desc *tcb_desc)
 {
 #ifdef TO_DO_LIST
-   if(!IsDataFrame(pFrame))
-   {
+   if (!IsDataFrame(pFrame)) {
pTcb->bTxDisableRateFallBack = true;
pTcb->bTxUseDriverAssingedRate = true;
pTcb->RATRIndex = 7;
return;
}
 
-   if(pMgntInfo->ForcedDataRate!= 0)
-   {
+   if (pMgntInfo->ForcedDataRate!= 0) {
pTcb->bTxDisableRateFallBack = true;
pTcb->bTxUseDriverAssingedRate = true;
return;
}
 #endif
-   if(ieee->bTxDisableRateFallBack)
+   if (ieee->bTxDisableRateFallBack)
tcb_desc->bTxDisableRateFallBack = true;
 
-   if(ieee->bTxUseDriverAssingedRate)
+   if (ieee->bTxUseDriverAssingedRate)
tcb_desc->bTxUseDriverAssingedRate = true;
-   if(!tcb_desc->bTxDisableRateFallBack || 
!tcb_desc->bTxUseDriverAssingedRate)
+   if (!tcb_desc->bT

[PATCH 4/5] Staging: rtl8192u: ieee80211: Add spaces around '&&' operator

2019-05-13 Thread Puranjay Mohan
Fix coding style errors by adding spaces around '&&' operators.

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 72f418e5b49e..ab546a63ead1 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -102,7 +102,7 @@ ieee80211_frag_cache_get(struct ieee80211_device *ieee,
struct rtl_80211_hdr_4addrqos *hdr_4addrqos;
u8 tid;
 
-   if (((fc & IEEE80211_FCTL_DSTODS) == 
IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) {
+   if (((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS) && 
IEEE80211_QOS_HAS_SEQ(fc)) {
  hdr_4addrqos = (struct rtl_80211_hdr_4addrqos *)hdr;
  tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID;
  tid = UP2AC(tid);
@@ -169,7 +169,7 @@ static int ieee80211_frag_cache_invalidate(struct 
ieee80211_device *ieee,
struct rtl_80211_hdr_4addrqos *hdr_4addrqos;
u8 tid;
 
-   if(((fc & IEEE80211_FCTL_DSTODS) == 
IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) {
+   if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS) && 
IEEE80211_QOS_HAS_SEQ(fc)) {
  hdr_4addrqos = (struct rtl_80211_hdr_4addrqos *)hdr;
  tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID;
  tid = UP2AC(tid);
@@ -426,7 +426,7 @@ static int is_duplicate_packet(struct ieee80211_device 
*ieee,
 
 
//TO2DS and QoS
-   if(((fc & IEEE80211_FCTL_DSTODS) == 
IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) {
+   if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS) && 
IEEE80211_QOS_HAS_SEQ(fc)) {
  hdr_4addrqos = (struct rtl_80211_hdr_4addrqos *)header;
  tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID;
  tid = UP2AC(tid);
@@ -773,7 +773,7 @@ static u8 parse_subframe(struct sk_buff *skb,
/* just for debug purpose */
SeqNum = WLAN_GET_SEQ_SEQ(le16_to_cpu(hdr->seq_ctl));
 
-   if ((IEEE80211_QOS_HAS_SEQ(fc))&&\
+   if ((IEEE80211_QOS_HAS_SEQ(fc)) && \
(((frameqos *)(skb->data + 
IEEE80211_3ADDR_LEN))->field.reserved)) {
bIsAggregateFrame = true;
}
@@ -1109,7 +1109,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
if (stype != IEEE80211_STYPE_DATA &&
stype != IEEE80211_STYPE_DATA_CFACK &&
stype != IEEE80211_STYPE_DATA_CFPOLL &&
-   stype != IEEE80211_STYPE_DATA_CFACKPOLL&&
+   stype != IEEE80211_STYPE_DATA_CFACKPOLL &&
stype != IEEE80211_STYPE_QOS_DATA//add by David,2006.8.4
) {
if (stype != IEEE80211_STYPE_NULLFUNC)
@@ -2565,7 +2565,7 @@ static inline void ieee80211_process_probe_response(
//  printk(">2 network->ssid=%s FLAG=%d target.ssid=%s 
FLAG=%d\n", network->ssid, network->flags, target->ssid, target->flags);
if(((network->flags & NETWORK_EMPTY_ESSID) == 
NETWORK_EMPTY_ESSID) \
&& (((network->ssid_len > 0) && (strncmp(target->ssid, 
network->ssid, network->ssid_len)))\
-   ||((ieee->current_network.ssid_len == 
network->ssid_len)&&(strncmp(ieee->current_network.ssid, network->ssid, 
network->ssid_len) == 0)&&(ieee->state == IEEE80211_NOLINK
+   ||((ieee->current_network.ssid_len == network->ssid_len) && 
(strncmp(ieee->current_network.ssid, network->ssid, network->ssid_len) == 0) && 
(ieee->state == IEEE80211_NOLINK
renew = 1;
//YJ,add,080819,for hidden ap,end
 
@@ -2575,7 +2575,7 @@ static inline void ieee80211_process_probe_response(
}
 
spin_unlock_irqrestore(&ieee->lock, flags);
-   if 
(is_beacon(beacon->header.frame_ctl)&&is_same_network(&ieee->current_network, 
network, ieee)&&\
+   if (is_beacon(beacon->header.frame_ctl) && 
is_same_network(&ieee->current_network, network, ieee) && \
(ieee->state == IEEE80211_LINKED)) {
if (ieee->handle_beacon != NULL)

ieee->handle_beacon(ieee->dev,beacon,&ieee->current_network);
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 5/5] Staging: rtl8192u: ieee80211: Use !x in place of NULL comparison

2019-05-13 Thread Puranjay Mohan
Fix comparison to NULL, chang to !x operation.
Issue found using checkpatch.pl

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 944c8894f9ff..79558fb797c2 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -1796,7 +1796,7 @@ static void ieee80211_process_action(struct 
ieee80211_device *ieee,
u8 *act = ieee80211_get_payload(header);
u8 tmp = 0;
 // IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, 
skb->len);
-   if (act == NULL) {
+   if (!act) {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "error to get payload of 
action frame\n");
return;
}
@@ -1929,7 +1929,7 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, 
struct sk_buff *skb,

memcpy(ieee->pHTInfo->PeerHTCapBuf, network->bssht.bdHTCapBuf, 
network->bssht.bdHTCapLen);

memcpy(ieee->pHTInfo->PeerHTInfoBuf, network->bssht.bdHTInfoBuf, 
network->bssht.bdHTInfoLen);
}
-   if (ieee->handle_assoc_response != NULL)
+   if (ieee->handle_assoc_response)

ieee->handle_assoc_response(ieee->dev, (struct ieee80211_assoc_response_frame 
*)header, network);
}
ieee80211_associate_complete(ieee);
@@ -2856,7 +2856,7 @@ static int ieee80211_wpa_set_encryption(struct 
ieee80211_device *ieee,
goto done;
}
 
-   if (*crypt == NULL || (*crypt)->ops != ops) {
+   if (!(*crypt) || (*crypt)->ops != ops) {
struct ieee80211_crypt_data *new_crypt;
 
ieee80211_crypt_delayed_deinit(ieee, crypt);
@@ -2871,7 +2871,7 @@ static int ieee80211_wpa_set_encryption(struct 
ieee80211_device *ieee,
new_crypt->priv =
new_crypt->ops->init(param->u.crypt.idx);
 
-   if (new_crypt->priv == NULL) {
+   if (!new_crypt->priv) {
kfree(new_crypt);
param->u.crypt.err = IEEE_CRYPT_ERR_CRYPT_INIT_FAILED;
ret = -EINVAL;
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8723bs: os_dep: Fix if-else coding style issues

2019-05-13 Thread Puranjay Mohan
Fix placement of opening brace in if-else statement
to correct coding style issue.

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 15 +--
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c 
b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index 052482554f74..178f0c16e601 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -368,8 +368,7 @@ static struct adapter *rtw_sdio_if1_init(struct dvobj_priv 
*dvobj, const struct
padapter->intf_alloc_irq = &sdio_alloc_irq;
padapter->intf_free_irq = &sdio_free_irq;
 
-   if (rtw_init_io_priv(padapter, sdio_set_intf_ops) == _FAIL)
-   {
+   if (rtw_init_io_priv(padapter, sdio_set_intf_ops) == _FAIL) {
RT_TRACE(_module_hci_intfs_c_, _drv_err_,
("rtw_drv_init: Can't init io_priv\n"));
goto free_hal_data;
@@ -569,14 +568,12 @@ static int rtw_sdio_suspend(struct device *dev)
struct adapter *padapter = psdpriv->if1;
struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
 
-   if (padapter->bDriverStopped == true)
-   {
+   if (padapter->bDriverStopped == true) {
DBG_871X("%s bDriverStopped = %d\n", __func__, 
padapter->bDriverStopped);
return 0;
}
 
-   if (pwrpriv->bInSuspend == true)
-   {
+   if (pwrpriv->bInSuspend == true) {
DBG_871X("%s bInSuspend = %d\n", __func__, pwrpriv->bInSuspend);
pdbgpriv->dbg_suspend_error_cnt++;
return 0;
@@ -591,8 +588,7 @@ static int rtw_resume_process(struct adapter *padapter)
struct dvobj_priv *psdpriv = padapter->dvobj;
struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
 
-   if (pwrpriv->bInSuspend == false)
-   {
+   if (pwrpriv->bInSuspend == false) {
pdbgpriv->dbg_resume_error_cnt++;
DBG_871X("%s bInSuspend = %d\n", __func__, pwrpriv->bInSuspend);
return -1;
@@ -635,8 +631,7 @@ static int __init rtw_drv_entry(void)
rtw_drv_proc_init();
 
ret = sdio_register_driver(&sdio_drvpriv.r871xs_drv);
-   if (ret != 0)
-   {
+   if (ret != 0) {
sdio_drvpriv.drv_registered = false;
rtw_drv_proc_deinit();
rtw_ndev_notifier_unregister();
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH V2 1/5] Staging: rtl8192u: ieee80211: Fix coding style warning

2019-05-14 Thread Puranjay Mohan
Remove braces around a single if statement to fix following
checkpatch.pl warning.
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Puranjay Mohan 
---

V2 - remove extra blank line before the closing brace.

 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 0e762e559675..1ab10d8919a6 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -2577,9 +2577,8 @@ static inline void ieee80211_process_probe_response(
spin_unlock_irqrestore(&ieee->lock, flags);
if 
(is_beacon(beacon->header.frame_ctl)&&is_same_network(&ieee->current_network, 
network, ieee)&&\
(ieee->state == IEEE80211_LINKED)) {
-   if (ieee->handle_beacon != NULL) {
+   if (ieee->handle_beacon != NULL)

ieee->handle_beacon(ieee->dev,beacon,&ieee->current_network);
-   }
}
 
 out:
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH V2 3/5] Staging: rtl8192u: ieee80211: Fix coding style errors

2019-05-14 Thread Puranjay Mohan
Fix coding style errors related to braces for if-else statements.

Signed-off-by: Puranjay Mohan 
---

V2 - Remove extra blank lines.

 .../staging/rtl8192u/ieee80211/ieee80211_tx.c | 58 +++
 1 file changed, 20 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
index 8e1ec4409b4f..fc6eb97801e1 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
@@ -169,8 +169,7 @@ int ieee80211_encrypt_fragment(
struct ieee80211_crypt_data *crypt = ieee->crypt[ieee->tx_keyidx];
int res;
 
-   if (!(crypt && crypt->ops))
-   {
+   if (!(crypt && crypt->ops)) {
printk("=>%s(), crypt is null\n", __func__);
return -1;
}
@@ -309,32 +308,25 @@ static void ieee80211_tx_query_agg_cap(struct 
ieee80211_device *ieee,
if (!Adapter->HalFunc.GetNmodeSupportBySecCfgHandler(Adapter))
return;
 #endif
-   if (!ieee->GetNmodeSupportBySecCfg(ieee->dev))
-   {
+   if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) {
return;
}
-   if (pHTInfo->bCurrentAMPDUEnable)
-   {
-   if (!GetTs(ieee, (struct ts_common_info **)(&pTxTs), 
hdr->addr1, skb->priority, TX_DIR, true))
-   {
+   if (pHTInfo->bCurrentAMPDUEnable) {
+   if (!GetTs(ieee, (struct ts_common_info **)(&pTxTs), 
hdr->addr1, skb->priority, TX_DIR, true)) {
printk("===>can't get TS\n");
return;
}
-   if (!pTxTs->tx_admitted_ba_record.valid)
-   {
+   if (!pTxTs->tx_admitted_ba_record.valid) {
TsStartAddBaProcess(ieee, pTxTs);
goto FORCED_AGG_SETTING;
-   }
-   else if (!pTxTs->using_ba)
-   {
+   } else if (!pTxTs->using_ba) {
if 
(SN_LESS(pTxTs->tx_admitted_ba_record.start_seq_ctrl.field.seq_num, 
(pTxTs->tx_cur_seq + 1) % 4096))
pTxTs->using_ba = true;
else
goto FORCED_AGG_SETTING;
}
 
-   if (ieee->iw_mode == IW_MODE_INFRA)
-   {
+   if (ieee->iw_mode == IW_MODE_INFRA) {
tcb_desc->bAMPDUEnable = true;
tcb_desc->ampdu_factor = pHTInfo->CurrentAMPDUFactor;
tcb_desc->ampdu_density = pHTInfo->CurrentMPDUDensity;
@@ -366,12 +358,9 @@ static void ieee80211_qurey_ShortPreambleMode(struct 
ieee80211_device *ieee,
  struct cb_desc *tcb_desc)
 {
tcb_desc->bUseShortPreamble = false;
-   if (tcb_desc->data_rate == 2)
-   { 1M can only use Long Preamble. 11B spec
+   if (tcb_desc->data_rate == 2) { 1M can only use Long Preamble. 11B 
spec
return;
-   }
-   else if (ieee->current_network.capability & 
WLAN_CAPABILITY_SHORT_PREAMBLE)
-   {
+   } else if (ieee->current_network.capability & 
WLAN_CAPABILITY_SHORT_PREAMBLE) {
tcb_desc->bUseShortPreamble = true;
}
return;
@@ -386,8 +375,7 @@ ieee80211_query_HTCapShortGI(struct ieee80211_device *ieee, 
struct cb_desc *tcb_
if (!pHTInfo->bCurrentHTSupport||!pHTInfo->bEnableHT)
return;
 
-   if (pHTInfo->bForcedShortGI)
-   {
+   if (pHTInfo->bForcedShortGI) {
tcb_desc->bUseShortGI = true;
return;
}
@@ -535,27 +523,25 @@ static void ieee80211_txrate_selectmode(struct 
ieee80211_device *ieee,
struct cb_desc *tcb_desc)
 {
 #ifdef TO_DO_LIST
-   if(!IsDataFrame(pFrame))
-   {
+   if (!IsDataFrame(pFrame)) {
pTcb->bTxDisableRateFallBack = true;
pTcb->bTxUseDriverAssingedRate = true;
pTcb->RATRIndex = 7;
return;
}
 
-   if(pMgntInfo->ForcedDataRate!= 0)
-   {
+   if (pMgntInfo->ForcedDataRate!= 0) {
pTcb->bTxDisableRateFallBack = true;
pTcb->bTxUseDriverAssingedRate = true;
return;
}
 #endif
-   if(ieee->bTxDisableRateFallBack)
+   if (ieee->bTxDisableRateFallBack)
tcb_desc->bTxDisableRateFallBack = true;
 
-   if(ieee->bTxUseDriverAssingedRate)
+   if (ieee->bTxUseDriverAssingedRate)
tcb_desc->bTxUseDriverAssingedRate = true;
-   if(!tcb_desc->bTxDisableRateFallBack || 
!tcb_desc->bTxUseDriverAssingedRate)
+  

[PATCH V2 5/5] Staging: rtl8192u: ieee80211: Use !x in place of NULL comparison

2019-05-14 Thread Puranjay Mohan
Fix comparison to NULL, chang to !x operation.
Issue found using checkpatch.pl

Signed-off-by: Puranjay Mohan 
---

V2 - Remove extra parentheses around *crypt

 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 944c8894f9ff..9f54adede230 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -1796,7 +1796,7 @@ static void ieee80211_process_action(struct 
ieee80211_device *ieee,
u8 *act = ieee80211_get_payload(header);
u8 tmp = 0;
 // IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, 
skb->len);
-   if (act == NULL) {
+   if (!act) {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "error to get payload of 
action frame\n");
return;
}
@@ -1929,7 +1929,7 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, 
struct sk_buff *skb,

memcpy(ieee->pHTInfo->PeerHTCapBuf, network->bssht.bdHTCapBuf, 
network->bssht.bdHTCapLen);

memcpy(ieee->pHTInfo->PeerHTInfoBuf, network->bssht.bdHTInfoBuf, 
network->bssht.bdHTInfoLen);
}
-   if (ieee->handle_assoc_response != NULL)
+   if (ieee->handle_assoc_response)

ieee->handle_assoc_response(ieee->dev, (struct ieee80211_assoc_response_frame 
*)header, network);
}
ieee80211_associate_complete(ieee);
@@ -2856,7 +2856,7 @@ static int ieee80211_wpa_set_encryption(struct 
ieee80211_device *ieee,
goto done;
}
 
-   if (*crypt == NULL || (*crypt)->ops != ops) {
+   if (!*crypt || (*crypt)->ops != ops) {
struct ieee80211_crypt_data *new_crypt;
 
ieee80211_crypt_delayed_deinit(ieee, crypt);
@@ -2871,7 +2871,7 @@ static int ieee80211_wpa_set_encryption(struct 
ieee80211_device *ieee,
new_crypt->priv =
new_crypt->ops->init(param->u.crypt.idx);
 
-   if (new_crypt->priv == NULL) {
+   if (!new_crypt->priv) {
kfree(new_crypt);
param->u.crypt.err = IEEE_CRYPT_ERR_CRYPT_INIT_FAILED;
ret = -EINVAL;
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH V2 1/5] Staging: rtl8192u: ieee80211: Fix coding style warning

2019-05-14 Thread Puranjay Mohan
On Tue, May 14, 2019 at 04:09:05PM +0200, Greg KH wrote:
> On Tue, May 14, 2019 at 02:42:31PM +0530, Puranjay Mohan wrote:
> > Remove braces around a single if statement to fix following
> > checkpatch.pl warning.
> > WARNING: braces {} are not necessary for single statement blocks
> > 
> > Signed-off-by: Puranjay Mohan 
> > ---
> > 
> > V2 - remove extra blank line before the closing brace.
> 
> When you fix up a patch in a series, please resend the _whole_ series,
> otherwise I have to try to piece together the different patches and put
> them in the proper place.  When dealing with 1000+ emails a day, that's
> a hard thing to ask a maintainer to do.
I am sorry! 
> So please just resend this whole thing, in a threaded email series (such
> that they are all grouped together.  You are sending these as individual
> emails, and so email clients do not link them, making them harder to
> manage :(
> 
> thanks,
> 
> greg k-h
I will resend it again properly.
Sorry for doing mistakes everytime.
I am trying to learn and trying my best
to make good contributions.

Thanks and Regards,
-Puranjay Mohan
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 1/5] Staging: rtl8192u: ieee80211: Fix coding style warning

2019-05-14 Thread Puranjay Mohan
Remove braces around a single if statement to fix following
checkpatch.pl warning.
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 0e762e559675..1ab10d8919a6 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -2577,9 +2577,8 @@ static inline void ieee80211_process_probe_response(
spin_unlock_irqrestore(&ieee->lock, flags);
if 
(is_beacon(beacon->header.frame_ctl)&&is_same_network(&ieee->current_network, 
network, ieee)&&\
(ieee->state == IEEE80211_LINKED)) {
-   if (ieee->handle_beacon != NULL) {
+   if (ieee->handle_beacon != NULL)

ieee->handle_beacon(ieee->dev,beacon,&ieee->current_network);
-   }
}
 
 out:
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 3/5] Staging: rtl8192u: ieee80211: Fix coding style errors

2019-05-14 Thread Puranjay Mohan
Fix coding style errors related to braces for if-else statements.

Signed-off-by: Puranjay Mohan 
---
 .../staging/rtl8192u/ieee80211/ieee80211_tx.c | 58 +++
 1 file changed, 20 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
index 8e1ec4409b4f..fc6eb97801e1 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
@@ -169,8 +169,7 @@ int ieee80211_encrypt_fragment(
struct ieee80211_crypt_data *crypt = ieee->crypt[ieee->tx_keyidx];
int res;
 
-   if (!(crypt && crypt->ops))
-   {
+   if (!(crypt && crypt->ops)) {
printk("=>%s(), crypt is null\n", __func__);
return -1;
}
@@ -309,32 +308,25 @@ static void ieee80211_tx_query_agg_cap(struct 
ieee80211_device *ieee,
if (!Adapter->HalFunc.GetNmodeSupportBySecCfgHandler(Adapter))
return;
 #endif
-   if (!ieee->GetNmodeSupportBySecCfg(ieee->dev))
-   {
+   if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) {
return;
}
-   if (pHTInfo->bCurrentAMPDUEnable)
-   {
-   if (!GetTs(ieee, (struct ts_common_info **)(&pTxTs), 
hdr->addr1, skb->priority, TX_DIR, true))
-   {
+   if (pHTInfo->bCurrentAMPDUEnable) {
+   if (!GetTs(ieee, (struct ts_common_info **)(&pTxTs), 
hdr->addr1, skb->priority, TX_DIR, true)) {
printk("===>can't get TS\n");
return;
}
-   if (!pTxTs->tx_admitted_ba_record.valid)
-   {
+   if (!pTxTs->tx_admitted_ba_record.valid) {
TsStartAddBaProcess(ieee, pTxTs);
goto FORCED_AGG_SETTING;
-   }
-   else if (!pTxTs->using_ba)
-   {
+   } else if (!pTxTs->using_ba) {
if 
(SN_LESS(pTxTs->tx_admitted_ba_record.start_seq_ctrl.field.seq_num, 
(pTxTs->tx_cur_seq + 1) % 4096))
pTxTs->using_ba = true;
else
goto FORCED_AGG_SETTING;
}
 
-   if (ieee->iw_mode == IW_MODE_INFRA)
-   {
+   if (ieee->iw_mode == IW_MODE_INFRA) {
tcb_desc->bAMPDUEnable = true;
tcb_desc->ampdu_factor = pHTInfo->CurrentAMPDUFactor;
tcb_desc->ampdu_density = pHTInfo->CurrentMPDUDensity;
@@ -366,12 +358,9 @@ static void ieee80211_qurey_ShortPreambleMode(struct 
ieee80211_device *ieee,
  struct cb_desc *tcb_desc)
 {
tcb_desc->bUseShortPreamble = false;
-   if (tcb_desc->data_rate == 2)
-   { 1M can only use Long Preamble. 11B spec
+   if (tcb_desc->data_rate == 2) { 1M can only use Long Preamble. 11B 
spec
return;
-   }
-   else if (ieee->current_network.capability & 
WLAN_CAPABILITY_SHORT_PREAMBLE)
-   {
+   } else if (ieee->current_network.capability & 
WLAN_CAPABILITY_SHORT_PREAMBLE) {
tcb_desc->bUseShortPreamble = true;
}
return;
@@ -386,8 +375,7 @@ ieee80211_query_HTCapShortGI(struct ieee80211_device *ieee, 
struct cb_desc *tcb_
if (!pHTInfo->bCurrentHTSupport||!pHTInfo->bEnableHT)
return;
 
-   if (pHTInfo->bForcedShortGI)
-   {
+   if (pHTInfo->bForcedShortGI) {
tcb_desc->bUseShortGI = true;
return;
}
@@ -535,27 +523,25 @@ static void ieee80211_txrate_selectmode(struct 
ieee80211_device *ieee,
struct cb_desc *tcb_desc)
 {
 #ifdef TO_DO_LIST
-   if(!IsDataFrame(pFrame))
-   {
+   if (!IsDataFrame(pFrame)) {
pTcb->bTxDisableRateFallBack = true;
pTcb->bTxUseDriverAssingedRate = true;
pTcb->RATRIndex = 7;
return;
}
 
-   if(pMgntInfo->ForcedDataRate!= 0)
-   {
+   if (pMgntInfo->ForcedDataRate!= 0) {
pTcb->bTxDisableRateFallBack = true;
pTcb->bTxUseDriverAssingedRate = true;
return;
}
 #endif
-   if(ieee->bTxDisableRateFallBack)
+   if (ieee->bTxDisableRateFallBack)
tcb_desc->bTxDisableRateFallBack = true;
 
-   if(ieee->bTxUseDriverAssingedRate)
+   if (ieee->bTxUseDriverAssingedRate)
tcb_desc->bTxUseDriverAssingedRate = true;
-   if(!tcb_desc->bTxDisableRateFallBack || 
!tcb_desc->bTxUseDriverAssingedRate)
+   if (!tcb_desc->bT

[PATCH v2 5/5] Staging: rtl8192u: ieee80211: Use !x in place of NULL comparison

2019-05-14 Thread Puranjay Mohan
Fix comparison to NULL, chang to !x operation.
Issue found using checkpatch.pl

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 944c8894f9ff..9f54adede230 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -1796,7 +1796,7 @@ static void ieee80211_process_action(struct 
ieee80211_device *ieee,
u8 *act = ieee80211_get_payload(header);
u8 tmp = 0;
 // IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, 
skb->len);
-   if (act == NULL) {
+   if (!act) {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "error to get payload of 
action frame\n");
return;
}
@@ -1929,7 +1929,7 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, 
struct sk_buff *skb,

memcpy(ieee->pHTInfo->PeerHTCapBuf, network->bssht.bdHTCapBuf, 
network->bssht.bdHTCapLen);

memcpy(ieee->pHTInfo->PeerHTInfoBuf, network->bssht.bdHTInfoBuf, 
network->bssht.bdHTInfoLen);
}
-   if (ieee->handle_assoc_response != NULL)
+   if (ieee->handle_assoc_response)

ieee->handle_assoc_response(ieee->dev, (struct ieee80211_assoc_response_frame 
*)header, network);
}
ieee80211_associate_complete(ieee);
@@ -2856,7 +2856,7 @@ static int ieee80211_wpa_set_encryption(struct 
ieee80211_device *ieee,
goto done;
}
 
-   if (*crypt == NULL || (*crypt)->ops != ops) {
+   if (!*crypt || (*crypt)->ops != ops) {
struct ieee80211_crypt_data *new_crypt;
 
ieee80211_crypt_delayed_deinit(ieee, crypt);
@@ -2871,7 +2871,7 @@ static int ieee80211_wpa_set_encryption(struct 
ieee80211_device *ieee,
new_crypt->priv =
new_crypt->ops->init(param->u.crypt.idx);
 
-   if (new_crypt->priv == NULL) {
+   if (!new_crypt->priv) {
kfree(new_crypt);
param->u.crypt.err = IEEE_CRYPT_ERR_CRYPT_INIT_FAILED;
ret = -EINVAL;
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 4/5] Staging: rtl8192u: ieee80211: Add spaces around '&&' operator

2019-05-14 Thread Puranjay Mohan
Fix coding style errors by adding spaces around '&&' operators.

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index a4477b8e7f2a..5483df408049 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -102,7 +102,7 @@ ieee80211_frag_cache_get(struct ieee80211_device *ieee,
struct rtl_80211_hdr_4addrqos *hdr_4addrqos;
u8 tid;
 
-   if (((fc & IEEE80211_FCTL_DSTODS) == 
IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) {
+   if (((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS) && 
IEEE80211_QOS_HAS_SEQ(fc)) {
  hdr_4addrqos = (struct rtl_80211_hdr_4addrqos *)hdr;
  tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID;
  tid = UP2AC(tid);
@@ -169,7 +169,7 @@ static int ieee80211_frag_cache_invalidate(struct 
ieee80211_device *ieee,
struct rtl_80211_hdr_4addrqos *hdr_4addrqos;
u8 tid;
 
-   if(((fc & IEEE80211_FCTL_DSTODS) == 
IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) {
+   if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS) && 
IEEE80211_QOS_HAS_SEQ(fc)) {
  hdr_4addrqos = (struct rtl_80211_hdr_4addrqos *)hdr;
  tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID;
  tid = UP2AC(tid);
@@ -426,7 +426,7 @@ static int is_duplicate_packet(struct ieee80211_device 
*ieee,
 
 
//TO2DS and QoS
-   if(((fc & IEEE80211_FCTL_DSTODS) == 
IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) {
+   if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS) && 
IEEE80211_QOS_HAS_SEQ(fc)) {
  hdr_4addrqos = (struct rtl_80211_hdr_4addrqos *)header;
  tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID;
  tid = UP2AC(tid);
@@ -773,7 +773,7 @@ static u8 parse_subframe(struct sk_buff *skb,
/* just for debug purpose */
SeqNum = WLAN_GET_SEQ_SEQ(le16_to_cpu(hdr->seq_ctl));
 
-   if ((IEEE80211_QOS_HAS_SEQ(fc))&&\
+   if ((IEEE80211_QOS_HAS_SEQ(fc)) && \
(((frameqos *)(skb->data + 
IEEE80211_3ADDR_LEN))->field.reserved)) {
bIsAggregateFrame = true;
}
@@ -1109,7 +1109,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
if (stype != IEEE80211_STYPE_DATA &&
stype != IEEE80211_STYPE_DATA_CFACK &&
stype != IEEE80211_STYPE_DATA_CFPOLL &&
-   stype != IEEE80211_STYPE_DATA_CFACKPOLL&&
+   stype != IEEE80211_STYPE_DATA_CFACKPOLL &&
stype != IEEE80211_STYPE_QOS_DATA//add by David,2006.8.4
) {
if (stype != IEEE80211_STYPE_NULLFUNC)
@@ -2565,7 +2565,7 @@ static inline void ieee80211_process_probe_response(
//  printk(">2 network->ssid=%s FLAG=%d target.ssid=%s 
FLAG=%d\n", network->ssid, network->flags, target->ssid, target->flags);
if(((network->flags & NETWORK_EMPTY_ESSID) == 
NETWORK_EMPTY_ESSID) \
&& (((network->ssid_len > 0) && (strncmp(target->ssid, 
network->ssid, network->ssid_len)))\
-   ||((ieee->current_network.ssid_len == 
network->ssid_len)&&(strncmp(ieee->current_network.ssid, network->ssid, 
network->ssid_len) == 0)&&(ieee->state == IEEE80211_NOLINK
+   ||((ieee->current_network.ssid_len == network->ssid_len) && 
(strncmp(ieee->current_network.ssid, network->ssid, network->ssid_len) == 0) && 
(ieee->state == IEEE80211_NOLINK
renew = 1;
//YJ,add,080819,for hidden ap,end
 
@@ -2575,7 +2575,7 @@ static inline void ieee80211_process_probe_response(
}
 
spin_unlock_irqrestore(&ieee->lock, flags);
-   if 
(is_beacon(beacon->header.frame_ctl)&&is_same_network(&ieee->current_network, 
network, ieee)&&\
+   if (is_beacon(beacon->header.frame_ctl) && 
is_same_network(&ieee->current_network, network, ieee) && \
(ieee->state == IEEE80211_LINKED)) {
if (ieee->handle_beacon != NULL)

ieee->handle_beacon(ieee->dev,beacon,&ieee->current_network);
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 2/5] Staging: rtl8192u: ieee80211: Fix spelling mistake

2019-05-14 Thread Puranjay Mohan
Correct spelling mistakes at two places in comments.

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 1ab10d8919a6..a4477b8e7f2a 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -557,7 +557,7 @@ void ieee80211_indicate_packets(struct ieee80211_device 
*ieee, struct ieee80211_
//stats->rx_packets++;
//stats->rx_bytes += sub_skb->len;
 
-   /* Indicat the packets to upper layer */
+   /* Indicate the packets to upper layer */
if (sub_skb) {
sub_skb->protocol = eth_type_trans(sub_skb, 
ieee->dev);
memset(sub_skb->cb, 0, sizeof(sub_skb->cb));
@@ -1311,7 +1311,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
stats->multicast++;
}
 
-   /* Indicat the packets to upper layer */
+   /* Indicate the packets to upper layer */
sub_skb->protocol = eth_type_trans(sub_skb, 
dev);
memset(sub_skb->cb, 0, sizeof(sub_skb->cb));
sub_skb->dev = dev;
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 0/5] Fix checkpatch errors and warnings

2019-05-14 Thread Puranjay Mohan
This series fix the following errors/warnings:

-Correct spelling mistakes.
-Replace NULL comparison.
-Add space around operators.
-Remove braces from single if statement.


Puranjay Mohan (5):
  Staging: rtl8192u: ieee80211: Fix coding style warning
  Staging: rtl8192u: ieee80211: Fix spelling mistake
  Staging: rtl8192u: ieee80211: Fix coding style errors
  Staging: rtl8192u: ieee80211: Add spaces around '&&' operator
  Staging: rtl8192u: ieee80211: Use !x in place of NULL comparison

 .../staging/rtl8192u/ieee80211/ieee80211_rx.c | 21 ---
 .../rtl8192u/ieee80211/ieee80211_softmac.c|  8 +--
 .../staging/rtl8192u/ieee80211/ieee80211_tx.c | 58 +++
 3 files changed, 34 insertions(+), 53 deletions(-)

-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8192e: Use %s and __func__ in strings

2019-05-14 Thread Puranjay Mohan
Fix following checkpatch.pl warnings by using %s and __func__
in strings instead of function names.

WARNING: Prefer using '"%s...", __func__' to using 
'_rtl92e_dm_check_rate_adaptive', this function's name, in a string
WARNING: Prefer using '"%s...", __func__' to using 'rtl92e_dm_restore_state', 
this function's name, in a string

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index 55d857926bba..1b7e3fda7905 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -334,7 +334,7 @@ static void _rtl92e_dm_check_rate_adaptive(struct 
net_device *dev)
 
if (!priv->up) {
RT_TRACE(COMP_RATE,
-"< _rtl92e_dm_check_rate_adaptive(): driver is 
going to unload\n");
+"< %s: driver is going to unload\n", __func__);
return;
}
 
@@ -1178,7 +1178,7 @@ void rtl92e_dm_restore_state(struct net_device *dev)
 
if (!priv->up) {
RT_TRACE(COMP_RATE,
-"< rtl92e_dm_restore_state(): driver is going to 
unload\n");
+"< %s: driver is going to unload\n", __func__);
return;
}
 
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: kpc2000: kpc_dma: include instead of

2019-05-15 Thread Puranjay Mohan
Fix following checkpatch.pl warning by including
 instead of .

WARNING: Use #include  instead of 

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/kpc2000/kpc_dma/dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/kpc2000/kpc_dma/dma.c 
b/drivers/staging/kpc2000/kpc_dma/dma.c
index 13687ab3e9c7..059932ab5907 100644
--- a/drivers/staging/kpc2000/kpc_dma/dma.c
+++ b/drivers/staging/kpc2000/kpc_dma/dma.c
@@ -2,7 +2,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8188eu: os_dep: Use %s and __func__ in strings

2019-05-15 Thread Puranjay Mohan
Fix following checkpatch.pl warnings by using %s and __func__
in strings instead of function names.

WARNING: Prefer using '"%s...", __func__' to using 'rtw_report_sec_ie', this 
function's name, in a string
and other similar warning.

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8188eu/os_dep/mlme_linux.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c 
b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c
index 9db11b16cb93..e660bd4d91ef 100644
--- a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c
@@ -93,11 +93,11 @@ void rtw_report_sec_ie(struct adapter *adapter, u8 
authmode, u8 *sec_ie)
union iwreq_data wrqu;
 
RT_TRACE(_module_mlme_osdep_c_, _drv_info_,
-("+rtw_report_sec_ie, authmode=%d\n", authmode));
+("+%s, authmode=%d\n", __func__, authmode));
buff = NULL;
if (authmode == _WPA_IE_ID_) {
RT_TRACE(_module_mlme_osdep_c_, _drv_info_,
-("rtw_report_sec_ie, authmode=%d\n", authmode));
+("%s, authmode=%d\n", __func__, authmode));
buff = rtw_malloc(IW_CUSTOM_MAX);
if (!buff)
return;
@@ -149,7 +149,7 @@ void rtw_indicate_sta_assoc_event(struct adapter *padapter, 
struct sta_info *pst
 
memcpy(wrqu.addr.sa_data, psta->hwaddr, ETH_ALEN);
 
-   DBG_88E("+rtw_indicate_sta_assoc_event\n");
+   DBG_88E("+%s\n", __func__);
 
wireless_send_event(padapter->pnetdev, IWEVREGISTERED, &wrqu, NULL);
 }
@@ -172,7 +172,7 @@ void rtw_indicate_sta_disassoc_event(struct adapter 
*padapter, struct sta_info *
 
memcpy(wrqu.addr.sa_data, psta->hwaddr, ETH_ALEN);
 
-   DBG_88E("+rtw_indicate_sta_disassoc_event\n");
+   DBG_88E("+%s\n", __func__);
 
wireless_send_event(padapter->pnetdev, IWEVEXPIRED, &wrqu, NULL);
 }
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8192u: ieee80211: Fix coding style issues related to if else

2019-05-15 Thread Puranjay Mohan
Fix positions of braces for if-else statements.

Signed-off-by: Puranjay Mohan 
---
 .../staging/rtl8192u/ieee80211/ieee80211_wx.c  | 18 ++
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
index dead134f6de0..204c3c0443a6 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
@@ -243,8 +243,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
 
list_for_each_entry(network, &ieee->network_list, list) {
i++;
-   if((stop-ev)<200)
-   {
+   if((stop-ev)<200) {
err = -E2BIG;
break;
}
@@ -761,8 +760,7 @@ int ieee80211_wx_set_auth(struct ieee80211_device *ieee,
} else if (data->value & IW_AUTH_ALG_LEAP) {
ieee->open_wep = 1;
ieee->auth_mode = 2;
-   }
-   else
+   } else
return -EINVAL;
break;
 
@@ -787,17 +785,14 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device 
*ieee, u8 *ie, size_t len)
 {
u8 *buf;
 
-   if (len>MAX_WPA_IE_LEN || (len && ie == NULL))
-   {
+   if (len>MAX_WPA_IE_LEN || (len && ie == NULL)) {
//  printk("return error out, len:%d\n", len);
return -EINVAL;
}
 
 
-   if (len)
-   {
-   if (len != ie[1]+2)
-   {
+   if (len) {
+   if (len != ie[1]+2) {
printk("len:%zu, ie:%d\n", len, ie[1]);
return -EINVAL;
}
@@ -807,8 +802,7 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, 
u8 *ie, size_t len)
kfree(ieee->wpa_ie);
ieee->wpa_ie = buf;
ieee->wpa_ie_len = len;
-   }
-   else{
+   } else {
kfree(ieee->wpa_ie);
ieee->wpa_ie = NULL;
ieee->wpa_ie_len = 0;
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8723bs: hal: Fix comparison to bool in if statements

2019-05-16 Thread Puranjay Mohan
Fix following warnings reported by coccicheck:
WARNING: Comparison to bool
by using !x in place of (x == false) and
x in place of (x == true).

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c  | 4 ++--
 drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c | 2 +-
 drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c  | 2 +-
 drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c| 6 +++---
 drivers/staging/rtl8723bs/hal/hal_com.c   | 2 +-
 drivers/staging/rtl8723bs/hal/odm_DIG.c   | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c 
b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c
index bae59e515348..19856e806b1f 100644
--- a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c
+++ b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c
@@ -299,7 +299,7 @@ void ODM_ReadAndConfig_MP_8723B_AGC_TAB(PDM_ODM_T pDM_Odm)
READ_NEXT_PAIR(v1, v2, i);
}
 
-   if (bMatched == false) {
+   if (!bMatched) {
/*  Condition isn't matched.
*   Discard the following (offset, data) pairs.
*/
@@ -568,7 +568,7 @@ void ODM_ReadAndConfig_MP_8723B_PHY_REG(PDM_ODM_T pDM_Odm)
READ_NEXT_PAIR(v1, v2, i);
}
 
-   if (bMatched == false) {
+   if (!bMatched) {
/*  Condition isn't matched.
*   Discard the following (offset, data) pairs.
*/
diff --git a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c 
b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c
index 3c8e26aba406..b80c5b11796b 100644
--- a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c
+++ b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c
@@ -270,7 +270,7 @@ void ODM_ReadAndConfig_MP_8723B_MAC_REG(PDM_ODM_T pDM_Odm)
READ_NEXT_PAIR(v1, v2, i);
}
 
-   if (bMatched == false) {
+   if (!bMatched) {
/*  Condition isn't matched. Discard the 
following (offset, data) pairs. */
while (v1 < 0x4000 && i < ArrayLen-2)
READ_NEXT_PAIR(v1, v2, i);
diff --git a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c 
b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c
index ba42b4d2a9c4..426f68b8f0d2 100644
--- a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c
+++ b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c
@@ -301,7 +301,7 @@ void ODM_ReadAndConfig_MP_8723B_RadioA(PDM_ODM_T pDM_Odm)
READ_NEXT_PAIR(v1, v2, i);
}
 
-   if (bMatched == false) {
+   if (!bMatched) {
/*  Condition isn't matched.
*   Discard the following (offset, data) pairs.
*/
diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c 
b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
index 53d3bdf21a6f..3239d37087c8 100644
--- a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
+++ b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
@@ -1292,7 +1292,7 @@ static void _PHY_SaveADDARegisters8723B(
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
PDM_ODM_T pDM_Odm = &pHalData->odmpriv;
 
-   if (ODM_CheckPowerStatus(padapter) == false)
+   if (!ODM_CheckPowerStatus(padapter))
return;
 
ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Save ADDA 
parameters.\n"));
@@ -1363,7 +1363,7 @@ static void _PHY_PathADDAOn8723B(
ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("ADDA 
ON.\n"));
 
pathOn = 0x01c00014;
-   if (false == is2T) {
+   if (!is2T) {
pathOn = 0x01c00014;
PHY_SetBBReg(pDM_Odm->Adapter, ADDAReg[0], bMaskDWord, 
0x01c00014);
} else {
@@ -1811,7 +1811,7 @@ void PHY_IQCalibrate_8723B(
u32 StartTime;
s32 ProgressingTime;
 
-   if (ODM_CheckPowerStatus(padapter) == false)
+   if (!ODM_CheckPowerStatus(padapter))
return;
 
if (!(pDM_Odm->SupportAbility & ODM_RF_CALIBRATION))
diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c 
b/drivers/staging/rtl8723bs/hal/hal_com.c
index e5f1153527b9..2763479f7601 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -125,7 +125,7 @@ u8 hal_com_config_channel_plan(
if (0xFF == hw_channel_plan)
AutoLoadFail = true;
 
-   if (false == Auto

[PATCH] Staging: rtl8192u: ieee80211: Use !x in place of NULL comparisons

2019-05-17 Thread Puranjay Mohan
Fix the following checkpatch.pl warning :
CHECK: Comparison to NULL could be written "!x"
by changing (x == NULL) to !x and (x != NULL) to x.

Signed-off-by: Puranjay Mohan 
---
 .../rtl8192u/ieee80211/ieee80211_module.c |  2 +-
 .../staging/rtl8192u/ieee80211/ieee80211_rx.c | 14 ++---
 .../rtl8192u/ieee80211/ieee80211_softmac.c|  4 ++--
 .../staging/rtl8192u/ieee80211/ieee80211_wx.c | 20 +--
 4 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
index d7975aa335b2..3532ea9a66c7 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
@@ -155,7 +155,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
ieee80211_softmac_init(ieee);
 
ieee->pHTInfo = kzalloc(sizeof(RT_HIGH_THROUGHPUT), GFP_KERNEL);
-   if (ieee->pHTInfo == NULL) {
+   if (!ieee->pHTInfo) {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc memory for 
HTInfo\n");
 
/* By this point in code ieee80211_networks_allocate() has been
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 5483df408049..0a3e478fccd6 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -67,7 +67,7 @@ ieee80211_frag_cache_find(struct ieee80211_device *ieee, 
unsigned int seq,
 
for (i = 0; i < IEEE80211_FRAG_CACHE_LEN; i++) {
entry = &ieee->frag_cache[tid][i];
-   if (entry->skb != NULL &&
+   if (entry->skb &&
time_after(jiffies, entry->first_frag_time + 2 * HZ)) {
IEEE80211_DEBUG_FRAG(
"expiring fragment cache entry "
@@ -77,7 +77,7 @@ ieee80211_frag_cache_find(struct ieee80211_device *ieee, 
unsigned int seq,
entry->skb = NULL;
}
 
-   if (entry->skb != NULL && entry->seq == seq &&
+   if (entry->skb && entry->seq == seq &&
(entry->last_frag + 1 == frag || frag == -1) &&
memcmp(entry->src_addr, src, ETH_ALEN) == 0 &&
memcmp(entry->dst_addr, dst, ETH_ALEN) == 0)
@@ -133,7 +133,7 @@ ieee80211_frag_cache_get(struct ieee80211_device *ieee,
if (ieee->frag_next_idx[tid] >= IEEE80211_FRAG_CACHE_LEN)
ieee->frag_next_idx[tid] = 0;
 
-   if (entry->skb != NULL)
+   if (entry->skb)
dev_kfree_skb_any(entry->skb);
 
entry->first_frag_time = jiffies;
@@ -1092,7 +1092,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
 ieee->iw_mode == IW_MODE_REPEAT) &&
!from_assoc_ap) {
switch (hostap_handle_sta_rx(ieee, dev, skb, rx_stats,
-wds != NULL)) {
+wds)) {
case AP_RX_CONTINUE_NOT_AUTHORIZED:
case AP_RX_CONTINUE:
break;
@@ -1388,7 +1388,7 @@ static int ieee80211_read_qos_param_element(struct 
ieee80211_qos_parameter_info
int ret = 0;
u16 size = sizeof(struct ieee80211_qos_parameter_info) - 2;
 
-   if ((info_element == NULL) || (element_param == NULL))
+   if (!info_element || !element_param)
return -1;
 
if (info_element->id == QOS_ELEMENT_ID && info_element->len == size) {
@@ -2508,7 +2508,7 @@ static inline void ieee80211_process_probe_response(
list_for_each_entry(target, &ieee->network_list, list) {
if (is_same_network(target, network, ieee))
break;
-   if ((oldest == NULL) ||
+   if (!oldest ||
(target->last_scanned < oldest->last_scanned))
oldest = target;
}
@@ -2577,7 +2577,7 @@ static inline void ieee80211_process_probe_response(
spin_unlock_irqrestore(&ieee->lock, flags);
if (is_beacon(beacon->header.frame_ctl) && 
is_same_network(&ieee->current_network, network, ieee) && \
(ieee->state == IEEE80211_LINKED)) {
-   if (ieee->handle_beacon != NULL)
+   if (ieee->handle_beacon)

ieee->handle_beacon(ieee->dev,beacon,&ieee->current_network);
}
 
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 9f54adede230..f38f9d8b78bb 100

[PATCH] Staging: rtl8723bs: os_dep: Remove unneeded variable for return

2019-05-17 Thread Puranjay Mohan
Remove unneeded variable "ret" and directly return 0 in functions.
Fix following coccicheck warning:
Unneeded variable: "ret". Return "0".

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c 
b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index db553f2e4c0b..b105ba698d55 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -2441,20 +2441,18 @@ void rtw_cfg80211_indicate_sta_disassoc(struct adapter 
*padapter, unsigned char
 
 static int rtw_cfg80211_monitor_if_open(struct net_device *ndev)
 {
-   int ret = 0;
 
DBG_8192C("%s\n", __func__);
 
-   return ret;
+   return 0;
 }
 
 static int rtw_cfg80211_monitor_if_close(struct net_device *ndev)
 {
-   int ret = 0;
 
DBG_8192C("%s\n", __func__);
 
-   return ret;
+   return 0;
 }
 
 static netdev_tx_t rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, 
struct net_device *ndev)
@@ -2606,11 +2604,10 @@ static netdev_tx_t 
rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struc
 
 static int rtw_cfg80211_monitor_if_set_mac_address(struct net_device *ndev, 
void *addr)
 {
-   int ret = 0;
 
DBG_8192C("%s\n", __func__);
 
-   return ret;
+   return 0;
 }
 
 static const struct net_device_ops rtw_cfg80211_monitor_if_ops = {
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: mt7621-dma: Remove braces around single if statement

2019-05-19 Thread Puranjay Mohan
Fix following checkpatch.pl warning by removing unnecessary braces:
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/mt7621-dma/mtk-hsdma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/mt7621-dma/mtk-hsdma.c 
b/drivers/staging/mt7621-dma/mtk-hsdma.c
index 0fbb9932d6bb..a58725dd2611 100644
--- a/drivers/staging/mt7621-dma/mtk-hsdma.c
+++ b/drivers/staging/mt7621-dma/mtk-hsdma.c
@@ -664,9 +664,8 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
return -EINVAL;
 
hsdma = devm_kzalloc(&pdev->dev, sizeof(*hsdma), GFP_KERNEL);
-   if (!hsdma) {
+   if (!hsdma)
return -EINVAL;
-   }
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(&pdev->dev, res);
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8188eu: core: Remove else after break

2019-05-20 Thread Puranjay Mohan
Remove else after break statements to fix following checkpatch.pl
warnings:
WARNING: else is not generally useful after a break or return.

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8188eu/core/rtw_mlme.c | 26 +++
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme.c
index 9a4aad5ec365..0abb2df32645 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c
@@ -1330,11 +1330,10 @@ void _rtw_join_timeout_handler (struct timer_list *t)
continue;
}
break;
-   } else {
-   DBG_88E("%s We've try roaming but fail\n", 
__func__);
-   rtw_indicate_disconnect(adapter);
-   break;
}
+   DBG_88E("%s We've try roaming but fail\n", __func__);
+   rtw_indicate_disconnect(adapter);
+   break;
}
} else {
rtw_indicate_disconnect(adapter);
@@ -2058,17 +2057,16 @@ void _rtw_roaming(struct adapter *padapter, struct 
wlan_network *tgt_network)
do_join_r = rtw_do_join(padapter);
if (do_join_r == _SUCCESS) {
break;
-   } else {
-   DBG_88E("roaming do_join return %d\n", 
do_join_r);
-   pmlmepriv->to_roaming--;
+   }
+   DBG_88E("roaming do_join return %d\n", do_join_r);
+   pmlmepriv->to_roaming--;
 
-   if (pmlmepriv->to_roaming > 0) {
-   continue;
-   } else {
-   DBG_88E("%s(%d) -to roaming fail, 
indicate_disconnect\n", __func__, __LINE__);
-   rtw_indicate_disconnect(padapter);
-   break;
-   }
+   if (pmlmepriv->to_roaming > 0) {
+   continue;
+   } else {
+   DBG_88E("%s(%d) -to roaming fail, 
indicate_disconnect\n", __func__, __LINE__);
+   rtw_indicate_disconnect(padapter);
+   break;
}
}
}
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8192u: ieee80211: Fix if-else coding style issue

2019-05-20 Thread Puranjay Mohan
Fix following checkpatch.pl warning by adding braces around if
statement:
CHECK: braces {} should be used on all arms of this statement

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index aab1586fe0dd..4a8d16a45fc5 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -244,9 +244,9 @@ int ieee80211_wx_set_rts(struct ieee80211_device *ieee,
 struct iw_request_info *info,
 union iwreq_data *wrqu, char *extra)
 {
-   if (wrqu->rts.disabled || !wrqu->rts.fixed)
+   if (wrqu->rts.disabled || !wrqu->rts.fixed) {
ieee->rts = DEFAULT_RTS_THRESHOLD;
-   else {
+   } else {
if (wrqu->rts.value < MIN_RTS_THRESHOLD ||
wrqu->rts.value > MAX_RTS_THRESHOLD)
return -EINVAL;
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8723bs: os_dep: Remove functions that don't do anything.

2019-05-21 Thread Puranjay Mohan
Remove functions which just print the name of function and return 0,
These functions fake the network core to say that they support these
options.

Signed-off-by: Puranjay Mohan 
---
 .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 28 +--
 1 file changed, 1 insertion(+), 27 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c 
b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 12f8e3e6b1b6..996bd1a674cc 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -2439,23 +2439,7 @@ void rtw_cfg80211_indicate_sta_disassoc(struct adapter 
*padapter, unsigned char
cfg80211_del_sta(ndev, da, GFP_ATOMIC);
 }
 
-static int rtw_cfg80211_monitor_if_open(struct net_device *ndev)
-{
-   int ret = 0;
-
-   DBG_8192C("%s\n", __func__);
-
-   return ret;
-}
-
-static int rtw_cfg80211_monitor_if_close(struct net_device *ndev)
-{
-   int ret = 0;
 
-   DBG_8192C("%s\n", __func__);
-
-   return ret;
-}
 
 static netdev_tx_t rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, 
struct net_device *ndev)
 {
@@ -2604,20 +2588,10 @@ static netdev_tx_t 
rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struc
 
 }
 
-static int rtw_cfg80211_monitor_if_set_mac_address(struct net_device *ndev, 
void *addr)
-{
-   int ret = 0;
-
-   DBG_8192C("%s\n", __func__);
 
-   return ret;
-}
 
 static const struct net_device_ops rtw_cfg80211_monitor_if_ops = {
-   .ndo_open = rtw_cfg80211_monitor_if_open,
-   .ndo_stop = rtw_cfg80211_monitor_if_close,
-   .ndo_start_xmit = rtw_cfg80211_monitor_if_xmit_entry,
-   .ndo_set_mac_address = rtw_cfg80211_monitor_if_set_mac_address,
+   .ndo_start_xmit = rtw_cfg80211_monitor_if_xmit_entry,
 };
 
 static int rtw_cfg80211_add_monitor_if (struct adapter *padapter, char *name, 
struct net_device **ndev)
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8192u: ieee80211: Replace function names in strings with "%s", __func__

2019-05-21 Thread Puranjay Mohan
Use "%s", __func__ in place of strings which contain function names.

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index 7cac668bfb0b..59d179ae7ad2 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -51,7 +51,7 @@ static void RxPktPendingTimeout(struct timer_list *t)
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);
+   IEEE80211_DEBUG(IEEE80211_DL_REORDER, "%s: 
IndicateSeq: %d\n", __func__, pReorderEntry->SeqNum);
ieee->stats_IndicateArray[index] = 
pReorderEntry->prxb;
index++;
 
@@ -97,7 +97,7 @@ static void TsAddBaProcess(struct timer_list *t)
struct ieee80211_device *ieee = container_of(pTxTs, struct 
ieee80211_device, TxTsRecord[num]);
 
TsInitAddBA(ieee, pTxTs, BA_POLICY_IMMEDIATE, false);
-   IEEE80211_DEBUG(IEEE80211_DL_BA, "TsAddBaProcess(): ADDBA Req is 
started!! \n");
+   IEEE80211_DEBUG(IEEE80211_DL_BA, "%s: ADDBA Req is started!! \n", 
__func__);
 }
 
 
@@ -456,7 +456,7 @@ void RemovePeerTS(struct ieee80211_device *ieee, u8 *Addr)
 {
struct ts_common_info   *pTS, *pTmpTS;
 
-   printk("===>RemovePeerTS,%pM\n", Addr);
+   printk("===>%s,%pM\n", __func__, Addr);
list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, list) {
if (memcmp(pTS->addr, Addr, 6) == 0) {
RemoveTsEntry(ieee, pTS, TX_DIR);
@@ -525,11 +525,11 @@ void TsStartAddBaProcess(struct ieee80211_device *ieee, 
struct tx_ts_record *pTx
if (!pTxTS->add_ba_req_in_progress) {
pTxTS->add_ba_req_in_progress = true;
if (pTxTS->add_ba_req_delayed)  {
-   IEEE80211_DEBUG(IEEE80211_DL_BA, 
"TsStartAddBaProcess(): Delayed Start ADDBA after 60 sec!!\n");
+   IEEE80211_DEBUG(IEEE80211_DL_BA, "%s: Delayed Start 
ADDBA after 60 sec!!\n", __func__);
mod_timer(&pTxTS->ts_add_ba_timer,
  jiffies + msecs_to_jiffies(TS_ADDBA_DELAY));
} else {
-   IEEE80211_DEBUG(IEEE80211_DL_BA, 
"TsStartAddBaProcess(): Immediately Start ADDBA now!!\n");
+   IEEE80211_DEBUG(IEEE80211_DL_BA, "%s: Immediately Start 
ADDBA now!!\n", __func__);
mod_timer(&pTxTS->ts_add_ba_timer, jiffies+10); //set 
10 ticks
}
} else {
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8188eu: os_dep: Replace comparison with zero to !x

2019-05-21 Thread Puranjay Mohan
Change comparison to zero to !x.
Replace (x == 0) to !x.

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8188eu/os_dep/rtw_android.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/rtw_android.c 
b/drivers/staging/rtl8188eu/os_dep/rtw_android.c
index 7a090615dcbc..daf6db354982 100644
--- a/drivers/staging/rtl8188eu/os_dep/rtw_android.c
+++ b/drivers/staging/rtl8188eu/os_dep/rtw_android.c
@@ -67,7 +67,7 @@ int rtw_android_cmdstr_to_num(char *cmdstr)
int cmd_num;
 
for (cmd_num = 0; cmd_num < ANDROID_WIFI_CMD_MAX; cmd_num++)
-   if (0 == strncasecmp(cmdstr, android_wifi_cmd_str[cmd_num],
+   if (!strncasecmp(cmdstr, android_wifi_cmd_str[cmd_num],
  strlen(android_wifi_cmd_str[cmd_num])))
break;
return cmd_num;
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8188eu: core: Use !x in place of NULL comparisons

2019-05-21 Thread Puranjay Mohan
Change (x == NULL) to !x and (x != NULL) to x, to fix
following checkpatch.pl warnings:
CHECK: Comparison to NULL could be written "!x".

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8188eu/core/rtw_recv.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c 
b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 087f6c9a5826..9caf7041ad60 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -450,7 +450,7 @@ static struct recv_frame *portctrl(struct adapter *adapter,
memcpy(&be_tmp, ptr, 2);
ether_type = ntohs(be_tmp);
 
-   if ((psta != NULL) && (psta->ieee8021x_blocked)) {
+   if (psta && (psta->ieee8021x_blocked)) {
/* blocked */
/* only accept EAPOL frame */
RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, 
("%s:psta->ieee8021x_blocked==1\n", __func__));
@@ -700,7 +700,7 @@ static int sta2sta_data_frame(struct adapter *adapter,
else
*psta = rtw_get_stainfo(pstapriv, sta_addr); /*  get ap_info */
 
-   if (*psta == NULL) {
+   if (!*psta) {
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("can't get psta 
under %s ; drop pkt\n", __func__));
ret = _FAIL;
goto exit;
@@ -764,7 +764,7 @@ static int ap2sta_data_frame(
else
*psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /*  
get ap_info */
 
-   if (*psta == NULL) {
+   if (!*psta) {
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("ap2sta: 
can't get psta under STATION_MODE ; drop pkt\n"));
ret = _FAIL;
goto exit;
@@ -786,7 +786,7 @@ static int ap2sta_data_frame(
} else {
if (!memcmp(myhwaddr, pattrib->dst, ETH_ALEN) && !mcast) {
*psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /*  
get sta_info */
-   if (*psta == NULL) {
+   if (!*psta) {
DBG_88E("issue_deauth to the ap =%pM for the 
reason(7)\n", (pattrib->bssid));
 
issue_deauth(adapter, pattrib->bssid, 
WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
@@ -820,7 +820,7 @@ static int sta2ap_data_frame(struct adapter *adapter,
}
 
*psta = rtw_get_stainfo(pstapriv, pattrib->src);
-   if (*psta == NULL) {
+   if (!*psta) {
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("can't 
get psta under AP_MODE; drop pkt\n"));
DBG_88E("issue_deauth to sta=%pM for the reason(7)\n", 
(pattrib->src));
 
@@ -883,7 +883,7 @@ static int validate_recv_ctrl_frame(struct adapter 
*padapter,
aid = GetAid(pframe);
psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
 
-   if ((psta == NULL) || (psta->aid != aid))
+   if ((!psta) || (psta->aid != aid))
return _FAIL;
 
/* for rx pkt statistics */
@@ -1479,7 +1479,7 @@ struct recv_frame *recvframe_chk_defrag(struct adapter 
*padapter,
}
}
 
-   if ((prtnframe != NULL) && (prtnframe->attrib.privacy)) {
+   if (prtnframe && (prtnframe->attrib.privacy)) {
/* after defrag we must check tkip mic code */
if (recvframe_chkmic(padapter,  prtnframe) == _FAIL) {
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, 
("recvframe_chkmic(padapter,  prtnframe)==_FAIL\n"));
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8723bs: os_dep: Remove functions that don't perform any task

2019-05-22 Thread Puranjay Mohan
Remove functions which return 0 without performing any task.
Fix following warnings issued by coccicheck:
Unneeded variable: "err". Return "0" on line 4484
and similar other warnings.

Signed-off-by: Puranjay Mohan 
---
 .../staging/rtl8723bs/os_dep/ioctl_linux.c| 41 ---
 1 file changed, 41 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c 
b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index bfbbcf0bded3..3b5f3e9ae5f7 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -4476,43 +4476,6 @@ static int rtw_pm_set(struct net_device *dev,
return ret;
 }
 
-static int rtw_mp_efuse_get(struct net_device *dev,
-   struct iw_request_info *info,
-   union iwreq_data *wdata, char *extra)
-{
-   int err = 0;
-   return err;
-}
-
-static int rtw_mp_efuse_set(struct net_device *dev,
-   struct iw_request_info *info,
-   union iwreq_data *wdata, char *extra)
-{
-   int err = 0;
-   return err;
-}
-
-static int rtw_tdls(struct net_device *dev,
-   struct iw_request_info *info,
-   union iwreq_data *wrqu, char *extra)
-{
-   int ret = 0;
-   return ret;
-}
-
-
-static int rtw_tdls_get(struct net_device *dev,
-   struct iw_request_info *info,
-   union iwreq_data *wrqu, char *extra)
-{
-   int ret = 0;
-   return ret;
-}
-
-
-
-
-
 static int rtw_test(
struct net_device *dev,
struct iw_request_info *info,
@@ -4789,15 +4752,11 @@ static iw_handler rtw_private_handler[] = {
NULL,   /* 0x12 */
rtw_p2p_get2,   /* 0x13 */
 
-   rtw_tdls,   /* 0x14 */
-   rtw_tdls_get,   /* 0x15 */
 
rtw_pm_set, /* 0x16 */
rtw_wx_priv_null,   /* 0x17 */
rtw_rereg_nd_name,  /* 0x18 */
rtw_wx_priv_null,   /* 0x19 */
-   rtw_mp_efuse_set,   /* 0x1A */
-   rtw_mp_efuse_get,   /* 0x1B */
NULL,   /*  0x1C is 
reserved for hostapd */
rtw_test,   /*  0x1D */
 };
-- 
2.21.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Drivers: rtl8188eu: core: Fix coding style issue

2020-07-01 Thread Puranjay Mohan
Use %s and  __func__ in place of function names.
This solves following checkpatch.pl warning
WARNING: Prefer using '"%s...", __func__' to using 'rtw_do_join', this 
function's name, in a string

Signed-off-by: Puranjay Mohan 
---
 drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c 
b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
index 7bb26c362b10..9cc77ab4fd6b 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
@@ -25,7 +25,7 @@ u8 rtw_do_join(struct adapter *padapter)
phead = get_list_head(queue);
plist = phead->next;
 
-   RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("\n rtw_do_join: 
phead = %p; plist = %p\n\n\n", phead, plist));
+   RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("\n %s: phead = %p; 
plist = %p\n\n\n", __func__, phead, plist));
 
pmlmepriv->cur_network.join_res = -2;
 
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v1] Staging: rtl8188eu: core: Fix coding style issue

2020-07-01 Thread Puranjay Mohan
Use %s and  __func__ in place of function names.
This solves following checkpatch.pl warning
WARNING: Prefer using '"%s...", __func__' to using 'rtw_do_join', this 
function's name, in a string

Signed-off-by: Puranjay Mohan 
---
V1: Add staging in the subject.
---
 drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c 
b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
index 7bb26c362b10..9cc77ab4fd6b 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
@@ -25,7 +25,7 @@ u8 rtw_do_join(struct adapter *padapter)
phead = get_list_head(queue);
plist = phead->next;
 
-   RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("\n rtw_do_join: 
phead = %p; plist = %p\n\n\n", phead, plist));
+   RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("\n %s: phead = %p; 
plist = %p\n\n\n", __func__, phead, plist));
 
pmlmepriv->cur_network.join_res = -2;
 
-- 
2.27.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel