[PATCH] staging: rtl8192e: Using comparison to true is error prone

2020-05-20 Thread John Oldman
fix below issue reported by checkpatch.pl:

CHECK: Using comparison to true is error prone
CHECK: Using comparison to false is error prone

Signed-off-by: John Oldman 
---
 drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c 
b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index b093b5629171..5b1392deb0a7 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -514,7 +514,7 @@ static void rtw_dev_remove(struct sdio_func *func)
 
rtw_unregister_netdevs(dvobj);
 
-   if (padapter->bSurpriseRemoved == false) {
+   if (!padapter->bSurpriseRemoved) {
int err;
 
/* test surprise remove */
@@ -554,12 +554,12 @@ static int rtw_sdio_suspend(struct device *dev)
struct adapter *padapter = psdpriv->if1;
struct debug_priv *pdbgpriv = >drv_dbg;
 
-   if (padapter->bDriverStopped == true) {
+   if (padapter->bDriverStopped) {
DBG_871X("%s bDriverStopped = %d\n", __func__, 
padapter->bDriverStopped);
return 0;
}
 
-   if (pwrpriv->bInSuspend == true) {
+   if (pwrpriv->bInSuspend) {
DBG_871X("%s bInSuspend = %d\n", __func__, pwrpriv->bInSuspend);
pdbgpriv->dbg_suspend_error_cnt++;
return 0;
@@ -574,7 +574,7 @@ static int rtw_resume_process(struct adapter *padapter)
struct dvobj_priv *psdpriv = padapter->dvobj;
struct debug_priv *pdbgpriv = >drv_dbg;
 
-   if (pwrpriv->bInSuspend == false) {
+   if (!pwrpriv->bInSuspend) {
pdbgpriv->dbg_resume_error_cnt++;
DBG_871X("%s bInSuspend = %d\n", __func__, pwrpriv->bInSuspend);
return -1;
-- 
2.17.1



[PATCH] staging: rtl8192e: Using comparison to true is error prone

2020-05-23 Thread John Oldman
clear below issues reported by checkpatch.pl:

CHECK: Using comparison to false is error prone

Signed-off-by: John Oldman 
---
 drivers/staging/rtl8192e/rtl819x_HTProc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c 
b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index d83d72594312..8abc921ecb3e 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -371,7 +371,7 @@ void HTConstructInfoElement(struct rtllib_device *ieee, u8 
*posHTInfo,
if ((ieee->iw_mode == IW_MODE_ADHOC) ||
(ieee->iw_mode == IW_MODE_MASTER)) {
pHTInfoEle->ControlChl  = ieee->current_network.channel;
-   pHTInfoEle->ExtChlOffset = ((pHT->bRegBW40MHz == false) ?
+   pHTInfoEle->ExtChlOffset = ((!pHT->bRegBW40MHz) ?
HT_EXTCHNL_OFFSET_NO_EXT :
(ieee->current_network.channel <= 6)
? HT_EXTCHNL_OFFSET_UPPER :
@@ -526,7 +526,7 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
static u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33};
static u8 EWC11NHTInfo[] = {0x00, 0x90, 0x4c, 0x34};
 
-   if (pHTInfo->bCurrentHTSupport == false) {
+   if (!pHTInfo->bCurrentHTSupport) {
netdev_warn(ieee->dev, "%s(): HT_DISABLE\n", __func__);
return;
}
@@ -873,7 +873,7 @@ void HTSetConnectBwMode(struct rtllib_device *ieee,
 {
struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
 
-   if (pHTInfo->bRegBW40MHz == false)
+   if (!pHTInfo->bRegBW40MHz)
return;
 
if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))
-- 
2.17.1



[PATCH] staging: rtl8192e: Using comparison to false is error prone

2020-06-02 Thread John Oldman
clear below issues reported by checkpatch.pl:

CHECK: Using comparison to false is error prone

Signed-off-by: John Oldman 
---
 drivers/staging/rtl8192e/rtl819x_HTProc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c 
b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index d83d72594312..8abc921ecb3e 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -371,7 +371,7 @@ void HTConstructInfoElement(struct rtllib_device *ieee, u8 
*posHTInfo,
if ((ieee->iw_mode == IW_MODE_ADHOC) ||
(ieee->iw_mode == IW_MODE_MASTER)) {
pHTInfoEle->ControlChl  = ieee->current_network.channel;
-   pHTInfoEle->ExtChlOffset = ((pHT->bRegBW40MHz == false) ?
+   pHTInfoEle->ExtChlOffset = ((!pHT->bRegBW40MHz) ?
HT_EXTCHNL_OFFSET_NO_EXT :
(ieee->current_network.channel <= 6)
? HT_EXTCHNL_OFFSET_UPPER :
@@ -526,7 +526,7 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
static u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33};
static u8 EWC11NHTInfo[] = {0x00, 0x90, 0x4c, 0x34};
 
-   if (pHTInfo->bCurrentHTSupport == false) {
+   if (!pHTInfo->bCurrentHTSupport) {
netdev_warn(ieee->dev, "%s(): HT_DISABLE\n", __func__);
return;
}
@@ -873,7 +873,7 @@ void HTSetConnectBwMode(struct rtllib_device *ieee,
 {
struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
 
-   if (pHTInfo->bRegBW40MHz == false)
+   if (!pHTInfo->bRegBW40MHz)
return;
 
if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))
-- 
2.17.1



[PATCH] staging: media: usbvision: usbvision-core Correct spelling

2020-04-28 Thread John Oldman
Correct spelling in comment

Signed-off-by: John Oldman 
---
 drivers/staging/media/usbvision/usbvision-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/usbvision/usbvision-core.c 
b/drivers/staging/media/usbvision/usbvision-core.c
index f05a5c84dc18..e35dee35b068 100644
--- a/drivers/staging/media/usbvision/usbvision-core.c
+++ b/drivers/staging/media/usbvision/usbvision-core.c
@@ -1268,7 +1268,7 @@ static void usbvision_isoc_irq(struct urb *urb)
if (!USBVISION_IS_OPERATIONAL(usbvision))
return;
 
-   /* any urb with wrong status is ignored without acknowledgement */
+   /* any urb with wrong status is ignored without acknowledgment */
if (urb->status == -ENOENT)
return;
 
-- 
2.17.1



[PATCH-3] staging: rts5208: rtsx: Use balanced braces for if/else if blocks

2020-04-28 Thread John Oldman
Coding style issues

Signed-off-by: John Oldman 
---
 v1: Initial attempt
 v2: Do more blocks
 v3: Single patch
 drivers/staging/rts5208/rtsx.c | 20 +++-
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
index be0053c795b7..e16a7b9c3203 100644
--- a/drivers/staging/rts5208/rtsx.c
+++ b/drivers/staging/rts5208/rtsx.c
@@ -402,27 +402,21 @@ static int rtsx_control_thread(void *__dev)
if (chip->srb->sc_data_direction == DMA_BIDIRECTIONAL) {
dev_err(>pci->dev, "UNKNOWN data direction\n");
chip->srb->result = DID_ERROR << 16;
-   }
-
-   /* reject if target != 0 or if LUN is higher than
-* the maximum known LUN
-*/
-   else if (chip->srb->device->id) {
+   } else if (chip->srb->device->id) {
+   /* reject if target != 0 or if LUN is higher than
+* the maximum known LUN
+*/
dev_err(>pci->dev, "Bad target number (%d:%d)\n",
chip->srb->device->id,
(u8)chip->srb->device->lun);
chip->srb->result = DID_BAD_TARGET << 16;
-   }
-
-   else if (chip->srb->device->lun > chip->max_lun) {
+   } else if (chip->srb->device->lun > chip->max_lun) {
dev_err(>pci->dev, "Bad LUN (%d:%d)\n",
chip->srb->device->id,
(u8)chip->srb->device->lun);
chip->srb->result = DID_BAD_TARGET << 16;
-   }
-
-   /* we've got a command, let's do it! */
-   else {
+   } else {
+   /* we've got a command, let's do it! */
scsi_show_command(chip);
rtsx_invoke_transport(chip->srb, chip);
}
-- 
2.17.1



Re: [PATCH] Staging: mt7621-dma: mtk-hsdma.c: Fix Missing a blank line after declarations

2020-04-28 Thread John Oldman
(this time sent as plain text)

I was not so happy about this one, even though I went and committed it.

Without the blank line checkpatch reports:

WARNING: Missing a blank line after declarations
#160: FILE: drivers/staging/mt7621-dma/mtk-hsdma.c:160:
+ struct tasklet_struct task;
+ volatile unsigned long chan_issued;

So I dumly inserted a blank line to silence checkpatch.

In hindsight maybe a false positive, blank lines in a struct!

Someone may have been there before as there is a previous blank line
in the struct mtk_hsdam_engine :o)

Cheers
John


On Sun, 26 Apr 2020 at 18:07, Greg KH  wrote:
>
> On Sun, Apr 26, 2020 at 05:13:19PM +0100, John Oldman wrote:
> > Fixed coding style issue
>
> No you didn't :)
>
> >
> > Signed-off-by: John Oldman 
> > ---
> >  drivers/staging/mt7621-dma/mtk-hsdma.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/staging/mt7621-dma/mtk-hsdma.c 
> > b/drivers/staging/mt7621-dma/mtk-hsdma.c
> > index 14592ed9ce98..dd35d0bce6ca 100644
> > --- a/drivers/staging/mt7621-dma/mtk-hsdma.c
> > +++ b/drivers/staging/mt7621-dma/mtk-hsdma.c
> > @@ -157,6 +157,7 @@ struct mtk_hsdam_engine {
> >   struct device_dma_parameters dma_parms;
> >   void __iomem *base;
> >   struct tasklet_struct task;
> > +
> >   volatile unsigned long chan_issued;
> >
> >   struct mtk_hsdma_chan chan[1];
>
> This file seems to be the "does the submitter look at the patch they are
> sending" litmus test.
>
> Does that really do what you think it does?
>
> thanks,
>
> greg k-h


[PATCH V2] Subject: [PATCH] staging: rtl8723bs: core: Using comparison to true is error prone

2020-07-25 Thread John Oldman
clear below issues reported by checkpatch.pl:

CHECK: Using comparison to true is error prone

Signed-off-by: John Oldman 
---
v1: Initial attempt.
v2: Removed unneccessary parentheses around 'pregistrypriv->ht_enable'
Also considered clearing 'CHECK: Logical continuations should be on the 
previous line' report
but this results in exceeding line length guideline.
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c 
b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index ca98274ae390..7aacbe1b763e 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -363,8 +363,9 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
}

/* HT Cap. */
-   if (((pregistrypriv->wireless_mode_11_5N) || 
(pregistrypriv->wireless_mode_11_24N))
-   && (pregistrypriv->ht_enable == true)) {
+   if (((pregistrypriv->wireless_mode & WIRELESS_11_5N)
+ || (pregistrypriv->wireless_mode & WIRELESS_11_24N))
+ && pregistrypriv->ht_enable) {
/* todo: */
}

--
2.17.1



[PATCH V3] staging: rtl8723bs: core: Using comparison to true is error prone

2020-07-25 Thread John Oldman
clear below issues reported by checkpatch.pl:

CHECK: Using comparison to true is error prone

Signed-off-by: John Oldman 
---
v1- First attempt: removed comparison to true.
v2- Removed unneccessary parentheses around 'pregistrypriv->ht_enable, missed 
in v1.
v3- Corrected the 'odd' subject line; moved the || and && to the end of the 
line.

 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c 
b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index ca98274ae390..46fad71197b6 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -363,8 +363,9 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
}

/* HT Cap. */
-   if (((pregistrypriv->wireless_mode_11_5N) || 
(pregistrypriv->wireless_mode_11_24N))
-   && (pregistrypriv->ht_enable == true)) {
+   if (((pregistrypriv->wireless_mode & WIRELESS_11_5N) ||
+(pregistrypriv->wireless_mode & WIRELESS_11_24N)) &&
+pregistrypriv->ht_enable) {
/* todo: */
}

--
2.17.1



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

2020-05-15 Thread John Oldman
Coding style issues:
This patch clears the checkpatch.pl "braces {} are not necessary for
single statement blocks" and "else_should_follow_close_brace"
warnings."

Signed-off-by: John Oldman 
---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 49 +++--
 1 file changed, 17 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c 
b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index d29f59bbb613..479049cb16e5 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -1057,8 +1057,7 @@ static int pm_netdev_open(struct net_device *pnetdev, u8 
bnormal)
status = _netdev_open(pnetdev);

mutex_unlock(&(adapter_to_dvobj(padapter)->hw_init_mutex));
}
-   }
-   else
+   } else
status =  (_SUCCESS == ips_netdrv_open(padapter)) ? (0) : (-1);
 
return status;
@@ -1167,9 +1166,8 @@ void rtw_dev_unload(struct adapter *padapter)
DBG_871X_LEVEL(_drv_always_, "%s: driver in 
IPS-FWLPS\n", __func__);
pdbgpriv->dbg_dev_unload_inIPS_cnt++;
LeaveAllPowerSaveMode(padapter);
-   } else {
+   } else
DBG_871X_LEVEL(_drv_always_, "%s: driver not in IPS\n", 
__func__);
-   }
 
if (padapter->bSurpriseRemoved == false) {
hal_btcoex_IpsNotify(padapter, pwrctl->ips_mode_req);
@@ -1177,8 +1175,7 @@ void rtw_dev_unload(struct adapter *padapter)
if (pwrctl->bSupportRemoteWakeup == true &&
pwrctl->wowlan_mode == true) {
DBG_871X_LEVEL(_drv_always_, "%s 
bSupportRemoteWakeup ==true  do not run rtw_hal_deinit()\n", __func__);
-   }
-   else
+   } else
 #endif
{
/* amy modify 20120221 for power seq is 
different between driver open and ips */
@@ -1192,8 +1189,7 @@ void rtw_dev_unload(struct adapter *padapter)
padapter->bup = false;
 
DBG_871X("<=== %s\n", __func__);
-   }
-   else {
+   } else {
RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("%s: bup 
==false\n", __func__));
DBG_871X("%s: bup ==false\n", __func__);
}
@@ -1223,10 +1219,8 @@ static int rtw_suspend_free_assoc_resource(struct 
adapter *padapter)
rtw_disassoc_cmd(padapter, 0, false);
/* s2-2.  indicate disconnect to os */
rtw_indicate_disconnect(padapter);
-   }
-   else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
+   } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
rtw_sta_flush(padapter);
-   }
 
/* s2-3. */
rtw_free_assoc_resources(padapter, 1);
@@ -1264,15 +1258,15 @@ void rtw_suspend_wow(struct adapter *padapter)
if (pwrpriv->wowlan_mode == true) {
if (pnetdev)
rtw_netif_stop_queue(pnetdev);
+
/*  1. stop thread */
padapter->bDriverStopped = true;/* for stop thread */
rtw_stop_drv_threads(padapter);
padapter->bDriverStopped = false;   /* for 32k command */
 
/*  2. disable interrupt */
-   if (padapter->intf_stop) {
+   if (padapter->intf_stop)
padapter->intf_stop(padapter);
-   }
 
/*  2.1 clean interrupt */
if (padapter->HalFunc.clear_interrupt)
@@ -1316,10 +1310,9 @@ void rtw_suspend_wow(struct adapter *padapter)
DBG_871X_LEVEL(_drv_always_, "%s: pno: %d\n", __func__, 
pwrpriv->wowlan_pno_enable);
else
rtw_set_ps_mode(padapter, PS_MODE_DTIM, 0, 0, "WOWLAN");
-   }
-   else {
+   } else
DBG_871X_LEVEL(_drv_always_, "%s: ### ERROR ### wowlan_mode 
=%d\n", __func__, pwrpriv->wowlan_mode);
-   }
+
DBG_871X("<== " FUNC_ADPT_FMT " exit\n", FUNC_ADPT_ARG(padapter));
 }
 #endif /* ifdef CONFIG_WOWLAN */
@@ -1448,14 +1441,13 @@ int rtw_suspend_common(struct adapter *padapter)
 
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) {
#ifdef CONFIG_WOWLAN
-   if (check_fwstate(pmlmepriv, _FW_LINKED)) {
+   if (check_fwstate(pmlmepriv, _FW_LINKED))
pwrpriv->wowlan_mode = true;
-   } else if (pwrpriv->wowlan_pno_enable == true) {
+   else if (pwrpriv->wowlan_pno_enable == true)
pwr

[PATCH] Staging: rtl8723bs: os_de: if-else coding style issue

2020-05-15 Thread John Oldman
Coding style issues:
This patch clears the checkpatch.pl "braces {} are not necessary for
single statement blocks" and "else_should_follow_close_brace"
warnings.

Signed-off-by: John Oldman 
---
v1: First attempt
v2: Followed The rule is that "if one side of the if else statement
has curly braces then all sides get curly braces even if they're
just one line long."

 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 33 -
 1 file changed, 12 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c 
b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index d29f59bbb613..50a3c2c3a8d2 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -1057,9 +1057,9 @@ static int pm_netdev_open(struct net_device *pnetdev, u8 
bnormal)
status = _netdev_open(pnetdev);

mutex_unlock(&(adapter_to_dvobj(padapter)->hw_init_mutex));
}
-   }
-   else
+   } else {
status =  (_SUCCESS == ips_netdrv_open(padapter)) ? (0) : (-1);
+   }
 
return status;
 }
@@ -1192,8 +1192,7 @@ void rtw_dev_unload(struct adapter *padapter)
padapter->bup = false;
 
DBG_871X("<=== %s\n", __func__);
-   }
-   else {
+   } else {
RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("%s: bup 
==false\n", __func__));
DBG_871X("%s: bup ==false\n", __func__);
}
@@ -1223,8 +1222,7 @@ static int rtw_suspend_free_assoc_resource(struct adapter 
*padapter)
rtw_disassoc_cmd(padapter, 0, false);
/* s2-2.  indicate disconnect to os */
rtw_indicate_disconnect(padapter);
-   }
-   else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
+   } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
rtw_sta_flush(padapter);
}
 
@@ -1270,9 +1268,8 @@ void rtw_suspend_wow(struct adapter *padapter)
padapter->bDriverStopped = false;   /* for 32k command */
 
/*  2. disable interrupt */
-   if (padapter->intf_stop) {
+   if (padapter->intf_stop)
padapter->intf_stop(padapter);
-   }
 
/*  2.1 clean interrupt */
if (padapter->HalFunc.clear_interrupt)
@@ -1448,14 +1445,13 @@ int rtw_suspend_common(struct adapter *padapter)
 
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) {
#ifdef CONFIG_WOWLAN
-   if (check_fwstate(pmlmepriv, _FW_LINKED)) {
+   if (check_fwstate(pmlmepriv, _FW_LINKED))
pwrpriv->wowlan_mode = true;
-   } else if (pwrpriv->wowlan_pno_enable == true) {
+   else if (pwrpriv->wowlan_pno_enable == true)
pwrpriv->wowlan_mode |= pwrpriv->wowlan_pno_enable;
-   }
 
if (pwrpriv->wowlan_mode == true)
-   rtw_suspend_wow(padapter);
+   rtw_suspend_wow(padapter);
else
rtw_suspend_normal(padapter);
 
@@ -1522,9 +1518,8 @@ int rtw_resume_process_wow(struct adapter *padapter)
 
pwrpriv->bFwCurrentInPSMode = false;
 
-   if (padapter->intf_stop) {
+   if (padapter->intf_stop)
padapter->intf_stop(padapter);
-   }
 
if (padapter->HalFunc.clear_interrupt)
padapter->HalFunc.clear_interrupt(padapter);
@@ -1541,18 +1536,15 @@ int rtw_resume_process_wow(struct adapter *padapter)
padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_WOWLAN, (u8 
*));
 
psta = rtw_get_stainfo(>stapriv, 
get_bssid(>mlmepriv));
-   if (psta) {
+   if (psta)
set_sta_rate(padapter, psta);
-   }
-
 
padapter->bDriverStopped = false;
DBG_871X("%s: wowmode resuming, DriverStopped:%d\n", __func__, 
padapter->bDriverStopped);
rtw_start_drv_threads(padapter);
 
-   if (padapter->intf_start) {
+   if (padapter->intf_start)
padapter->intf_start(padapter);
-   }
 
/*  start netif queue */
if (pnetdev) {
@@ -1656,9 +1648,8 @@ int rtw_resume_process_ap_wow(struct adapter *padapter)
DBG_871X("%s: wowmode resuming, DriverStopped:%d\n", __func__, 
padapter->bDriverStopped);
rtw_start_drv_threads(padapter);
 
-   if (padapter->intf_start) {
+   if (padapter->intf_start)
padapter->intf_start(padapter);
-   }
 
/*  start netif queue */
if (pnetdev) {
-- 
2.17.1



[PATCH V2] Staging: rtl8723bs: os_de: if-else coding style issue

2020-05-15 Thread John Oldman
Coding style issues:
This patch clears the checkpatch.pl "braces {} are not necessary for
single statement blocks" and "else_should_follow_close_brace"
warnings.

Signed-off-by: John Oldman 
---
v1: First attempt
v2: Followed The rule is that "if one side of the if else statement
has curly braces then all sides get curly braces even if they're
just one line long."

 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 33 -
 1 file changed, 12 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c 
b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index d29f59bbb613..50a3c2c3a8d2 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -1057,9 +1057,9 @@ static int pm_netdev_open(struct net_device *pnetdev, u8 
bnormal)
status = _netdev_open(pnetdev);

mutex_unlock(&(adapter_to_dvobj(padapter)->hw_init_mutex));
}
-   }
-   else
+   } else {
status =  (_SUCCESS == ips_netdrv_open(padapter)) ? (0) : (-1);
+   }
 
return status;
 }
@@ -1192,8 +1192,7 @@ void rtw_dev_unload(struct adapter *padapter)
padapter->bup = false;
 
DBG_871X("<=== %s\n", __func__);
-   }
-   else {
+   } else {
RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("%s: bup 
==false\n", __func__));
DBG_871X("%s: bup ==false\n", __func__);
}
@@ -1223,8 +1222,7 @@ static int rtw_suspend_free_assoc_resource(struct adapter 
*padapter)
rtw_disassoc_cmd(padapter, 0, false);
/* s2-2.  indicate disconnect to os */
rtw_indicate_disconnect(padapter);
-   }
-   else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
+   } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
rtw_sta_flush(padapter);
}
 
@@ -1270,9 +1268,8 @@ void rtw_suspend_wow(struct adapter *padapter)
padapter->bDriverStopped = false;   /* for 32k command */
 
/*  2. disable interrupt */
-   if (padapter->intf_stop) {
+   if (padapter->intf_stop)
padapter->intf_stop(padapter);
-   }
 
/*  2.1 clean interrupt */
if (padapter->HalFunc.clear_interrupt)
@@ -1448,14 +1445,13 @@ int rtw_suspend_common(struct adapter *padapter)
 
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) {
#ifdef CONFIG_WOWLAN
-   if (check_fwstate(pmlmepriv, _FW_LINKED)) {
+   if (check_fwstate(pmlmepriv, _FW_LINKED))
pwrpriv->wowlan_mode = true;
-   } else if (pwrpriv->wowlan_pno_enable == true) {
+   else if (pwrpriv->wowlan_pno_enable == true)
pwrpriv->wowlan_mode |= pwrpriv->wowlan_pno_enable;
-   }
 
if (pwrpriv->wowlan_mode == true)
-   rtw_suspend_wow(padapter);
+   rtw_suspend_wow(padapter);
else
rtw_suspend_normal(padapter);
 
@@ -1522,9 +1518,8 @@ int rtw_resume_process_wow(struct adapter *padapter)
 
pwrpriv->bFwCurrentInPSMode = false;
 
-   if (padapter->intf_stop) {
+   if (padapter->intf_stop)
padapter->intf_stop(padapter);
-   }
 
if (padapter->HalFunc.clear_interrupt)
padapter->HalFunc.clear_interrupt(padapter);
@@ -1541,18 +1536,15 @@ int rtw_resume_process_wow(struct adapter *padapter)
padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_WOWLAN, (u8 
*));
 
psta = rtw_get_stainfo(>stapriv, 
get_bssid(>mlmepriv));
-   if (psta) {
+   if (psta)
set_sta_rate(padapter, psta);
-   }
-
 
padapter->bDriverStopped = false;
DBG_871X("%s: wowmode resuming, DriverStopped:%d\n", __func__, 
padapter->bDriverStopped);
rtw_start_drv_threads(padapter);
 
-   if (padapter->intf_start) {
+   if (padapter->intf_start)
padapter->intf_start(padapter);
-   }
 
/*  start netif queue */
if (pnetdev) {
@@ -1656,9 +1648,8 @@ int rtw_resume_process_ap_wow(struct adapter *padapter)
DBG_871X("%s: wowmode resuming, DriverStopped:%d\n", __func__, 
padapter->bDriverStopped);
rtw_start_drv_threads(padapter);
 
-   if (padapter->intf_start) {
+   if (padapter->intf_start)
padapter->intf_start(padapter);
-   }
 
/*  start netif queue */
if (pnetdev) {
-- 
2.17.1



[PATCH] staging: rtl8723bs: Using comparison to true is error prone

2020-05-15 Thread John Oldman
fix below issue reported by checkpatch

CHECK: Using comparison to true is error prone
CHECK: Using comparison to false is error prone

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

diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c 
b/drivers/staging/rtl8723bs/core/rtw_security.c
index 5ebf691bd743..0f95009a30b6 100644
--- a/drivers/staging/rtl8723bs/core/rtw_security.c
+++ b/drivers/staging/rtl8723bs/core/rtw_security.c
@@ -756,7 +756,7 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 
*precvframe)
static u32 no_gkey_bc_cnt;
static u32 no_gkey_mc_cnt;
 
-   if (psecuritypriv->binstallGrpkey == false) {
+   if (!psecuritypriv->binstallGrpkey) {
res = _FAIL;
 
if (start == 0)
@@ -1837,7 +1837,7 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 
*precvframe)
static u32 no_gkey_bc_cnt;
static u32 no_gkey_mc_cnt;
 
-   if (psecuritypriv->binstallGrpkey == false) {
+   if (!psecuritypriv->binstallGrpkey) {
res = _FAIL;
 
if (start == 0)
@@ -2369,7 +2369,7 @@ u8 rtw_handle_tkip_countermeasure(struct adapter 
*adapter, const char *caller)
struct security_priv *securitypriv = &(adapter->securitypriv);
u8 status = _SUCCESS;
 
-   if (securitypriv->btkip_countermeasure == true) {
+   if (securitypriv->btkip_countermeasure) {
unsigned long passing_ms = jiffies_to_msecs(jiffies - 
securitypriv->btkip_countermeasure_time);
if (passing_ms > 60*1000) {
DBG_871X_LEVEL(_drv_always_, "%s("ADPT_FMT") 
countermeasure time:%lus > 60s\n",
-- 
2.17.1



[PATCH] staging: rtl8192u: Using comparison to true is error prone

2020-05-16 Thread John Oldman
fix below issue reported by checkpatch:

CHECK: Using comparison to true is error prone
CHECK: Using comparison to false is error prone

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

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
index 0ee054d82832..63a561ab4a76 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
@@ -372,9 +372,9 @@ ieee80211_query_HTCapShortGI(struct ieee80211_device *ieee, 
struct cb_desc *tcb_
return;
}
 
-   if ((pHTInfo->bCurBW40MHz == true) && pHTInfo->bCurShortGI40MHz)
+   if (pHTInfo->bCurBW40MHz && pHTInfo->bCurShortGI40MHz)
tcb_desc->bUseShortGI = true;
-   else if ((pHTInfo->bCurBW40MHz == false) && pHTInfo->bCurShortGI20MHz)
+   else if (!pHTInfo->bCurBW40MHz && pHTInfo->bCurShortGI20MHz)
tcb_desc->bUseShortGI = true;
 }
 
-- 
2.17.1



[PATCH] staging: vc04_services: interface: vchiq_arm: vchiq_connected.c: Block comments should align the * on each line

2020-05-09 Thread John Oldman
Coding style issue

Signed-off-by: John Oldman 
---
 .../interface/vchiq_arm/vchiq_connected.c | 32 +--
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git 
a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
index 1640906e3929..993535bbc479 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
@@ -15,10 +15,10 @@ static   intg_once_init;
 static   struct mutex   g_connected_mutex;
 
 /
-*
-* Function to initialize our lock.
-*
-***/
+ *
+ * Function to initialize our lock.
+ *
+ ***/
 
 static void connected_init(void)
 {
@@ -29,13 +29,13 @@ static void connected_init(void)
 }
 
 /
-*
-* This function is used to defer initialization until the vchiq stack is
-* initialized. If the stack is already initialized, then the callback will
-* be made immediately, otherwise it will be deferred until
-* vchiq_call_connected_callbacks is called.
-*
-***/
+ *
+ * This function is used to defer initialization until the vchiq stack is
+ * initialized. If the stack is already initialized, then the callback will
+ * be made immediately, otherwise it will be deferred until
+ * vchiq_call_connected_callbacks is called.
+ *
+ ***/
 
 void vchiq_add_connected_callback(VCHIQ_CONNECTED_CALLBACK_T callback)
 {
@@ -64,11 +64,11 @@ void 
vchiq_add_connected_callback(VCHIQ_CONNECTED_CALLBACK_T callback)
 }
 
 /
-*
-* This function is called by the vchiq stack once it has been connected to
-* the videocore and clients can start to use the stack.
-*
-***/
+ *
+ * This function is called by the vchiq stack once it has been connected to
+ * the videocore and clients can start to use the stack.
+ *
+ ***/
 
 void vchiq_call_connected_callbacks(void)
 {
-- 
2.17.1



Re: [PATCH] staging: vc04_services: interface: vchiq_arm: vchiq_connected.c: Block comments should align the * on each line

2020-05-09 Thread John Oldman
Hi Greg

Yea, thanks for the feedback.

Will fix and resend...

John


On Sat, 9 May 2020 at 18:11, Greg KH  wrote:
>
> On Sat, May 09, 2020 at 02:07:14PM +0100, John Oldman wrote:
> > Coding style issue
>
> Your subject line needs to be much shorter, don't you think?
>
> Please fix up and resend.
>
> greg k-h


[PATCH V2] staging: vc04_services: vchiq_connected.c: Block comment alignment

2020-05-10 Thread John Oldman
Coding style issue

Signed-off-by: John Oldman 
---
v1: Initial attempt.
V2: Resubmitted with shorter comment line, as suggested by Greg KH.

This patch clears the checkpatch.pl "Block comments should align the * on each 
line" warning.

 .../interface/vchiq_arm/vchiq_connected.c | 32 +--
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git 
a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
index 1640906e3929..993535bbc479 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
@@ -15,10 +15,10 @@ static   intg_once_init;
 static   struct mutex   g_connected_mutex;
 
 /
-*
-* Function to initialize our lock.
-*
-***/
+ *
+ * Function to initialize our lock.
+ *
+ ***/
 
 static void connected_init(void)
 {
@@ -29,13 +29,13 @@ static void connected_init(void)
 }
 
 /
-*
-* This function is used to defer initialization until the vchiq stack is
-* initialized. If the stack is already initialized, then the callback will
-* be made immediately, otherwise it will be deferred until
-* vchiq_call_connected_callbacks is called.
-*
-***/
+ *
+ * This function is used to defer initialization until the vchiq stack is
+ * initialized. If the stack is already initialized, then the callback will
+ * be made immediately, otherwise it will be deferred until
+ * vchiq_call_connected_callbacks is called.
+ *
+ ***/
 
 void vchiq_add_connected_callback(VCHIQ_CONNECTED_CALLBACK_T callback)
 {
@@ -64,11 +64,11 @@ void 
vchiq_add_connected_callback(VCHIQ_CONNECTED_CALLBACK_T callback)
 }
 
 /
-*
-* This function is called by the vchiq stack once it has been connected to
-* the videocore and clients can start to use the stack.
-*
-***/
+ *
+ * This function is called by the vchiq stack once it has been connected to
+ * the videocore and clients can start to use the stack.
+ *
+ ***/
 
 void vchiq_call_connected_callbacks(void)
 {
-- 
2.17.1



Re: [PATCH V2] staging: vc04_services: vchiq_connected.c: Block comment alignment

2020-05-10 Thread John Oldman
Thanks for the feedback Greg.
Will resubmit the patch as you suggest.
Thanks
john

On Sun, 10 May 2020 at 07:55, Greg KH  wrote:
>
> On Sun, May 10, 2020 at 07:06:45AM +0100, John Oldman wrote:
> > Coding style issue
> >
> > Signed-off-by: John Oldman 
> > ---
> > v1: Initial attempt.
> > V2: Resubmitted with shorter comment line, as suggested by Greg KH.
> >
> > This patch clears the checkpatch.pl "Block comments should align the * on 
> > each line" warning.
>
> Why is this text not in the changelog area?  Don't you think that it is
> better than the 3 words you currently put there?
>
> Please fix up and resend.
>
> thanks,
>
> greg k-h


[PATCH V3] staging: vc04_services: vchiq_connected.c: Block comment alignment

2020-05-10 Thread John Oldman
Coding style issue
This patch clears the checkpatch.pl "Block comments should align the * on each 
line" warning.

Signed-off-by: John Oldman 
---
v1: Initial attempt.
v2: Resubmitted with shorter comment line, as suggested by Greg KH.
v3: Resubmitted with descriptiuon text moved into the comment area.

 .../interface/vchiq_arm/vchiq_connected.c | 32 +--
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git 
a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
index 1640906e3929..993535bbc479 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
@@ -15,10 +15,10 @@ static   intg_once_init;
 static   struct mutex   g_connected_mutex;
 
 /
-*
-* Function to initialize our lock.
-*
-***/
+ *
+ * Function to initialize our lock.
+ *
+ ***/
 
 static void connected_init(void)
 {
@@ -29,13 +29,13 @@ static void connected_init(void)
 }
 
 /
-*
-* This function is used to defer initialization until the vchiq stack is
-* initialized. If the stack is already initialized, then the callback will
-* be made immediately, otherwise it will be deferred until
-* vchiq_call_connected_callbacks is called.
-*
-***/
+ *
+ * This function is used to defer initialization until the vchiq stack is
+ * initialized. If the stack is already initialized, then the callback will
+ * be made immediately, otherwise it will be deferred until
+ * vchiq_call_connected_callbacks is called.
+ *
+ ***/
 
 void vchiq_add_connected_callback(VCHIQ_CONNECTED_CALLBACK_T callback)
 {
@@ -64,11 +64,11 @@ void 
vchiq_add_connected_callback(VCHIQ_CONNECTED_CALLBACK_T callback)
 }
 
 /
-*
-* This function is called by the vchiq stack once it has been connected to
-* the videocore and clients can start to use the stack.
-*
-***/
+ *
+ * This function is called by the vchiq stack once it has been connected to
+ * the videocore and clients can start to use the stack.
+ *
+ ***/
 
 void vchiq_call_connected_callbacks(void)
 {
-- 
2.17.1



Re: [PATCH V3] staging: vc04_services: vchiq_connected.c: Block comment alignment

2020-05-13 Thread John Oldman
yea I agree, will re-submit...
Cheers
john

On Wed, 13 May 2020 at 12:58, Greg KH  wrote:
>
> On Sun, May 10, 2020 at 11:13:08AM +0100, John Oldman wrote:
> > Coding style issue
> > This patch clears the checkpatch.pl "Block comments should align the * on 
> > each line" warning.
> >
> > Signed-off-by: John Oldman 
> > ---
> > v1: Initial attempt.
> > v2: Resubmitted with shorter comment line, as suggested by Greg KH.
> > v3: Resubmitted with descriptiuon text moved into the comment area.
> >
> >  .../interface/vchiq_arm/vchiq_connected.c | 32 +--
> >  1 file changed, 16 insertions(+), 16 deletions(-)
> >
> > diff --git 
> > a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c 
> > b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
> > index 1640906e3929..993535bbc479 100644
> > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
> > +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
> > @@ -15,10 +15,10 @@ static   intg_once_init;
> >  static   struct mutex   g_connected_mutex;
> >
> >  
> > /
> > -*
> > -* Function to initialize our lock.
> > -*
> > -***/
> > + *
> > + * Function to initialize our lock.
> > + *
> > + 
> > ***/
> >
> >  static void connected_init(void)
>
> Shouldn't that really be written as:
>
> /* Function to initialize our lock */
> static void connect_init(void);
>
>
> No need for the /** mess, and no need for the blank line.
>
> Simple and clean is best.
>
> thanks,
>
> greg k-h


[PATCH V4] staging: vc04_services: Block comment alignment

2020-05-13 Thread John Oldman
Coding style issue reported by checkpatch.pl
This patch clears the checkpatch.pl "Block comments should align
the * on each line" warning.
Also cleared /** and blank line.

Signed-off-by: John Oldman 
---
v1: Initial attempt.
v2: Resubmitted with shorter comment line, as suggested by Greg KH.
v3: Resubmitted with descriptiuon text moved into the comment area.
v4: Resubmitted with /** and blank lines removed.

 .../interface/vchiq_arm/vchiq_connected.c | 33 +++
 1 file changed, 11 insertions(+), 22 deletions(-)

diff --git 
a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
index 1640906e3929..79b75efa6868 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
@@ -14,12 +14,7 @@ static   VCHIQ_CONNECTED_CALLBACK_T 
g_deferred_callback[MAX_CALLBACKS];
 static   intg_once_init;
 static   struct mutex   g_connected_mutex;
 
-/
-*
-* Function to initialize our lock.
-*
-***/
-
+/* Function to initialize our lock */
 static void connected_init(void)
 {
if (!g_once_init) {
@@ -28,15 +23,12 @@ static void connected_init(void)
}
 }
 
-/
-*
-* This function is used to defer initialization until the vchiq stack is
-* initialized. If the stack is already initialized, then the callback will
-* be made immediately, otherwise it will be deferred until
-* vchiq_call_connected_callbacks is called.
-*
-***/
-
+/*
+ * This function is used to defer initialization until the vchiq stack is
+ * initialized. If the stack is already initialized, then the callback will
+ * be made immediately, otherwise it will be deferred until
+ * vchiq_call_connected_callbacks is called.
+ */
 void vchiq_add_connected_callback(VCHIQ_CONNECTED_CALLBACK_T callback)
 {
connected_init();
@@ -63,13 +55,10 @@ void 
vchiq_add_connected_callback(VCHIQ_CONNECTED_CALLBACK_T callback)
mutex_unlock(_connected_mutex);
 }
 
-/
-*
-* This function is called by the vchiq stack once it has been connected to
-* the videocore and clients can start to use the stack.
-*
-***/
-
+/*
+ * This function is called by the vchiq stack once it has been connected to
+ * the videocore and clients can start to use the stack.
+ */
 void vchiq_call_connected_callbacks(void)
 {
int i;
-- 
2.17.1



[PATCH] staging: rtl8723bs: Using comparison to true is error prone

2020-07-07 Thread John Oldman
clear below issues reported by checkpatch.pl:

CHECK: Using comparison to false is error prone
CHECK: Using comparison to true is error pron

Signed-off-by: John Oldman 
---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 70 ++---
 1 file changed, 32 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c 
b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index 50a3c2c3a8d2..27f990a01a23 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -313,7 +313,7 @@ static int rtw_net_set_mac_address(struct net_device 
*pnetdev, void *p)
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
struct sockaddr *addr = p;

-   if (padapter->bup == false) {
+   if (!padapter->bup) {
/* DBG_871X("r8711_net_set_mac_address(), MAC 
=%x:%x:%x:%x:%x:%x\n", addr->sa_data[0], addr->sa_data[1], addr->sa_data[2], 
addr->sa_data[3], */
/* addr->sa_data[4], addr->sa_data[5]); */
memcpy(padapter->eeprompriv.mac_addr, addr->sa_data, ETH_ALEN);
@@ -897,12 +897,12 @@ int _netdev_open(struct net_device *pnetdev)

padapter->netif_up = true;

-   if (pwrctrlpriv->ps_flag == true) {
+   if (pwrctrlpriv->ps_flag) {
padapter->net_closed = false;
goto netdev_open_normal_process;
}

-   if (padapter->bup == false) {
+   if (!padapter->bup) {
padapter->bDriverStopped = false;
padapter->bSurpriseRemoved = false;
padapter->bCardDisableWOHSM = false;
@@ -964,7 +964,7 @@ int netdev_open(struct net_device *pnetdev)
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);

-   if (pwrctrlpriv->bInSuspend == true) {
+   if (pwrctrlpriv->bInSuspend) {
DBG_871X("+871x_drv - drv_open, bInSuspend =%d\n", 
pwrctrlpriv->bInSuspend);
return 0;
}
@@ -1041,7 +1041,7 @@ void rtw_ips_dev_unload(struct adapter *padapter)
DBG_871X("> %s...\n", __func__);


-   if (padapter->bSurpriseRemoved == false)
+   if (!padapter->bSurpriseRemoved)
rtw_hal_deinit(padapter);
 }

@@ -1052,7 +1052,7 @@ static int pm_netdev_open(struct net_device *pnetdev, u8 
bnormal)

struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);

-   if (true == bnormal) {
+   if (bnormal) {
if 
(mutex_lock_interruptible(&(adapter_to_dvobj(padapter)->hw_init_mutex)) == 0) {
status = _netdev_open(pnetdev);

mutex_unlock(&(adapter_to_dvobj(padapter)->hw_init_mutex));
@@ -1071,7 +1071,7 @@ static int netdev_close(struct net_device *pnetdev)

RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+871x_drv - drv_close\n"));

-   if (pwrctl->bInternalAutoSuspend == true) {
+   if (pwrctl->bInternalAutoSuspend) {
/* rtw_pwr_wakeup(padapter); */
if (pwrctl->rf_pwrstate == rf_off)
pwrctl->ps_flag = true;
@@ -1134,7 +1134,7 @@ void rtw_dev_unload(struct adapter *padapter)

RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("+%s\n", __func__));

-   if (padapter->bup == true) {
+   if (padapter->bup) {
DBG_871X("===> %s\n", __func__);

padapter->bDriverStopped = true;
@@ -1149,7 +1149,7 @@ void rtw_dev_unload(struct adapter *padapter)
if (!pwrctl->bInternalAutoSuspend)
rtw_stop_drv_threads(padapter);

-   while (atomic_read(&(pcmdpriv->cmdthd_running)) == true) {
+   while (atomic_read(>cmdthd_running)) {
if (cnt > 5) {
DBG_871X("stop cmdthd timeout\n");
break;
@@ -1163,7 +1163,8 @@ void rtw_dev_unload(struct adapter *padapter)
RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("@ %s: stop 
thread complete!\n", __func__));

/* check the status of IPS */
-   if (rtw_hal_check_ips_status(padapter) == true || 
pwrctl->rf_pwrstate == rf_off) { /* check HW status and SW state */
+   if (rtw_hal_check_ips_status(padapter) || pwrctl->rf_pwrstate 
== rf_off) {
+   /* check HW status and SW state */
DBG_871X_LEVEL(_drv_always_, "%s: driver in 
IPS-FWLPS\n", __func__);
pdbgpriv->dbg_dev_unload_inIPS_cnt++;
LeaveAllPowerSaveMode(padapter);
@@ -1171,11 +1172,10 @@ void rtw_dev_unload(struct adapter 

[PATCH] staging: rtl8723bs: Using comparison to true is error prone

2020-07-07 Thread John Oldman
clear below issues reported by checkpatch.pl:

CHECK: Using comparison to false is error prone
CHECK: Using comparison to true is error prone

Signed-off-by: John Oldman 
---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 70 ++---
 1 file changed, 32 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c 
b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index 50a3c2c3a8d2..27f990a01a23 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -313,7 +313,7 @@ static int rtw_net_set_mac_address(struct net_device 
*pnetdev, void *p)
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
struct sockaddr *addr = p;

-   if (padapter->bup == false) {
+   if (!padapter->bup) {
/* DBG_871X("r8711_net_set_mac_address(), MAC 
=%x:%x:%x:%x:%x:%x\n", addr->sa_data[0], addr->sa_data[1], addr->sa_data[2], 
addr->sa_data[3], */
/* addr->sa_data[4], addr->sa_data[5]); */
memcpy(padapter->eeprompriv.mac_addr, addr->sa_data, ETH_ALEN);
@@ -897,12 +897,12 @@ int _netdev_open(struct net_device *pnetdev)

padapter->netif_up = true;

-   if (pwrctrlpriv->ps_flag == true) {
+   if (pwrctrlpriv->ps_flag) {
padapter->net_closed = false;
goto netdev_open_normal_process;
}

-   if (padapter->bup == false) {
+   if (!padapter->bup) {
padapter->bDriverStopped = false;
padapter->bSurpriseRemoved = false;
padapter->bCardDisableWOHSM = false;
@@ -964,7 +964,7 @@ int netdev_open(struct net_device *pnetdev)
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);

-   if (pwrctrlpriv->bInSuspend == true) {
+   if (pwrctrlpriv->bInSuspend) {
DBG_871X("+871x_drv - drv_open, bInSuspend =%d\n", 
pwrctrlpriv->bInSuspend);
return 0;
}
@@ -1041,7 +1041,7 @@ void rtw_ips_dev_unload(struct adapter *padapter)
DBG_871X("> %s...\n", __func__);


-   if (padapter->bSurpriseRemoved == false)
+   if (!padapter->bSurpriseRemoved)
rtw_hal_deinit(padapter);
 }

@@ -1052,7 +1052,7 @@ static int pm_netdev_open(struct net_device *pnetdev, u8 
bnormal)

struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);

-   if (true == bnormal) {
+   if (bnormal) {
if 
(mutex_lock_interruptible(&(adapter_to_dvobj(padapter)->hw_init_mutex)) == 0) {
status = _netdev_open(pnetdev);

mutex_unlock(&(adapter_to_dvobj(padapter)->hw_init_mutex));
@@ -1071,7 +1071,7 @@ static int netdev_close(struct net_device *pnetdev)

RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+871x_drv - drv_close\n"));

-   if (pwrctl->bInternalAutoSuspend == true) {
+   if (pwrctl->bInternalAutoSuspend) {
/* rtw_pwr_wakeup(padapter); */
if (pwrctl->rf_pwrstate == rf_off)
pwrctl->ps_flag = true;
@@ -1134,7 +1134,7 @@ void rtw_dev_unload(struct adapter *padapter)

RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("+%s\n", __func__));

-   if (padapter->bup == true) {
+   if (padapter->bup) {
DBG_871X("===> %s\n", __func__);

padapter->bDriverStopped = true;
@@ -1149,7 +1149,7 @@ void rtw_dev_unload(struct adapter *padapter)
if (!pwrctl->bInternalAutoSuspend)
rtw_stop_drv_threads(padapter);

-   while (atomic_read(&(pcmdpriv->cmdthd_running)) == true) {
+   while (atomic_read(>cmdthd_running)) {
if (cnt > 5) {
DBG_871X("stop cmdthd timeout\n");
break;
@@ -1163,7 +1163,8 @@ void rtw_dev_unload(struct adapter *padapter)
RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("@ %s: stop 
thread complete!\n", __func__));

/* check the status of IPS */
-   if (rtw_hal_check_ips_status(padapter) == true || 
pwrctl->rf_pwrstate == rf_off) { /* check HW status and SW state */
+   if (rtw_hal_check_ips_status(padapter) || pwrctl->rf_pwrstate 
== rf_off) {
+   /* check HW status and SW state */
DBG_871X_LEVEL(_drv_always_, "%s: driver in 
IPS-FWLPS\n", __func__);
pdbgpriv->dbg_dev_unload_inIPS_cnt++;
LeaveAllPowerSaveMode(padapter);
@@ -1171,11 +1172,10 @@ void rtw_dev_unload(struct adapter 

[PATCH] staging: rtl8192u: Using comparison to true is error prone

2020-07-06 Thread John Oldman
clear below issues reported by checkpatch.pl:

CHECK: Using comparison to false is error prone

Signed-off-by: John Oldman 
---
 drivers/staging/rtl8192u/r8192U_dm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_dm.c 
b/drivers/staging/rtl8192u/r8192U_dm.c
index c23e43b095d9..6b301acb584e 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -2240,7 +2240,7 @@ static void dm_ctstoself(struct net_device *dev)
unsigned long   curTxOkCnt = 0;
unsigned long   curRxOkCnt = 0;

-   if (priv->ieee80211->bCTSToSelfEnable != true) {
+   if (!priv->ieee80211->bCTSToSelfEnable) {
pHTInfo->IOTAction &= ~HT_IOT_ACT_FORCED_CTS2SELF;
return;
}
@@ -2944,7 +2944,7 @@ static void dm_dynamic_txpower(struct net_device *dev)
unsigned int txhipower_threshold = 0;
unsigned int txlowpower_threshold = 0;

-   if (priv->ieee80211->bdynamic_txpower_enable != true) {
+   if (!priv->ieee80211->bdynamic_txpower_enable) {
priv->bDynamicTxHighPower = false;
priv->bDynamicTxLowPower = false;
return;
--
2.17.1



[PATCH] staging: rtl8712/: Using comparison to true is error prone

2020-07-10 Thread John Oldman
clear below issues reported by checkpatch.pl:

CHECK: Using comparison to true is error prone
CHECK: Comparison to NULL should be written "!oldest"

Signed-off-by: John Oldman 
---
 drivers/staging/rtl8712/rtl871x_mlme.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c 
b/drivers/staging/rtl8712/rtl871x_mlme.c
index 9ee1bfac0763..2ccd49032206 100644
--- a/drivers/staging/rtl8712/rtl871x_mlme.c
+++ b/drivers/staging/rtl8712/rtl871x_mlme.c
@@ -264,13 +264,13 @@ structwlan_network *r8712_get_oldest_wlan_network(
phead = _queue->queue;
plist = phead->next;
while (1) {
-   if (end_of_queue_search(phead, plist) ==  true)
+   if (end_of_queue_search(phead, plist))
break;
pwlan = container_of(plist, struct wlan_network, list);
-   if (pwlan->fixed != true) {
-   if (oldest == NULL ||
+   if (!pwlan->fixed) {
+   if (!oldest ||
time_after((unsigned long)oldest->last_scanned,
-   (unsigned long)pwlan->last_scanned))
+  (unsigned long)pwlan->last_scanned))
oldest = pwlan;
}
plist = plist->next;
--
2.17.1



[PATCH] staging: rtl8723bs: core: Using comparison to true is error prone

2020-07-10 Thread John Oldman
clear below issues reported by checkpatch.pl:

CHECK: Using comparison to true is error prone

Signed-off-by: John Oldman 
---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c 
b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index ca98274ae390..d9bdd4fb9dc3 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -363,8 +363,9 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
}
 
/* HT Cap. */
-   if (((pregistrypriv->wireless_mode_11_5N) || 
(pregistrypriv->wireless_mode_11_24N))
-   && (pregistrypriv->ht_enable == true)) {
+   if (((pregistrypriv->wireless_mode & WIRELESS_11_5N)
+ || (pregistrypriv->wireless_mode & WIRELESS_11_24N))
+ && (pregistrypriv->ht_enable)) {
/* todo: */
}
 
-- 
2.17.1



[PATCH] staging: rtl8192e: Using comparison to true is error prone

2020-05-21 Thread John Oldman
clear below issues reported by checkpatch.pl:

CHECK: Using comparison to true is error prone
CHECK: Using comparison to false is error prone

Signed-off-by: John Oldman 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index 43494a2b6f05..462835684e8b 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -456,7 +456,7 @@ static void _rtl92e_dm_bandwidth_autoswitch(struct 
net_device *dev)
if (priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 ||
   !priv->rtllib->bandwidth_auto_switch.bautoswitch_enable)
return;
-   if (priv->rtllib->bandwidth_auto_switch.bforced_tx20Mhz == false) {
+   if (!priv->rtllib->bandwidth_auto_switch.bforced_tx20Mhz) {
if (priv->undecorated_smoothed_pwdb <=
priv->rtllib->bandwidth_auto_switch.threshold_40Mhzto20Mhz)
priv->rtllib->bandwidth_auto_switch.bforced_tx20Mhz = 
true;
@@ -1297,7 +1297,7 @@ static void _rtl92e_dm_dig_init(struct net_device *dev)
 static void _rtl92e_dm_ctrl_initgain_byrssi(struct net_device *dev)
 {
 
-   if (dm_digtable.dig_enable_flag == false)
+   if (!dm_digtable.dig_enable_flag)
return;
 
if (dm_digtable.dig_algorithm == DIG_ALGO_BY_FALSE_ALARM)
@@ -1332,7 +1332,7 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct 
net_device *dev)
u8 i;
static u8   fw_dig;
 
-   if (dm_digtable.dig_enable_flag == false)
+   if (!dm_digtable.dig_enable_flag)
return;
 
if (dm_digtable.dig_algorithm_switch)
@@ -1366,7 +1366,7 @@ static void 
_rtl92e_dm_ctrl_initgain_byrssi_false_alarm(struct net_device *dev)
static u32 reset_cnt;
u8 i;
 
-   if (dm_digtable.dig_enable_flag == false)
+   if (!dm_digtable.dig_enable_flag)
return;
 
if (dm_digtable.dig_algorithm_switch) {
@@ -1501,7 +1501,7 @@ static void _rtl92e_dm_initial_gain(struct net_device 
*dev)
reset_cnt = 0;
}
 
-   if (rtllib_act_scanning(priv->rtllib, true) == true) {
+   if (rtllib_act_scanning(priv->rtllib, true)) {
force_write = 1;
return;
}
-- 
2.17.1