Re: [PATCH] staging: rtl8192e: fix coding style issue, improve error handling

2017-03-09 Thread kbuild test robot
Hi Suniel,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.11-rc1 next-20170309]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Suniel-Mahesh/staging-rtl8192e-fix-coding-style-issue-improve-error-handling/20170310-015706
config: i386-randconfig-x076-201710 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All error/warnings (new ones prefixed by >>):

   drivers/staging/rtl8192e/rtl8192e/rtl_core.c: In function 
'rtl92e_set_rf_state':
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:220:13: error: 
>> 'WLAN_REASON_DISASSOC_STA_' undeclared (first use in this function)
WLAN_REASON_DISASSOC_STA_
^
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:220:13: note: each undeclared 
identifier is reported only once for each function it appears in
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:221:9: error: expected ')' 
>> before 'HAS_LEFT'
HAS_LEFT);
^~~~
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c: In function 
'_rtl92e_init_priv_variable':
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:970:10: warning: 'return' with 
>> a value, in function returning void
  return -ENOMEM;
 ^
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:888:13: note: declared here
static void _rtl92e_init_priv_variable(struct net_device *dev)
^~
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c: In function 
'_rtl92e_if_silent_reset':
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1247:24: warning: missing 
>> terminating " character
  RT_TRACE(COMP_RESET, "%s():==>start to down the
   ^
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1248:13: warning: missing 
terminating " character
driver\n",  __func__);
^
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1251:5: warning: missing 
terminating " character
"%s():==>start to down the
^
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1252:13: warning: missing 
terminating " character
driver\n",  __func__);
^
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2751:0: error: unterminated 
>> argument list invoking macro "RT_TRACE"
MODULE_PARM_DESC(channels, " Channel bitmask for specific locales. NYI");

>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1247:3: error: 'RT_TRACE' 
>> undeclared (first use in this function)
  RT_TRACE(COMP_RESET, "%s():==>start to down the
  ^~~~
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1247:3: error: expected ';' at 
>> end of input
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1247:3: error: expected 
>> declaration or statement at end of input
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1247:3: error: expected 
>> declaration or statement at end of input
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1232:1: warning: label 
'RESET_START' defined but not used [-Wunused-label]
RESET_START:
^~~
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1226:4: error: label 'END' used 
>> but not defined
   goto END;
   ^~~~
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1217:24: warning: unused 
variable 'ieee' [-Wunused-variable]
 struct rtllib_device *ieee = priv->rtllib;
   ^~~~
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1216:6: warning: unused 
variable 'reset_status' [-Wunused-variable]
 int reset_status = 0;
 ^~~~
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1215:5: warning: unused 
variable 'reset_times' [-Wunused-variable]
 u8 reset_times = 0;
^~~
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c: At top level:
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:71:12: warning: 
>> '_rtl92e_pci_probe' used but never defined
static int _rtl92e_pci_probe(struct pci_dev *pdev,
   ^
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:73:13: warning: 
>> '_rtl92e_pci_disconnect' used but never defined
static void _rtl92e_pci_disconnect(struct pci_dev *pdev);
^~
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:74:20: warning: '_rtl92e_irq' 
>> used but never defined
static irqreturn_t _rtl92e_irq(int irq, void *netdev);
   ^~~
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:86:13: warning: 
>> '_rtl92e_watchdog_wq_cb' used but never defined
static void _rtl92e_watchdog_wq_cb(void *data);
^~
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:87:13: warning: 
>> '_rtl92e_watchdog_timer_cb' used but never defined
static void _rtl92e_watchdog_timer_cb(unsigned long data);

Re: [PATCH] staging: rtl8192e: fix coding style issue, improve error handling

2017-03-09 Thread kbuild test robot
Hi Suniel,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.11-rc1 next-20170309]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Suniel-Mahesh/staging-rtl8192e-fix-coding-style-issue-improve-error-handling/20170310-015706
config: i386-randconfig-x076-201710 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All error/warnings (new ones prefixed by >>):

   drivers/staging/rtl8192e/rtl8192e/rtl_core.c: In function 
'rtl92e_set_rf_state':
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:220:13: error: 
>> 'WLAN_REASON_DISASSOC_STA_' undeclared (first use in this function)
WLAN_REASON_DISASSOC_STA_
^
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:220:13: note: each undeclared 
identifier is reported only once for each function it appears in
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:221:9: error: expected ')' 
>> before 'HAS_LEFT'
HAS_LEFT);
^~~~
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c: In function 
'_rtl92e_init_priv_variable':
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:970:10: warning: 'return' with 
>> a value, in function returning void
  return -ENOMEM;
 ^
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:888:13: note: declared here
static void _rtl92e_init_priv_variable(struct net_device *dev)
^~
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c: In function 
'_rtl92e_if_silent_reset':
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1247:24: warning: missing 
>> terminating " character
  RT_TRACE(COMP_RESET, "%s():==>start to down the
   ^
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1248:13: warning: missing 
terminating " character
driver\n",  __func__);
^
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1251:5: warning: missing 
terminating " character
"%s():==>start to down the
^
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1252:13: warning: missing 
terminating " character
driver\n",  __func__);
^
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:2751:0: error: unterminated 
>> argument list invoking macro "RT_TRACE"
MODULE_PARM_DESC(channels, " Channel bitmask for specific locales. NYI");

>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1247:3: error: 'RT_TRACE' 
>> undeclared (first use in this function)
  RT_TRACE(COMP_RESET, "%s():==>start to down the
  ^~~~
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1247:3: error: expected ';' at 
>> end of input
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1247:3: error: expected 
>> declaration or statement at end of input
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1247:3: error: expected 
>> declaration or statement at end of input
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1232:1: warning: label 
'RESET_START' defined but not used [-Wunused-label]
RESET_START:
^~~
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1226:4: error: label 'END' used 
>> but not defined
   goto END;
   ^~~~
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1217:24: warning: unused 
variable 'ieee' [-Wunused-variable]
 struct rtllib_device *ieee = priv->rtllib;
   ^~~~
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1216:6: warning: unused 
variable 'reset_status' [-Wunused-variable]
 int reset_status = 0;
 ^~~~
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1215:5: warning: unused 
variable 'reset_times' [-Wunused-variable]
 u8 reset_times = 0;
^~~
   drivers/staging/rtl8192e/rtl8192e/rtl_core.c: At top level:
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:71:12: warning: 
>> '_rtl92e_pci_probe' used but never defined
static int _rtl92e_pci_probe(struct pci_dev *pdev,
   ^
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:73:13: warning: 
>> '_rtl92e_pci_disconnect' used but never defined
static void _rtl92e_pci_disconnect(struct pci_dev *pdev);
^~
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:74:20: warning: '_rtl92e_irq' 
>> used but never defined
static irqreturn_t _rtl92e_irq(int irq, void *netdev);
   ^~~
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:86:13: warning: 
>> '_rtl92e_watchdog_wq_cb' used but never defined
static void _rtl92e_watchdog_wq_cb(void *data);
^~
>> drivers/staging/rtl8192e/rtl8192e/rtl_core.c:87:13: warning: 
>> '_rtl92e_watchdog_timer_cb' used but never defined
static void _rtl92e_watchdog_timer_cb(unsigned long data);

Re: [PATCH] staging: rtl8192e: fix coding style issue, improve error handling

2017-03-07 Thread Dan Carpenter
On Tue, Mar 07, 2017 at 12:39:40PM +0530, Suniel Mahesh wrote:
> Fix coding style issue and comments in rtl_core.c
> Return -ENOMEM, if it is out of memory
> Pointer comparison with NULL replaced by logical NOT
> 

Split it up into 3 commits.

regards,
dan carpenter



Re: [PATCH] staging: rtl8192e: fix coding style issue, improve error handling

2017-03-07 Thread Dan Carpenter
On Tue, Mar 07, 2017 at 12:39:40PM +0530, Suniel Mahesh wrote:
> Fix coding style issue and comments in rtl_core.c
> Return -ENOMEM, if it is out of memory
> Pointer comparison with NULL replaced by logical NOT
> 

Split it up into 3 commits.

regards,
dan carpenter



[PATCH] staging: rtl8192e: fix coding style issue, improve error handling

2017-03-06 Thread Suniel Mahesh
Fix coding style issue and comments in rtl_core.c
Return -ENOMEM, if it is out of memory
Pointer comparison with NULL replaced by logical NOT

Signed-off-by: Suniel Mahesh 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 253 +++
 1 file changed, 100 insertions(+), 153 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 4c0caa6..1099c94 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -1,4 +1,4 @@
-/**
+/
  * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
  *
  * Based on the r8180 driver, which is:
@@ -17,7 +17,7 @@
  *
  * Contact Information:
  * wlanfae 
-**/
+ */
 #include 
 #include 
 #include 
@@ -37,7 +37,6 @@
 static int channels = 0x3fff;
 static char *ifname = "wlan%d";
 
-
 static const struct rtl819x_ops rtl819xp_ops = {
.nic_type   = NIC_8192E,
.get_eeprom_size= rtl92e_get_eeprom_size,
@@ -100,9 +99,7 @@ static void _rtl92e_hard_data_xmit(struct sk_buff *skb, 
struct net_device *dev,
 static int _rtl92e_down(struct net_device *dev, bool shutdownrf);
 static void _rtl92e_restart(void *data);
 
-/
-   -IO STUFF-
-*/
+/* IO STUFF */
 
 u8 rtl92e_readb(struct net_device *dev, int x)
 {
@@ -140,9 +137,7 @@ void rtl92e_writew(struct net_device *dev, int x, u16 y)
udelay(20);
 }
 
-/
-   -GENERAL FUNCTION-
-*/
+/* GENERAL FUNCTION */
 bool rtl92e_set_rf_state(struct net_device *dev,
 enum rt_rf_power_state StateToSet,
 RT_RF_CHANGE_SOURCE ChangeSource)
@@ -200,7 +195,6 @@ bool rtl92e_set_rf_state(struct net_device *dev,
priv->rtllib->RfOffReason = 0;
bActionAllowed = true;
 
-
if (rtState == eRfOff &&
ChangeSource >= RF_CHANGE_BY_HW)
bConnectBySSID = true;
@@ -223,7 +217,8 @@ bool rtl92e_set_rf_state(struct net_device *dev,
else
priv->blinked_ingpio = false;
rtllib_MgntDisconnect(priv->rtllib,
- 
WLAN_REASON_DISASSOC_STA_HAS_LEFT);
+ WLAN_REASON_DISASSOC_STA_
+   HAS_LEFT);
}
}
if ((ChangeSource == RF_CHANGE_BY_HW) && !priv->bHwRadioOff)
@@ -247,7 +242,6 @@ bool rtl92e_set_rf_state(struct net_device *dev,
 StateToSet, priv->rtllib->RfOffReason);
PHY_SetRFPowerState(dev, StateToSet);
if (StateToSet == eRfOn) {
-
if (bConnectBySSID && priv->blinked_ingpio) {
schedule_delayed_work(
 >associate_procedure_wq, 0);
@@ -346,16 +340,16 @@ static void _rtl92e_update_cap(struct net_device *dev, 
u16 cap)
}
}
 
-   if (net->mode & (IEEE_G|IEEE_N_24G)) {
+   if (net->mode & (IEEE_G | IEEE_N_24G)) {
u8  slot_time_val;
u8  CurSlotTime = priv->slot_time;
 
if ((cap & WLAN_CAPABILITY_SHORT_SLOT_TIME) &&
-  (!priv->rtllib->pHTInfo->bCurrentRT2RTLongSlotTime)) {
+   (!priv->rtllib->pHTInfo->bCurrentRT2RTLongSlotTime)) {
if (CurSlotTime != SHORT_SLOT_TIME) {
slot_time_val = SHORT_SLOT_TIME;
priv->rtllib->SetHwRegHandler(dev,
-HW_VAR_SLOT_TIME, _time_val);
+   HW_VAR_SLOT_TIME, _time_val);
}
} else {
if (CurSlotTime != NON_SHORT_SLOT_TIME) {
@@ -407,7 +401,6 @@ static void _rtl92e_qos_activate(void *data)
for (i = 0; i <  QOS_QUEUE_NUM; i++)
priv->rtllib->SetHwRegHandler(dev, HW_VAR_AC_PARAM, (u8 *)());
 
-
 success:
mutex_unlock(>mutex);
 

[PATCH] staging: rtl8192e: fix coding style issue, improve error handling

2017-03-06 Thread Suniel Mahesh
Fix coding style issue and comments in rtl_core.c
Return -ENOMEM, if it is out of memory
Pointer comparison with NULL replaced by logical NOT

Signed-off-by: Suniel Mahesh 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 253 +++
 1 file changed, 100 insertions(+), 153 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 4c0caa6..1099c94 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -1,4 +1,4 @@
-/**
+/
  * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
  *
  * Based on the r8180 driver, which is:
@@ -17,7 +17,7 @@
  *
  * Contact Information:
  * wlanfae 
-**/
+ */
 #include 
 #include 
 #include 
@@ -37,7 +37,6 @@
 static int channels = 0x3fff;
 static char *ifname = "wlan%d";
 
-
 static const struct rtl819x_ops rtl819xp_ops = {
.nic_type   = NIC_8192E,
.get_eeprom_size= rtl92e_get_eeprom_size,
@@ -100,9 +99,7 @@ static void _rtl92e_hard_data_xmit(struct sk_buff *skb, 
struct net_device *dev,
 static int _rtl92e_down(struct net_device *dev, bool shutdownrf);
 static void _rtl92e_restart(void *data);
 
-/
-   -IO STUFF-
-*/
+/* IO STUFF */
 
 u8 rtl92e_readb(struct net_device *dev, int x)
 {
@@ -140,9 +137,7 @@ void rtl92e_writew(struct net_device *dev, int x, u16 y)
udelay(20);
 }
 
-/
-   -GENERAL FUNCTION-
-*/
+/* GENERAL FUNCTION */
 bool rtl92e_set_rf_state(struct net_device *dev,
 enum rt_rf_power_state StateToSet,
 RT_RF_CHANGE_SOURCE ChangeSource)
@@ -200,7 +195,6 @@ bool rtl92e_set_rf_state(struct net_device *dev,
priv->rtllib->RfOffReason = 0;
bActionAllowed = true;
 
-
if (rtState == eRfOff &&
ChangeSource >= RF_CHANGE_BY_HW)
bConnectBySSID = true;
@@ -223,7 +217,8 @@ bool rtl92e_set_rf_state(struct net_device *dev,
else
priv->blinked_ingpio = false;
rtllib_MgntDisconnect(priv->rtllib,
- 
WLAN_REASON_DISASSOC_STA_HAS_LEFT);
+ WLAN_REASON_DISASSOC_STA_
+   HAS_LEFT);
}
}
if ((ChangeSource == RF_CHANGE_BY_HW) && !priv->bHwRadioOff)
@@ -247,7 +242,6 @@ bool rtl92e_set_rf_state(struct net_device *dev,
 StateToSet, priv->rtllib->RfOffReason);
PHY_SetRFPowerState(dev, StateToSet);
if (StateToSet == eRfOn) {
-
if (bConnectBySSID && priv->blinked_ingpio) {
schedule_delayed_work(
 >associate_procedure_wq, 0);
@@ -346,16 +340,16 @@ static void _rtl92e_update_cap(struct net_device *dev, 
u16 cap)
}
}
 
-   if (net->mode & (IEEE_G|IEEE_N_24G)) {
+   if (net->mode & (IEEE_G | IEEE_N_24G)) {
u8  slot_time_val;
u8  CurSlotTime = priv->slot_time;
 
if ((cap & WLAN_CAPABILITY_SHORT_SLOT_TIME) &&
-  (!priv->rtllib->pHTInfo->bCurrentRT2RTLongSlotTime)) {
+   (!priv->rtllib->pHTInfo->bCurrentRT2RTLongSlotTime)) {
if (CurSlotTime != SHORT_SLOT_TIME) {
slot_time_val = SHORT_SLOT_TIME;
priv->rtllib->SetHwRegHandler(dev,
-HW_VAR_SLOT_TIME, _time_val);
+   HW_VAR_SLOT_TIME, _time_val);
}
} else {
if (CurSlotTime != NON_SHORT_SLOT_TIME) {
@@ -407,7 +401,6 @@ static void _rtl92e_qos_activate(void *data)
for (i = 0; i <  QOS_QUEUE_NUM; i++)
priv->rtllib->SetHwRegHandler(dev, HW_VAR_AC_PARAM, (u8 *)());
 
-
 success:
mutex_unlock(>mutex);
 }
@@ -427,16 +420,16 @@ static int