[PATCH] Staging: netlogic: xlr_net.c Fixed code-style warnings

2014-08-22 Thread Chaitanya Hazarey
Fixed the following warning generated by checkpatch.pl:

WARNING: Missing a blank line after declarations

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/netlogic/xlr_net.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/netlogic/xlr_net.c 
b/drivers/staging/netlogic/xlr_net.c
index 9bf407d..e54e722 100644
--- a/drivers/staging/netlogic/xlr_net.c
+++ b/drivers/staging/netlogic/xlr_net.c
@@ -1104,6 +1104,7 @@ err_gmac:
 static int xlr_net_remove(struct platform_device *pdev)
 {
struct xlr_net_priv *priv = platform_get_drvdata(pdev);
+
unregister_netdev(priv->ndev);
mdiobus_unregister(priv->mii_bus);
mdiobus_free(priv->mii_bus);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/3] Staging: rtl8192u: r8192U_wx.c Fixed a code-style error about trailing whitespace

2014-06-20 Thread Chaitanya Hazarey
Fixed the following error reported by running checkpatch.pl

ERROR: trailing whitespace

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 88b..6808e87 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -952,7 +952,7 @@ static const struct iw_priv_args r8192_private_args[] = {
 
 
 static iw_handler r8192_private_handler[] = {
-   r8192_wx_set_crcmon, 
+   r8192_wx_set_crcmon,
r8192_wx_set_scan_type,
r8192_wx_set_rawtx,
r8192_wx_force_reset,
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/3] Staging: rtl8192u: r8192U_wx.c Fixed code-style warnings

2014-06-20 Thread Chaitanya Hazarey
Fixed some of the following warning generated by checkpatch.pl:

WARNING: Missing a blank line after declarations

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index ceb06d8..d061797 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -57,6 +57,7 @@ static int r8192_wx_get_rate(struct net_device *dev,
 union iwreq_data *wrqu, char *extra)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
+
return ieee80211_wx_get_rate(priv->ieee80211, info, wrqu, extra);
 }
 
@@ -100,6 +101,7 @@ static int r8192_wx_get_rts(struct net_device *dev,
 union iwreq_data *wrqu, char *extra)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
+
return ieee80211_wx_get_rts(priv->ieee80211, info, wrqu, extra);
 }
 
@@ -124,6 +126,7 @@ static int r8192_wx_get_power(struct net_device *dev,
 union iwreq_data *wrqu, char *extra)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
+
return ieee80211_wx_get_power(priv->ieee80211, info, wrqu, extra);
 }
 
@@ -194,6 +197,7 @@ static int r8192_wx_set_mode(struct net_device *dev, struct 
iw_request_info *a,
 {
struct r8192_priv *priv = ieee80211_priv(dev);
int ret;
+
down(&priv->wx_sem);
 
ret = ieee80211_wx_set_mode(priv->ieee80211, a, wrqu, b);
@@ -384,6 +388,7 @@ static int r8192_wx_set_essid(struct net_device *dev,
 {
struct r8192_priv *priv = ieee80211_priv(dev);
int ret;
+
down(&priv->wx_sem);
 
ret = ieee80211_wx_set_essid(priv->ieee80211, a, wrqu, b);
@@ -432,6 +437,7 @@ static int r8192_wx_get_name(struct net_device *dev,
 union iwreq_data *wrqu, char *extra)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
+
return ieee80211_wx_get_name(priv->ieee80211, info, wrqu, extra);
 }
 
@@ -700,6 +706,7 @@ static int r8192_wx_get_sens(struct net_device *dev,
union iwreq_data *wrqu, char *extra)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
+
if (priv->rf_set_sens == NULL)
return -1; /* we have not this support for this radio */
wrqu->sens.value = priv->sens;
@@ -713,8 +720,8 @@ static int r8192_wx_set_sens(struct net_device *dev,
 {
 
struct r8192_priv *priv = ieee80211_priv(dev);
-
short err = 0;
+
down(&priv->wx_sem);
if (priv->rf_set_sens == NULL) {
err = -1; /* we have not this support for this radio */
@@ -813,6 +820,7 @@ static int r8192_wx_set_auth(struct net_device *dev,
 {
int ret = 0;
struct r8192_priv *priv = ieee80211_priv(dev);
+
down(&priv->wx_sem);
ret = ieee80211_wx_set_auth(priv->ieee80211, info, &(data->param), 
extra);
up(&priv->wx_sem);
@@ -826,6 +834,7 @@ static int r8192_wx_set_mlme(struct net_device *dev,
 
int ret = 0;
struct r8192_priv *priv = ieee80211_priv(dev);
+
down(&priv->wx_sem);
ret = ieee80211_wx_set_mlme(priv->ieee80211, info, wrqu, extra);
 
@@ -839,6 +848,7 @@ static int r8192_wx_set_gen_ie(struct net_device *dev,
 {
int ret = 0;
struct r8192_priv *priv = ieee80211_priv(dev);
+
down(&priv->wx_sem);
ret = ieee80211_wx_set_gen_ie(priv->ieee80211, extra, 
data->data.length);
up(&priv->wx_sem);
@@ -956,6 +966,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct 
net_device *dev)
int tmp_level = 0;
int tmp_qual = 0;
int tmp_noise = 0;
+
if (ieee->state < IEEE80211_LINKED) {
wstats->qual.qual = 0;
wstats->qual.level = 0;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] Staging: rtl8192u: r8192U_wx.c Fixed some more code-style warnings about spaces

2014-06-20 Thread Chaitanya Hazarey
Fixed the following warnings issued by checkpatch.pl

WARNING: please, no space before tabs

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index d061797..88b 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -299,7 +299,7 @@ static int rtl8180_wx_get_range(struct net_device *dev,
/* range->retry_capa; *//* What retry options are supported */
/* range->retry_flags; */   /* How to decode max/min retry limit */
/* range->r_time_flags; */  /* How to decode max/min retry life */
-   /* range->min_retry; */ /* Minimal number of retries */
+   /* range->min_retry; */ /* Minimal number of retries */
/* range->max_retry; */ /* Maximal number of retries */
/* range->min_r_time; *//* Minimal retry lifetime */
/* range->max_r_time; *//* Maximal retry lifetime */
@@ -802,7 +802,7 @@ static int r8192_wx_set_enc_ext(struct net_device *dev,
alg,/* KeyType */
(u8 *)ieee->ap_mac_addr,/* MacAddr */
0,  /* DefaultKey */
-   key);   /* KeyContent */
+   key);   /* KeyContent */
}
 
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] Staging: rtl8192u: r8192U_core.c Converted a C99 comment to fix code-style error

2014-06-11 Thread Chaitanya Hazarey
Converted a C99 comment to fix the following error:

ERROR: trailing statements should be on next line

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 512bf5c..67c5918 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -1115,7 +1115,7 @@ struct sk_buff *DrvAggr_Aggregation(struct net_device 
*dev, struct ieee80211_drv
tx_fwinfo->TxRate = MRateToHwRate8190Pci(tcb_desc->data_rate);
tx_fwinfo->EnableCPUDur = tcb_desc->bTxEnableFwCalcDur;
tx_fwinfo->Short = QueryIsShort(tx_fwinfo->TxHT, 
tx_fwinfo->TxRate, tcb_desc);
-   if (tcb_desc->bAMPDUEnable) {//AMPDU enabled
+   if (tcb_desc->bAMPDUEnable) { /* AMPDU enabled */
tx_fwinfo->AllowAggregation = 1;
/* DWORD 1 */
tx_fwinfo->RxMF = tcb_desc->ampdu_factor;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] Staging: rtl8192u: r8192U_core.c Fixed open brace { placement

2014-06-11 Thread Chaitanya Hazarey
Fixed open brace placement to address the following code-style errors:

ERROR: that open brace { should be on the previous line

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_core.c | 69 --
 1 file changed, 23 insertions(+), 46 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 9dba99d..512bf5c 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -1115,8 +1115,7 @@ struct sk_buff *DrvAggr_Aggregation(struct net_device 
*dev, struct ieee80211_drv
tx_fwinfo->TxRate = MRateToHwRate8190Pci(tcb_desc->data_rate);
tx_fwinfo->EnableCPUDur = tcb_desc->bTxEnableFwCalcDur;
tx_fwinfo->Short = QueryIsShort(tx_fwinfo->TxHT, 
tx_fwinfo->TxRate, tcb_desc);
-   if (tcb_desc->bAMPDUEnable)
-   {//AMPDU enabled
+   if (tcb_desc->bAMPDUEnable) {//AMPDU enabled
tx_fwinfo->AllowAggregation = 1;
/* DWORD 1 */
tx_fwinfo->RxMF = tcb_desc->ampdu_factor;
@@ -1331,8 +1330,7 @@ static void rtl8192_config_rate(struct net_device *dev, 
u16 *rate_config)
 
for (i = 0; i < net->rates_len; i++) {
basic_rate = net->rates[i]&0x7f;
-   switch (basic_rate)
-   {
+   switch (basic_rate) {
case MGN_1M:
*rate_config |= RRSR_1M;
break;
@@ -1371,11 +1369,9 @@ static void rtl8192_config_rate(struct net_device *dev, 
u16 *rate_config)
break;
}
}
-   for (i = 0; i < net->rates_ex_len; i++)
-   {
+   for (i = 0; i < net->rates_ex_len; i++) {
basic_rate = net->rates_ex[i]&0x7f;
-   switch (basic_rate)
-   {
+   switch (basic_rate) {
case MGN_1M:
*rate_config |= RRSR_1M;
break;
@@ -1498,8 +1494,7 @@ u16 ComputeTxTime(u16 FrameLength, u16 DataRate, u8 
bManagementFrame,
u16 N_DBPS;
u16 Ceiling;
 
-   if (rtl8192_IsWirelessBMode(DataRate))
-   {
+   if (rtl8192_IsWirelessBMode(DataRate)) {
if (bManagementFrame || !bShortPreamble || DataRate == 10) /* 
long preamble */
FrameTime = (u16)(144+48+(FrameLength*8/(DataRate/10)));
else // Short preamble
@@ -1671,8 +1666,7 @@ static u8 MRateToHwRate8190Pci(u8 rate)
 {
u8  ret = DESC90_RATE1M;
 
-   switch (rate)
-   {
+   switch (rate) {
case MGN_1M:
ret = DESC90_RATE1M;
break;
@@ -1827,8 +1821,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff 
*skb)
tx_fwinfo->TxRate = MRateToHwRate8190Pci(tcb_desc->data_rate);
tx_fwinfo->EnableCPUDur = tcb_desc->bTxEnableFwCalcDur;
tx_fwinfo->Short = QueryIsShort(tx_fwinfo->TxHT, tx_fwinfo->TxRate, 
tcb_desc);
-   if (tcb_desc->bAMPDUEnable) /* AMPDU enabled */
-   {
+   if (tcb_desc->bAMPDUEnable) { /* AMPDU enabled */
tx_fwinfo->AllowAggregation = 1;
/* DWORD 1 */
tx_fwinfo->RxMF = tcb_desc->ampdu_factor;
@@ -2314,8 +2307,7 @@ void rtl8192_update_ratr_table(struct net_device *dev)
break;
case IEEE_N_24G:
case IEEE_N_5G:
-   if (ieee->pHTInfo->PeerMimoPs == 0) /* MIMO_PS_STATIC */
-   {
+   if (ieee->pHTInfo->PeerMimoPs == 0) { /* MIMO_PS_STATIC */
ratr_value &= 0x0007F007;
} else {
if (priv->rf_type == RF_1T2R)
@@ -2699,8 +2691,7 @@ static void rtl8192_read_eeprom_info(struct net_device 
*dev)
else
priv->EEPROM_Def_Ver = 1;
RT_TRACE(COMP_EPROM, "EEPROM_DEF_VER:%d\n", 
priv->EEPROM_Def_Ver);
-   if (priv->EEPROM_Def_Ver == 0) /* old eeprom definition */
-   {
+   if (priv->EEPROM_Def_Ver == 0) { /* old eeprom definition */
int i;
if (bLoad_From_EEPOM)
priv->EEPROMTxPowerLevelCCK = (eprom_read(dev, 
(EEPROM_TxPwIndex_CCK>>1))&0xff) >> 8;
@@ -3111,15 +3102,13 @@ static bool rtl8192_adapter_start(struct net_device 
*dev)
//
 #ifdef TO_DO_LIST
if (Adapter->ResetProgress == RESET_TYPE_NORESET) {
-   if (pMgntInfo->RegRfOff == TRUE) /* User disable RF via 
registry. */
-   {
+   if (pMgntInfo->RegRfOff == TRUE

[PATCH 2/3] Staging: rtl8192u: r8192U_core.c Rearranged statements to fix code-style errors

2014-06-05 Thread Chaitanya Hazarey
Rearranged statements around if and switch statements to address the following 
error:

ERROR: trailing statements should be on next line

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_core.c | 553 -
 1 file changed, 402 insertions(+), 151 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 2a9150d..a9922dd 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -905,7 +905,8 @@ inline u16 ieeerate2rtlrate(int rate)
 static u16 rtl_rate[] = {10, 20, 55, 110, 60, 90, 120, 180, 240, 360, 480, 
540};
 inline u16 rtl8192_rate2rate(short rate)
 {
-   if (rate > 11) return 0;
+   if (rate > 11)
+   return 0;
return rtl_rate[rate];
 }
 
@@ -1114,7 +1115,8 @@ struct sk_buff *DrvAggr_Aggregation(struct net_device 
*dev, struct ieee80211_drv
tx_fwinfo->TxRate = MRateToHwRate8190Pci(tcb_desc->data_rate);
tx_fwinfo->EnableCPUDur = tcb_desc->bTxEnableFwCalcDur;
tx_fwinfo->Short = QueryIsShort(tx_fwinfo->TxHT, 
tx_fwinfo->TxRate, tcb_desc);
-   if (tcb_desc->bAMPDUEnable) {//AMPDU enabled
+   if (tcb_desc->bAMPDUEnable)
+   {//AMPDU enabled
tx_fwinfo->AllowAggregation = 1;
/* DWORD 1 */
tx_fwinfo->RxMF = tcb_desc->ampdu_factor;
@@ -1329,36 +1331,87 @@ static void rtl8192_config_rate(struct net_device *dev, 
u16 *rate_config)
 
for (i = 0; i < net->rates_len; i++) {
basic_rate = net->rates[i]&0x7f;
-   switch (basic_rate) {
-   case MGN_1M:*rate_config |= RRSR_1M;break;
-   case MGN_2M:*rate_config |= RRSR_2M;break;
-   case MGN_5_5M:  *rate_config |= RRSR_5_5M;  break;
-   case MGN_11M:   *rate_config |= RRSR_11M;   break;
-   case MGN_6M:*rate_config |= RRSR_6M;break;
-   case MGN_9M:*rate_config |= RRSR_9M;break;
-   case MGN_12M:   *rate_config |= RRSR_12M;   break;
-   case MGN_18M:   *rate_config |= RRSR_18M;   break;
-   case MGN_24M:   *rate_config |= RRSR_24M;   break;
-   case MGN_36M:   *rate_config |= RRSR_36M;   break;
-   case MGN_48M:   *rate_config |= RRSR_48M;   break;
-   case MGN_54M:   *rate_config |= RRSR_54M;   break;
+   switch (basic_rate)
+   {
+   case MGN_1M:
+   *rate_config |= RRSR_1M;
+   break;
+   case MGN_2M:
+   *rate_config |= RRSR_2M;
+   break;
+   case MGN_5_5M:
+   *rate_config |= RRSR_5_5M;
+   break;
+   case MGN_11M:
+   *rate_config |= RRSR_11M;
+   break;
+   case MGN_6M:
+   *rate_config |= RRSR_6M;
+   break;
+   case MGN_9M:
+   *rate_config |= RRSR_9M;
+   break;
+   case MGN_12M:
+   *rate_config |= RRSR_12M;
+   break;
+   case MGN_18M:
+   *rate_config |= RRSR_18M;
+   break;
+   case MGN_24M:
+   *rate_config |= RRSR_24M;
+   break;
+   case MGN_36M:
+   *rate_config |= RRSR_36M;
+   break;
+   case MGN_48M:
+   *rate_config |= RRSR_48M;
+   break;
+   case MGN_54M:
+   *rate_config |= RRSR_54M;
+   break;
}
}
-   for (i = 0; i < net->rates_ex_len; i++) {
+   for (i = 0; i < net->rates_ex_len; i++)
+   {
basic_rate = net->rates_ex[i]&0x7f;
-   switch (basic_rate) {
-   case MGN_1M:*rate_config |= RRSR_1M;break;
-   case MGN_2M:*rate_config |= RRSR_2M;break;
-   case MGN_5_5M:  *rate_config |= RRSR_5_5M;  break;
-   case MGN_11M:   *rate_config |= RRSR_11M;   break;
-   case MGN_6M:*rate_config |= RRSR_6M;break;
-   case MGN_9M:*rate_config |= RRSR_9M;break;
-   case MGN_

[PATCH 3/3] Staging: rtl8192u: r8192U_core.c Converted some C99 comments to fix code-style errors

2014-06-05 Thread Chaitanya Hazarey
Converted some C99 warnings to fix the following error:

ERROR: trailing statements should be on next line

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_core.c | 34 +-
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index a9922dd..9dba99d 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -1433,7 +1433,7 @@ static void rtl8192_update_cap(struct net_device *dev, 
u16 cap)
 
if (net->mode & (IEEE_G|IEEE_N_24G)) {
u8 slot_time = 0;
-   if ((cap & WLAN_CAPABILITY_SHORT_SLOT) && 
(!priv->ieee80211->pHTInfo->bCurrentRT2RTLongSlotTime)) //short slot time
+   if ((cap & WLAN_CAPABILITY_SHORT_SLOT) && 
(!priv->ieee80211->pHTInfo->bCurrentRT2RTLongSlotTime)) /* short slot time */
slot_time = SHORT_SLOT_TIME;
else //long slot time
slot_time = NON_SHORT_SLOT_TIME;
@@ -1500,11 +1500,11 @@ u16 ComputeTxTime(u16 FrameLength, u16 DataRate, u8 
bManagementFrame,
 
if (rtl8192_IsWirelessBMode(DataRate))
{
-   if (bManagementFrame || !bShortPreamble || DataRate == 10) // 
long preamble
+   if (bManagementFrame || !bShortPreamble || DataRate == 10) /* 
long preamble */
FrameTime = (u16)(144+48+(FrameLength*8/(DataRate/10)));
else // Short preamble
FrameTime = (u16)(72+24+(FrameLength*8/(DataRate/10)));
-   if ((FrameLength*8 % (DataRate/10)) != 0) //Get the Ceilling
+   if ((FrameLength*8 % (DataRate/10)) != 0) /* Get the Ceilling */
FrameTime++;
} else {//802.11g DSSS-OFDM PLCP length field calculation.
N_DBPS = N_DBPSOfRate(DataRate);
@@ -1827,7 +1827,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff 
*skb)
tx_fwinfo->TxRate = MRateToHwRate8190Pci(tcb_desc->data_rate);
tx_fwinfo->EnableCPUDur = tcb_desc->bTxEnableFwCalcDur;
tx_fwinfo->Short = QueryIsShort(tx_fwinfo->TxHT, tx_fwinfo->TxRate, 
tcb_desc);
-   if (tcb_desc->bAMPDUEnable) //AMPDU enabled
+   if (tcb_desc->bAMPDUEnable) /* AMPDU enabled */
{
tx_fwinfo->AllowAggregation = 1;
/* DWORD 1 */
@@ -2314,7 +2314,7 @@ void rtl8192_update_ratr_table(struct net_device *dev)
break;
case IEEE_N_24G:
case IEEE_N_5G:
-   if (ieee->pHTInfo->PeerMimoPs == 0) //MIMO_PS_STATIC
+   if (ieee->pHTInfo->PeerMimoPs == 0) /* MIMO_PS_STATIC */
{
ratr_value &= 0x0007F007;
} else {
@@ -2699,7 +2699,7 @@ static void rtl8192_read_eeprom_info(struct net_device 
*dev)
else
priv->EEPROM_Def_Ver = 1;
RT_TRACE(COMP_EPROM, "EEPROM_DEF_VER:%d\n", 
priv->EEPROM_Def_Ver);
-   if (priv->EEPROM_Def_Ver == 0) //old eeprom definition
+   if (priv->EEPROM_Def_Ver == 0) /* old eeprom definition */
{
int i;
if (bLoad_From_EEPOM)
@@ -3111,14 +3111,14 @@ static bool rtl8192_adapter_start(struct net_device 
*dev)
//
 #ifdef TO_DO_LIST
if (Adapter->ResetProgress == RESET_TYPE_NORESET) {
-   if (pMgntInfo->RegRfOff == TRUE) // User disable RF via 
registry.
+   if (pMgntInfo->RegRfOff == TRUE) /* User disable RF via 
registry. */
{
RT_TRACE((COMP_INIT|COMP_RF), DBG_LOUD, 
("InitializeAdapter819xUsb(): Turn off RF for RegRfOff --\n"));
MgntActSet_RF_State(Adapter, eRfOff, RF_CHANGE_BY_SW);
// Those actions will be discard in MgntActSet_RF_State 
because of the same state
for (eRFPath = 0; eRFPath < pHalData->NumTotalRFPath; 
eRFPath++)
PHY_SetRFReg(Adapter, 
(RF90_RADIO_PATH_E)eRFPath, 0x4, 0xC00, 0x0);
-   } else if (pMgntInfo->RfOffReason > RF_CHANGE_BY_PS) // H/W or 
S/W RF OFF before sleep.
+   } else if (pMgntInfo->RfOffReason > RF_CHANGE_BY_PS) /* H/W or 
S/W RF OFF before sleep. */
{
RT_TRACE((COMP_INIT|COMP_RF), DBG_LOUD, 
("InitializeAdapter819xUsb(): Turn off RF for RfOffReason(%d) --\n", 
pMgntInfo->RfOffReason));
MgntActSet_RF_State(Adapter, eRfOff, 
pMgntInfo->RfOffReason);
@@ -3647,7 +3647,7 @@ void rtl819x_watchdog_wqcallback(struct work_struct *work)
}
if ((priv->force_reset) || (priv->ResetProgress == 

[PATCH 1/3] Staging: rtl8192u: r8192U_core.c Added a space after ','

2014-06-05 Thread Chaitanya Hazarey
Added spaces after ',' to fix the following warning:

ERROR: space required after that ',' (ctx:VxV)

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_core.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 24272c5..2a9150d 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -166,17 +166,17 @@ typedef struct _CHANNEL_LIST {
 } CHANNEL_LIST, *PCHANNEL_LIST;
 
 static CHANNEL_LIST ChannelPlan[] = {
-   
{{1,2,3,4,5,6,7,8,9,10,11,36,40,44,48,52,56,60,64,149,153,157,161,165},24}, 
//FCC
-   {{1,2,3,4,5,6,7,8,9,10,11},11}, 
//IC
-   {{1,2,3,4,5,6,7,8,9,10,11,12,13,36,40,44,48,52,56,60,64},21},   //ETSI
-   {{1,2,3,4,5,6,7,8,9,10,11,12,13},13},//Spain. Change to ETSI.
-   {{1,2,3,4,5,6,7,8,9,10,11,12,13},13},   //France. Change to ETSI.
-   {{1,2,3,4,5,6,7,8,9,10,11,12,13,14,36,40,44,48,52,56,60,64},22},
//MKK   //MKK
-   {{1,2,3,4,5,6,7,8,9,10,11,12,13,14,36,40,44,48,52,56,60,64},22},//MKK1
-   {{1,2,3,4,5,6,7,8,9,10,11,12,13},13},   //Israel.
-   {{1,2,3,4,5,6,7,8,9,10,11,12,13,14,36,40,44,48,52,56,60,64},22},
// For 11a , TELEC
-   {{1,2,3,4,5,6,7,8,9,10,11,12,13,14,36,40,44,48,52,56,60,64}, 22},
//MIC
-   {{1,2,3,4,5,6,7,8,9,10,11,12,13,14},14} 
//For Global Domain. 1-11:active scan, 12-14 passive scan. //+YJ, 080626
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 52, 56, 60, 64, 
149, 153, 157, 161, 165}, 24}, //FCC
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 11},  
//IC
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 56, 
60, 64}, 21},  //ETSI
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13},//Spain. Change 
to ETSI.
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13},  //France. 
Change to ETSI.
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 
56, 60, 64}, 22},  //MKK   //MKK
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 
56, 60, 64}, 22},//MKK1
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13},  //Israel.
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 
56, 60, 64}, 22},  // For 11a , TELEC
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52, 
56, 60, 64}, 22},//MIC
+   {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, 14}   
//For Global Domain. 1-11:active scan, 12-14 passive scan. 
//+YJ, 080626
 };
 
 static void rtl819x_set_channel_map(u8 channel_plan, struct r8192_priv *priv)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/4] Staging: rtl8192u: r8192U_wx.c Removed all C99 comments

2014-06-03 Thread Chaitanya Hazarey
On Tue, Jun 3, 2014 at 2:42 PM, Greg KH  wrote:
> So keep working on things,
> these aren't lost, I'll get to them in a few weeks.
>

Ok will do,

Chaitanya
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/4] Staging: rtl8192u: r8192U_wx.c Removed all C99 comments

2014-06-03 Thread Chaitanya Hazarey
On Tue, Jun 3, 2014 at 11:36 AM, Dan Carpenter  wrote:
> It always feels much better after the dead code is gone.

So patches are still good ? No change required for my side, right ? I
just need to wait for Greg's needle to come to this point and pick
them up.

Best,

Chaitanya
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/4] Staging: rtl8192u: r8192U_wx.c Removed all C99 comments

2014-06-02 Thread Chaitanya Hazarey
To address the error -

ERROR: do not use C99 // comments

Removed all C99 comments.

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 130 +--
 1 file changed, 65 insertions(+), 65 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 7dc2a96..b533784 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -180,8 +180,8 @@ static int r8192_wx_set_crcmon(struct net_device *dev,
  priv->crcmon ? "accepted" : "rejected");
 
if (prev != priv->crcmon && priv->up) {
-   //rtl8180_down(dev);
-   //rtl8180_up(dev);
+   /* rtl8180_down(dev); */
+   /* rtl8180_up(dev); */
}
 
up(&priv->wx_sem);
@@ -249,15 +249,15 @@ static int rtl8180_wx_get_range(struct net_device *dev,
/* ~5 Mb/s real (802.11b) */
range->throughput = 5 * 1000 * 1000;
 
-   // TODO: Not used in 802.11b?
-// range->min_nwid;/* Minimal NWID we are able to set */
-   // TODO: Not used in 802.11b?
-// range->max_nwid;/* Maximal NWID we are able to set */
+   /* TODO: Not used in 802.11b? */
+   /* range->min_nwid; */  /* Minimal NWID we are able to set */
+   /* TODO: Not used in 802.11b? */
+   /* range->max_nwid; */  /* Maximal NWID we are able to set */
 
/* Old Frequency (backward compat - moved lower ) */
-// range->old_num_channels;
-// range->old_num_frequency;
-// range->old_freq[6]; /* Filler to keep "version" at the same offset */
+   /* range->old_num_channels; */
+   /* range->old_num_frequency; */
+   /* range->old_freq[6]; */ /* Filler to keep "version" at the same 
offset */
if (priv->rf_set_sens != NULL)
range->sensitivity = priv->max_sens;/* signal level 
threshold range */
 
@@ -292,26 +292,26 @@ static int rtl8180_wx_get_range(struct net_device *dev,
range->we_version_compiled = WIRELESS_EXT;
range->we_version_source = 16;
 
-// range->retry_capa;  /* What retry options are supported */
-// range->retry_flags; /* How to decode max/min retry limit */
-// range->r_time_flags;/* How to decode max/min retry life */
-// range->min_retry;   /* Minimal number of retries */
-// range->max_retry;   /* Maximal number of retries */
-// range->min_r_time;  /* Minimal retry lifetime */
-// range->max_r_time;  /* Maximal retry lifetime */
+   /* range->retry_capa; *//* What retry options are supported */
+   /* range->retry_flags; */   /* How to decode max/min retry limit */
+   /* range->r_time_flags; */  /* How to decode max/min retry life */
+   /* range->min_retry; */ /* Minimal number of retries */
+   /* range->max_retry; */ /* Maximal number of retries */
+   /* range->min_r_time; *//* Minimal retry lifetime */
+   /* range->max_r_time; *//* Maximal retry lifetime */
 
 
for (i = 0, val = 0; i < 14; i++) {
 
-   // Include only legal frequencies for some countries
+   /* Include only legal frequencies for some countries */
if ((GET_DOT11D_INFO(priv->ieee80211)->channel_map)[i+1]) {
range->freq[val].i = i + 1;
range->freq[val].m = ieee80211_wlan_frequencies[i] * 
10;
range->freq[val].e = 1;
val++;
} else {
-   // FIXME: do we need to set anything for channels
-   // we don't use ?
+   /* FIXME: do we need to set anything for channels */
+   /* we don't use ? */
}
 
if (val == IW_MAX_FREQUENCIES)
@@ -478,7 +478,7 @@ static int r8192_wx_set_wap(struct net_device *dev,
 
int ret;
struct r8192_priv *priv = ieee80211_priv(dev);
-//struct sockaddr *temp = (struct sockaddr *)awrq;
+   /* struct sockaddr *temp = (struct sockaddr *)awrq; */
down(&priv->wx_sem);
 
ret = ieee80211_wx_set_wap(priv->ieee80211, info, awrq, extra);
@@ -517,11 +517,11 @@ static int r8192_wx_set_enc(struct net_device *dev,
struct ieee80211_device *ieee = priv->ieee80211;
int ret;
 
-   //u32 TargetContent;
+   /* u32 TargetContent; */
u32 hwkey[4] = {0, 0, 0, 0};
u8 mask = 0xff;
u32 key_idx = 0;
-   //u8 broadcast_addr[6] ={   0xff,0xff,0xff,0xff,0xff,0xff};
+   /* u8 broadcast_addr[6] ={  0xff,0xff,0xff,0xff,0xff,0xff}; */
u8 zero_addr[4][6] = {  {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  

[PATCH 1/4] Staging: rtl8192u: r8192U_wx.c removed some dead code

2014-06-02 Thread Chaitanya Hazarey
Removed dead code, commented out printks and DMESG.

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 675a12d..7dc2a96 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -341,10 +341,8 @@ static int r8192_wx_set_scan(struct net_device *dev, 
struct iw_request_info *a,
if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
struct iw_scan_req *req = (struct iw_scan_req *)b;
if (req->essid_len) {
-   //printk("==**&*&*&**===>scan set ssid:%s\n", 
req->essid);
ieee->current_network.ssid_len = req->essid_len;
memcpy(ieee->current_network.ssid, req->essid, 
req->essid_len);
-   //printk("=>network ssid:%s\n", 
ieee->current_network.ssid);
}
}
 
@@ -703,7 +701,6 @@ static int r8192_wx_get_retry(struct net_device *dev,
wrqu->retry.flags = IW_RETRY_LIMIT | IW_RETRY_MIN;
wrqu->retry.value = priv->retry_data;
}
-   //printk("returning %d",wrqu->retry.value);
 
 
return 0;
@@ -730,7 +727,6 @@ static int r8192_wx_set_sens(struct net_device *dev,
 
short err = 0;
down(&priv->wx_sem);
-   //DMESG("attempt to set sensivity to %ddb",wrqu->sens.value);
if (priv->rf_set_sens == NULL) {
err = -1; /* we have not this support for this radio */
goto exit;
@@ -754,7 +750,6 @@ static int r8192_wx_set_enc_ext(struct net_device *dev,
int ret = 0;
struct r8192_priv *priv = ieee80211_priv(dev);
struct ieee80211_device *ieee = priv->ieee80211;
-   //printk("===>%s()\n", __func__);
 
 
down(&priv->wx_sem);
@@ -828,7 +823,6 @@ static int r8192_wx_set_auth(struct net_device *dev,
union iwreq_data *data, char *extra)
 {
int ret = 0;
-   //printk(">%s()\n", __func__);
struct r8192_priv *priv = ieee80211_priv(dev);
down(&priv->wx_sem);
ret = ieee80211_wx_set_auth(priv->ieee80211, info, &(data->param), 
extra);
@@ -840,7 +834,6 @@ static int r8192_wx_set_mlme(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
 {
-   //printk(">%s()\n", __func__);
 
int ret = 0;
struct r8192_priv *priv = ieee80211_priv(dev);
@@ -855,13 +848,11 @@ static int r8192_wx_set_gen_ie(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *data, char *extra)
 {
-  //printk(">%s(), len:%d\n", __func__, data->length);
int ret = 0;
struct r8192_priv *priv = ieee80211_priv(dev);
down(&priv->wx_sem);
ret = ieee80211_wx_set_gen_ie(priv->ieee80211, extra, 
data->data.length);
up(&priv->wx_sem);
-   //printk("<==%s(), ret:%d\n", __func__, ret);
return ret;
 
 
@@ -992,7 +983,6 @@ struct iw_statistics *r8192_get_wireless_stats(struct 
net_device *dev)
tmp_level = (&ieee->current_network)->stats.rssi;
tmp_qual = (&ieee->current_network)->stats.signal;
tmp_noise = (&ieee->current_network)->stats.noise;
-   //printk("level:%d, qual:%d, noise:%d\n", tmp_level, tmp_qual, 
tmp_noise);
 
wstats->qual.level = tmp_level;
wstats->qual.qual = tmp_qual;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/4] Staging: rtl8192u: r8192U_wx.c Removed some more commented out dead code

2014-06-02 Thread Chaitanya Hazarey
Removed dead code from the file.

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 18 +-
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 09b1e81..ceb06d8 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -516,12 +516,9 @@ static int r8192_wx_set_enc(struct net_device *dev,
struct r8192_priv *priv = ieee80211_priv(dev);
struct ieee80211_device *ieee = priv->ieee80211;
int ret;
-
-   /* u32 TargetContent; */
u32 hwkey[4] = {0, 0, 0, 0};
u8 mask = 0xff;
u32 key_idx = 0;
-   /* u8 broadcast_addr[6] ={  0xff,0xff,0xff,0xff,0xff,0xff}; */
u8 zero_addr[4][6] = {  {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
@@ -667,14 +664,6 @@ static int r8192_wx_set_retry(struct net_device *dev,
 */
 
rtl8192_commit(dev);
-   /*
-   if(priv->up){
-   rtl8180_rtx_disable(dev);
-   rtl8180_rx_enable(dev);
-   rtl8180_tx_enable(dev);
-
-   }
-   */
 exit:
up(&priv->wx_sem);
 
@@ -953,14 +942,9 @@ static const struct iw_priv_args r8192_private_args[] = {
 
 
 static iw_handler r8192_private_handler[] = {
-   /* r8192_wx_set_monitor, */ /* SIOCIWFIRSTPRIV */
-   r8192_wx_set_crcmon,   /*SIOCIWSECONDPRIV*/
-   /* r8192_wx_set_forceassociate, */
-   /* r8192_wx_set_beaconinterval, */
-   /* r8192_wx_set_monitor_type, */
+   r8192_wx_set_crcmon, 
r8192_wx_set_scan_type,
r8192_wx_set_rawtx,
-   /* r8192_wx_null, */
r8192_wx_force_reset,
 };
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/4] Staging: rtl8192u: r8192U_wx.c Added a single space for code-style issue

2014-06-02 Thread Chaitanya Hazarey
Added a space around '|' to address:

ERROR: need consistent spacing around '|' (ctx:VxW)

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index b533784..09b1e81 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -987,7 +987,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct 
net_device *dev)
wstats->qual.level = tmp_level;
wstats->qual.qual = tmp_qual;
wstats->qual.noise = tmp_noise;
-   wstats->qual.updated = IW_QUAL_ALL_UPDATED| IW_QUAL_DBM;
+   wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
return wstats;
 }
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] Staging: rtl8192u: r8192U_wx.c Fixed a misplaced brace

2014-05-29 Thread Chaitanya Hazarey
Ok will be quite for till the last ones get accepted.

Sorry for the bother !

Chaitanya

On Thu, May 29, 2014 at 2:41 PM, Dan Carpenter  wrote:
> On Thu, May 29, 2014 at 02:00:51PM -0700, Greg KH wrote:
>> On Thu, May 29, 2014 at 01:43:01PM -0700, Chaitanya Hazarey wrote:
>> > I have 1/5 through to 5/5. Will resend rightaway with slightly changed
>> > subjects.
>>
>> What does that have to do with patch 2/2 here?  You sent a 1/2 patch, so
>> obviously there should be a 2/2 somewhere...
>>
>> confused,
>
> Heh.  You recieved [patch 2/2] but you didn't like it.
> https://lkml.org/lkml/2014/5/28/818
>
> Meanwhile Chaitanya keeps resending these patches over and over so now
> I have around 5 million of them in my inbox.  Calm down, Chaitanya!
> Give us a little time to catch up before you resend.
>
> The latest couple versions of the patches have been ok, btw.
>
> regards,
> dan carpenter
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/5] Staging: rtl8192u: r8192U_wx.c Fixed one misplaced brace

2014-05-29 Thread Chaitanya Hazarey
Fixed a misplaced brace in the r8192_wx_set_scan_type function.

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 1af7c5d..675a12d 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -616,7 +616,8 @@ static int r8192_wx_set_enc(struct net_device *dev,
 
 
 static int r8192_wx_set_scan_type(struct net_device *dev, struct 
iw_request_info *aa,
-   union iwreq_data *wrqu, char *p){
+   union iwreq_data *wrqu, char *p)
+{
 
struct r8192_priv *priv = ieee80211_priv(dev);
int *parms = (int *)p;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/5] Staging: rtl8192u: r8192U_wx.c Removed all C99 comments

2014-05-29 Thread Chaitanya Hazarey
To address the error -

ERROR: do not use C99 // comments

Removed all C99 comments.

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 130 +--
 1 file changed, 65 insertions(+), 65 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 7dc2a96..b533784 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -180,8 +180,8 @@ static int r8192_wx_set_crcmon(struct net_device *dev,
  priv->crcmon ? "accepted" : "rejected");
 
if (prev != priv->crcmon && priv->up) {
-   //rtl8180_down(dev);
-   //rtl8180_up(dev);
+   /* rtl8180_down(dev); */
+   /* rtl8180_up(dev); */
}
 
up(&priv->wx_sem);
@@ -249,15 +249,15 @@ static int rtl8180_wx_get_range(struct net_device *dev,
/* ~5 Mb/s real (802.11b) */
range->throughput = 5 * 1000 * 1000;
 
-   // TODO: Not used in 802.11b?
-// range->min_nwid;/* Minimal NWID we are able to set */
-   // TODO: Not used in 802.11b?
-// range->max_nwid;/* Maximal NWID we are able to set */
+   /* TODO: Not used in 802.11b? */
+   /* range->min_nwid; */  /* Minimal NWID we are able to set */
+   /* TODO: Not used in 802.11b? */
+   /* range->max_nwid; */  /* Maximal NWID we are able to set */
 
/* Old Frequency (backward compat - moved lower ) */
-// range->old_num_channels;
-// range->old_num_frequency;
-// range->old_freq[6]; /* Filler to keep "version" at the same offset */
+   /* range->old_num_channels; */
+   /* range->old_num_frequency; */
+   /* range->old_freq[6]; */ /* Filler to keep "version" at the same 
offset */
if (priv->rf_set_sens != NULL)
range->sensitivity = priv->max_sens;/* signal level 
threshold range */
 
@@ -292,26 +292,26 @@ static int rtl8180_wx_get_range(struct net_device *dev,
range->we_version_compiled = WIRELESS_EXT;
range->we_version_source = 16;
 
-// range->retry_capa;  /* What retry options are supported */
-// range->retry_flags; /* How to decode max/min retry limit */
-// range->r_time_flags;/* How to decode max/min retry life */
-// range->min_retry;   /* Minimal number of retries */
-// range->max_retry;   /* Maximal number of retries */
-// range->min_r_time;  /* Minimal retry lifetime */
-// range->max_r_time;  /* Maximal retry lifetime */
+   /* range->retry_capa; *//* What retry options are supported */
+   /* range->retry_flags; */   /* How to decode max/min retry limit */
+   /* range->r_time_flags; */  /* How to decode max/min retry life */
+   /* range->min_retry; */ /* Minimal number of retries */
+   /* range->max_retry; */ /* Maximal number of retries */
+   /* range->min_r_time; *//* Minimal retry lifetime */
+   /* range->max_r_time; *//* Maximal retry lifetime */
 
 
for (i = 0, val = 0; i < 14; i++) {
 
-   // Include only legal frequencies for some countries
+   /* Include only legal frequencies for some countries */
if ((GET_DOT11D_INFO(priv->ieee80211)->channel_map)[i+1]) {
range->freq[val].i = i + 1;
range->freq[val].m = ieee80211_wlan_frequencies[i] * 
10;
range->freq[val].e = 1;
val++;
} else {
-   // FIXME: do we need to set anything for channels
-   // we don't use ?
+   /* FIXME: do we need to set anything for channels */
+   /* we don't use ? */
}
 
if (val == IW_MAX_FREQUENCIES)
@@ -478,7 +478,7 @@ static int r8192_wx_set_wap(struct net_device *dev,
 
int ret;
struct r8192_priv *priv = ieee80211_priv(dev);
-//struct sockaddr *temp = (struct sockaddr *)awrq;
+   /* struct sockaddr *temp = (struct sockaddr *)awrq; */
down(&priv->wx_sem);
 
ret = ieee80211_wx_set_wap(priv->ieee80211, info, awrq, extra);
@@ -517,11 +517,11 @@ static int r8192_wx_set_enc(struct net_device *dev,
struct ieee80211_device *ieee = priv->ieee80211;
int ret;
 
-   //u32 TargetContent;
+   /* u32 TargetContent; */
u32 hwkey[4] = {0, 0, 0, 0};
u8 mask = 0xff;
u32 key_idx = 0;
-   //u8 broadcast_addr[6] ={   0xff,0xff,0xff,0xff,0xff,0xff};
+   /* u8 broadcast_addr[6] ={  0xff,0xff,0xff,0xff,0xff,0xff}; */
u8 zero_addr[4][6] = {  {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  

[PATCH 4/5] Staging: rtl8192u: r8192U_wx.c Added a single space for code-style issue

2014-05-29 Thread Chaitanya Hazarey
Added a space around '|' to address:

ERROR: need consistent spacing around '|' (ctx:VxW)

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index b533784..09b1e81 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -987,7 +987,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct 
net_device *dev)
wstats->qual.level = tmp_level;
wstats->qual.qual = tmp_qual;
wstats->qual.noise = tmp_noise;
-   wstats->qual.updated = IW_QUAL_ALL_UPDATED| IW_QUAL_DBM;
+   wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
return wstats;
 }
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 5/5] Staging: rtl8192u: r8192U_wx.c Removed commented dead code

2014-05-29 Thread Chaitanya Hazarey
Removed dead code from the file.

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 18 +-
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 09b1e81..ceb06d8 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -516,12 +516,9 @@ static int r8192_wx_set_enc(struct net_device *dev,
struct r8192_priv *priv = ieee80211_priv(dev);
struct ieee80211_device *ieee = priv->ieee80211;
int ret;
-
-   /* u32 TargetContent; */
u32 hwkey[4] = {0, 0, 0, 0};
u8 mask = 0xff;
u32 key_idx = 0;
-   /* u8 broadcast_addr[6] ={  0xff,0xff,0xff,0xff,0xff,0xff}; */
u8 zero_addr[4][6] = {  {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
@@ -667,14 +664,6 @@ static int r8192_wx_set_retry(struct net_device *dev,
 */
 
rtl8192_commit(dev);
-   /*
-   if(priv->up){
-   rtl8180_rtx_disable(dev);
-   rtl8180_rx_enable(dev);
-   rtl8180_tx_enable(dev);
-
-   }
-   */
 exit:
up(&priv->wx_sem);
 
@@ -953,14 +942,9 @@ static const struct iw_priv_args r8192_private_args[] = {
 
 
 static iw_handler r8192_private_handler[] = {
-   /* r8192_wx_set_monitor, */ /* SIOCIWFIRSTPRIV */
-   r8192_wx_set_crcmon,   /*SIOCIWSECONDPRIV*/
-   /* r8192_wx_set_forceassociate, */
-   /* r8192_wx_set_beaconinterval, */
-   /* r8192_wx_set_monitor_type, */
+   r8192_wx_set_crcmon, 
r8192_wx_set_scan_type,
r8192_wx_set_rawtx,
-   /* r8192_wx_null, */
r8192_wx_force_reset,
 };
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/5] Staging: rtl8192u: r8192U_wx.c removed commented dead code

2014-05-29 Thread Chaitanya Hazarey
Removed dead code, commented out printks and DMESG.

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 675a12d..7dc2a96 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -341,10 +341,8 @@ static int r8192_wx_set_scan(struct net_device *dev, 
struct iw_request_info *a,
if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
struct iw_scan_req *req = (struct iw_scan_req *)b;
if (req->essid_len) {
-   //printk("==**&*&*&**===>scan set ssid:%s\n", 
req->essid);
ieee->current_network.ssid_len = req->essid_len;
memcpy(ieee->current_network.ssid, req->essid, 
req->essid_len);
-   //printk("=>network ssid:%s\n", 
ieee->current_network.ssid);
}
}
 
@@ -703,7 +701,6 @@ static int r8192_wx_get_retry(struct net_device *dev,
wrqu->retry.flags = IW_RETRY_LIMIT | IW_RETRY_MIN;
wrqu->retry.value = priv->retry_data;
}
-   //printk("returning %d",wrqu->retry.value);
 
 
return 0;
@@ -730,7 +727,6 @@ static int r8192_wx_set_sens(struct net_device *dev,
 
short err = 0;
down(&priv->wx_sem);
-   //DMESG("attempt to set sensivity to %ddb",wrqu->sens.value);
if (priv->rf_set_sens == NULL) {
err = -1; /* we have not this support for this radio */
goto exit;
@@ -754,7 +750,6 @@ static int r8192_wx_set_enc_ext(struct net_device *dev,
int ret = 0;
struct r8192_priv *priv = ieee80211_priv(dev);
struct ieee80211_device *ieee = priv->ieee80211;
-   //printk("===>%s()\n", __func__);
 
 
down(&priv->wx_sem);
@@ -828,7 +823,6 @@ static int r8192_wx_set_auth(struct net_device *dev,
union iwreq_data *data, char *extra)
 {
int ret = 0;
-   //printk(">%s()\n", __func__);
struct r8192_priv *priv = ieee80211_priv(dev);
down(&priv->wx_sem);
ret = ieee80211_wx_set_auth(priv->ieee80211, info, &(data->param), 
extra);
@@ -840,7 +834,6 @@ static int r8192_wx_set_mlme(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
 {
-   //printk(">%s()\n", __func__);
 
int ret = 0;
struct r8192_priv *priv = ieee80211_priv(dev);
@@ -855,13 +848,11 @@ static int r8192_wx_set_gen_ie(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *data, char *extra)
 {
-  //printk(">%s(), len:%d\n", __func__, data->length);
int ret = 0;
struct r8192_priv *priv = ieee80211_priv(dev);
down(&priv->wx_sem);
ret = ieee80211_wx_set_gen_ie(priv->ieee80211, extra, 
data->data.length);
up(&priv->wx_sem);
-   //printk("<==%s(), ret:%d\n", __func__, ret);
return ret;
 
 
@@ -992,7 +983,6 @@ struct iw_statistics *r8192_get_wireless_stats(struct 
net_device *dev)
tmp_level = (&ieee->current_network)->stats.rssi;
tmp_qual = (&ieee->current_network)->stats.signal;
tmp_noise = (&ieee->current_network)->stats.noise;
-   //printk("level:%d, qual:%d, noise:%d\n", tmp_level, tmp_qual, 
tmp_noise);
 
wstats->qual.level = tmp_level;
wstats->qual.qual = tmp_qual;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] Staging: rtl8192u: r8192U_wx.c Fixed a misplaced brace

2014-05-29 Thread Chaitanya Hazarey
I have 1/5 through to 5/5. Will resend rightaway with slightly changed
subjects.

Chaitanya

On Thu, May 29, 2014 at 1:43 PM, Greg KH  wrote:
> On Wed, May 28, 2014 at 04:23:47PM -0700, Chaitanya Hazarey wrote:
>> Fixed a misplaced brace in a function
>>
>> Signed-off-by: Chaitanya Hazarey 
>> ---
>>  drivers/staging/rtl8192u/r8192U_wx.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> Where is patch 2/2 ?
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/5] Staging: rtl8192u: r8192U_wx.c Fixed a misplaced brace

2014-05-29 Thread Chaitanya Hazarey
Fixed a misplaced brace in the r8192_wx_set_scan_type function.

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 1af7c5d..675a12d 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -616,7 +616,8 @@ static int r8192_wx_set_enc(struct net_device *dev,
 
 
 static int r8192_wx_set_scan_type(struct net_device *dev, struct 
iw_request_info *aa,
-   union iwreq_data *wrqu, char *p){
+   union iwreq_data *wrqu, char *p)
+{
 
struct r8192_priv *priv = ieee80211_priv(dev);
int *parms = (int *)p;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/5] Staging: rtl8192u: r8192U_wx.c Removed C99 comments

2014-05-29 Thread Chaitanya Hazarey
To address the error -

ERROR: do not use C99 // comments

Removed all C99 comments.

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 130 +--
 1 file changed, 65 insertions(+), 65 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 7dc2a96..b533784 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -180,8 +180,8 @@ static int r8192_wx_set_crcmon(struct net_device *dev,
  priv->crcmon ? "accepted" : "rejected");
 
if (prev != priv->crcmon && priv->up) {
-   //rtl8180_down(dev);
-   //rtl8180_up(dev);
+   /* rtl8180_down(dev); */
+   /* rtl8180_up(dev); */
}
 
up(&priv->wx_sem);
@@ -249,15 +249,15 @@ static int rtl8180_wx_get_range(struct net_device *dev,
/* ~5 Mb/s real (802.11b) */
range->throughput = 5 * 1000 * 1000;
 
-   // TODO: Not used in 802.11b?
-// range->min_nwid;/* Minimal NWID we are able to set */
-   // TODO: Not used in 802.11b?
-// range->max_nwid;/* Maximal NWID we are able to set */
+   /* TODO: Not used in 802.11b? */
+   /* range->min_nwid; */  /* Minimal NWID we are able to set */
+   /* TODO: Not used in 802.11b? */
+   /* range->max_nwid; */  /* Maximal NWID we are able to set */
 
/* Old Frequency (backward compat - moved lower ) */
-// range->old_num_channels;
-// range->old_num_frequency;
-// range->old_freq[6]; /* Filler to keep "version" at the same offset */
+   /* range->old_num_channels; */
+   /* range->old_num_frequency; */
+   /* range->old_freq[6]; */ /* Filler to keep "version" at the same 
offset */
if (priv->rf_set_sens != NULL)
range->sensitivity = priv->max_sens;/* signal level 
threshold range */
 
@@ -292,26 +292,26 @@ static int rtl8180_wx_get_range(struct net_device *dev,
range->we_version_compiled = WIRELESS_EXT;
range->we_version_source = 16;
 
-// range->retry_capa;  /* What retry options are supported */
-// range->retry_flags; /* How to decode max/min retry limit */
-// range->r_time_flags;/* How to decode max/min retry life */
-// range->min_retry;   /* Minimal number of retries */
-// range->max_retry;   /* Maximal number of retries */
-// range->min_r_time;  /* Minimal retry lifetime */
-// range->max_r_time;  /* Maximal retry lifetime */
+   /* range->retry_capa; *//* What retry options are supported */
+   /* range->retry_flags; */   /* How to decode max/min retry limit */
+   /* range->r_time_flags; */  /* How to decode max/min retry life */
+   /* range->min_retry; */ /* Minimal number of retries */
+   /* range->max_retry; */ /* Maximal number of retries */
+   /* range->min_r_time; *//* Minimal retry lifetime */
+   /* range->max_r_time; *//* Maximal retry lifetime */
 
 
for (i = 0, val = 0; i < 14; i++) {
 
-   // Include only legal frequencies for some countries
+   /* Include only legal frequencies for some countries */
if ((GET_DOT11D_INFO(priv->ieee80211)->channel_map)[i+1]) {
range->freq[val].i = i + 1;
range->freq[val].m = ieee80211_wlan_frequencies[i] * 
10;
range->freq[val].e = 1;
val++;
} else {
-   // FIXME: do we need to set anything for channels
-   // we don't use ?
+   /* FIXME: do we need to set anything for channels */
+   /* we don't use ? */
}
 
if (val == IW_MAX_FREQUENCIES)
@@ -478,7 +478,7 @@ static int r8192_wx_set_wap(struct net_device *dev,
 
int ret;
struct r8192_priv *priv = ieee80211_priv(dev);
-//struct sockaddr *temp = (struct sockaddr *)awrq;
+   /* struct sockaddr *temp = (struct sockaddr *)awrq; */
down(&priv->wx_sem);
 
ret = ieee80211_wx_set_wap(priv->ieee80211, info, awrq, extra);
@@ -517,11 +517,11 @@ static int r8192_wx_set_enc(struct net_device *dev,
struct ieee80211_device *ieee = priv->ieee80211;
int ret;
 
-   //u32 TargetContent;
+   /* u32 TargetContent; */
u32 hwkey[4] = {0, 0, 0, 0};
u8 mask = 0xff;
u32 key_idx = 0;
-   //u8 broadcast_addr[6] ={   0xff,0xff,0xff,0xff,0xff,0xff};
+   /* u8 broadcast_addr[6] ={  0xff,0xff,0xff,0xff,0xff,0xff}; */
u8 zero_addr[4][6] = {  {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  

[PATCH 2/5] Staging: rtl8192u: r8192U_wx.c removed dead code

2014-05-29 Thread Chaitanya Hazarey
Removed dead code, commented out printks and DMESG.

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 675a12d..7dc2a96 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -341,10 +341,8 @@ static int r8192_wx_set_scan(struct net_device *dev, 
struct iw_request_info *a,
if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
struct iw_scan_req *req = (struct iw_scan_req *)b;
if (req->essid_len) {
-   //printk("==**&*&*&**===>scan set ssid:%s\n", 
req->essid);
ieee->current_network.ssid_len = req->essid_len;
memcpy(ieee->current_network.ssid, req->essid, 
req->essid_len);
-   //printk("=>network ssid:%s\n", 
ieee->current_network.ssid);
}
}
 
@@ -703,7 +701,6 @@ static int r8192_wx_get_retry(struct net_device *dev,
wrqu->retry.flags = IW_RETRY_LIMIT | IW_RETRY_MIN;
wrqu->retry.value = priv->retry_data;
}
-   //printk("returning %d",wrqu->retry.value);
 
 
return 0;
@@ -730,7 +727,6 @@ static int r8192_wx_set_sens(struct net_device *dev,
 
short err = 0;
down(&priv->wx_sem);
-   //DMESG("attempt to set sensivity to %ddb",wrqu->sens.value);
if (priv->rf_set_sens == NULL) {
err = -1; /* we have not this support for this radio */
goto exit;
@@ -754,7 +750,6 @@ static int r8192_wx_set_enc_ext(struct net_device *dev,
int ret = 0;
struct r8192_priv *priv = ieee80211_priv(dev);
struct ieee80211_device *ieee = priv->ieee80211;
-   //printk("===>%s()\n", __func__);
 
 
down(&priv->wx_sem);
@@ -828,7 +823,6 @@ static int r8192_wx_set_auth(struct net_device *dev,
union iwreq_data *data, char *extra)
 {
int ret = 0;
-   //printk(">%s()\n", __func__);
struct r8192_priv *priv = ieee80211_priv(dev);
down(&priv->wx_sem);
ret = ieee80211_wx_set_auth(priv->ieee80211, info, &(data->param), 
extra);
@@ -840,7 +834,6 @@ static int r8192_wx_set_mlme(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
 {
-   //printk(">%s()\n", __func__);
 
int ret = 0;
struct r8192_priv *priv = ieee80211_priv(dev);
@@ -855,13 +848,11 @@ static int r8192_wx_set_gen_ie(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *data, char *extra)
 {
-  //printk(">%s(), len:%d\n", __func__, data->length);
int ret = 0;
struct r8192_priv *priv = ieee80211_priv(dev);
down(&priv->wx_sem);
ret = ieee80211_wx_set_gen_ie(priv->ieee80211, extra, 
data->data.length);
up(&priv->wx_sem);
-   //printk("<==%s(), ret:%d\n", __func__, ret);
return ret;
 
 
@@ -992,7 +983,6 @@ struct iw_statistics *r8192_get_wireless_stats(struct 
net_device *dev)
tmp_level = (&ieee->current_network)->stats.rssi;
tmp_qual = (&ieee->current_network)->stats.signal;
tmp_noise = (&ieee->current_network)->stats.noise;
-   //printk("level:%d, qual:%d, noise:%d\n", tmp_level, tmp_qual, 
tmp_noise);
 
wstats->qual.level = tmp_level;
wstats->qual.qual = tmp_qual;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/5] Staging: rtl8192u: r8192U_wx.c Added a space for code-style issue

2014-05-29 Thread Chaitanya Hazarey
Added a space around '|' to address:

ERROR: need consistent spacing around '|' (ctx:VxW)

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index b533784..09b1e81 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -987,7 +987,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct 
net_device *dev)
wstats->qual.level = tmp_level;
wstats->qual.qual = tmp_qual;
wstats->qual.noise = tmp_noise;
-   wstats->qual.updated = IW_QUAL_ALL_UPDATED| IW_QUAL_DBM;
+   wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
return wstats;
 }
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 5/5] Staging: rtl8192u: r8192U_wx.c Removed commented out dead code

2014-05-29 Thread Chaitanya Hazarey
Removed dead code from the file.

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 18 +-
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 09b1e81..ceb06d8 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -516,12 +516,9 @@ static int r8192_wx_set_enc(struct net_device *dev,
struct r8192_priv *priv = ieee80211_priv(dev);
struct ieee80211_device *ieee = priv->ieee80211;
int ret;
-
-   /* u32 TargetContent; */
u32 hwkey[4] = {0, 0, 0, 0};
u8 mask = 0xff;
u32 key_idx = 0;
-   /* u8 broadcast_addr[6] ={  0xff,0xff,0xff,0xff,0xff,0xff}; */
u8 zero_addr[4][6] = {  {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
@@ -667,14 +664,6 @@ static int r8192_wx_set_retry(struct net_device *dev,
 */
 
rtl8192_commit(dev);
-   /*
-   if(priv->up){
-   rtl8180_rtx_disable(dev);
-   rtl8180_rx_enable(dev);
-   rtl8180_tx_enable(dev);
-
-   }
-   */
 exit:
up(&priv->wx_sem);
 
@@ -953,14 +942,9 @@ static const struct iw_priv_args r8192_private_args[] = {
 
 
 static iw_handler r8192_private_handler[] = {
-   /* r8192_wx_set_monitor, */ /* SIOCIWFIRSTPRIV */
-   r8192_wx_set_crcmon,   /*SIOCIWSECONDPRIV*/
-   /* r8192_wx_set_forceassociate, */
-   /* r8192_wx_set_beaconinterval, */
-   /* r8192_wx_set_monitor_type, */
+   r8192_wx_set_crcmon, 
r8192_wx_set_scan_type,
r8192_wx_set_rawtx,
-   /* r8192_wx_null, */
r8192_wx_force_reset,
 };
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/5] Staging: rtl8192u: r8192U_wx.c removed dead code

2014-05-28 Thread Chaitanya Hazarey
Removed dead code, commented out printks and DMESG.

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 675a12d..7dc2a96 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -341,10 +341,8 @@ static int r8192_wx_set_scan(struct net_device *dev, 
struct iw_request_info *a,
if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
struct iw_scan_req *req = (struct iw_scan_req *)b;
if (req->essid_len) {
-   //printk("==**&*&*&**===>scan set ssid:%s\n", 
req->essid);
ieee->current_network.ssid_len = req->essid_len;
memcpy(ieee->current_network.ssid, req->essid, 
req->essid_len);
-   //printk("=>network ssid:%s\n", 
ieee->current_network.ssid);
}
}
 
@@ -703,7 +701,6 @@ static int r8192_wx_get_retry(struct net_device *dev,
wrqu->retry.flags = IW_RETRY_LIMIT | IW_RETRY_MIN;
wrqu->retry.value = priv->retry_data;
}
-   //printk("returning %d",wrqu->retry.value);
 
 
return 0;
@@ -730,7 +727,6 @@ static int r8192_wx_set_sens(struct net_device *dev,
 
short err = 0;
down(&priv->wx_sem);
-   //DMESG("attempt to set sensivity to %ddb",wrqu->sens.value);
if (priv->rf_set_sens == NULL) {
err = -1; /* we have not this support for this radio */
goto exit;
@@ -754,7 +750,6 @@ static int r8192_wx_set_enc_ext(struct net_device *dev,
int ret = 0;
struct r8192_priv *priv = ieee80211_priv(dev);
struct ieee80211_device *ieee = priv->ieee80211;
-   //printk("===>%s()\n", __func__);
 
 
down(&priv->wx_sem);
@@ -828,7 +823,6 @@ static int r8192_wx_set_auth(struct net_device *dev,
union iwreq_data *data, char *extra)
 {
int ret = 0;
-   //printk(">%s()\n", __func__);
struct r8192_priv *priv = ieee80211_priv(dev);
down(&priv->wx_sem);
ret = ieee80211_wx_set_auth(priv->ieee80211, info, &(data->param), 
extra);
@@ -840,7 +834,6 @@ static int r8192_wx_set_mlme(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
 {
-   //printk(">%s()\n", __func__);
 
int ret = 0;
struct r8192_priv *priv = ieee80211_priv(dev);
@@ -855,13 +848,11 @@ static int r8192_wx_set_gen_ie(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *data, char *extra)
 {
-  //printk(">%s(), len:%d\n", __func__, data->length);
int ret = 0;
struct r8192_priv *priv = ieee80211_priv(dev);
down(&priv->wx_sem);
ret = ieee80211_wx_set_gen_ie(priv->ieee80211, extra, 
data->data.length);
up(&priv->wx_sem);
-   //printk("<==%s(), ret:%d\n", __func__, ret);
return ret;
 
 
@@ -992,7 +983,6 @@ struct iw_statistics *r8192_get_wireless_stats(struct 
net_device *dev)
tmp_level = (&ieee->current_network)->stats.rssi;
tmp_qual = (&ieee->current_network)->stats.signal;
tmp_noise = (&ieee->current_network)->stats.noise;
-   //printk("level:%d, qual:%d, noise:%d\n", tmp_level, tmp_qual, 
tmp_noise);
 
wstats->qual.level = tmp_level;
wstats->qual.qual = tmp_qual;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/5] Staging: rtl8192u: r8192U_wx.c Fixed a misplaced brace

2014-05-28 Thread Chaitanya Hazarey
Fixed a misplaced brace in the r8192_wx_set_scan_type function.

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 1af7c5d..675a12d 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -616,7 +616,8 @@ static int r8192_wx_set_enc(struct net_device *dev,
 
 
 static int r8192_wx_set_scan_type(struct net_device *dev, struct 
iw_request_info *aa,
-   union iwreq_data *wrqu, char *p){
+   union iwreq_data *wrqu, char *p)
+{
 
struct r8192_priv *priv = ieee80211_priv(dev);
int *parms = (int *)p;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/5] Staging: rtl8192u: r8192U_wx.c Removed C99 comments

2014-05-28 Thread Chaitanya Hazarey
To address the error -

ERROR: do not use C99 // comments

Removed all C99 comments.

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 130 +--
 1 file changed, 65 insertions(+), 65 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 7dc2a96..b533784 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -180,8 +180,8 @@ static int r8192_wx_set_crcmon(struct net_device *dev,
  priv->crcmon ? "accepted" : "rejected");
 
if (prev != priv->crcmon && priv->up) {
-   //rtl8180_down(dev);
-   //rtl8180_up(dev);
+   /* rtl8180_down(dev); */
+   /* rtl8180_up(dev); */
}
 
up(&priv->wx_sem);
@@ -249,15 +249,15 @@ static int rtl8180_wx_get_range(struct net_device *dev,
/* ~5 Mb/s real (802.11b) */
range->throughput = 5 * 1000 * 1000;
 
-   // TODO: Not used in 802.11b?
-// range->min_nwid;/* Minimal NWID we are able to set */
-   // TODO: Not used in 802.11b?
-// range->max_nwid;/* Maximal NWID we are able to set */
+   /* TODO: Not used in 802.11b? */
+   /* range->min_nwid; */  /* Minimal NWID we are able to set */
+   /* TODO: Not used in 802.11b? */
+   /* range->max_nwid; */  /* Maximal NWID we are able to set */
 
/* Old Frequency (backward compat - moved lower ) */
-// range->old_num_channels;
-// range->old_num_frequency;
-// range->old_freq[6]; /* Filler to keep "version" at the same offset */
+   /* range->old_num_channels; */
+   /* range->old_num_frequency; */
+   /* range->old_freq[6]; */ /* Filler to keep "version" at the same 
offset */
if (priv->rf_set_sens != NULL)
range->sensitivity = priv->max_sens;/* signal level 
threshold range */
 
@@ -292,26 +292,26 @@ static int rtl8180_wx_get_range(struct net_device *dev,
range->we_version_compiled = WIRELESS_EXT;
range->we_version_source = 16;
 
-// range->retry_capa;  /* What retry options are supported */
-// range->retry_flags; /* How to decode max/min retry limit */
-// range->r_time_flags;/* How to decode max/min retry life */
-// range->min_retry;   /* Minimal number of retries */
-// range->max_retry;   /* Maximal number of retries */
-// range->min_r_time;  /* Minimal retry lifetime */
-// range->max_r_time;  /* Maximal retry lifetime */
+   /* range->retry_capa; *//* What retry options are supported */
+   /* range->retry_flags; */   /* How to decode max/min retry limit */
+   /* range->r_time_flags; */  /* How to decode max/min retry life */
+   /* range->min_retry; */ /* Minimal number of retries */
+   /* range->max_retry; */ /* Maximal number of retries */
+   /* range->min_r_time; *//* Minimal retry lifetime */
+   /* range->max_r_time; *//* Maximal retry lifetime */
 
 
for (i = 0, val = 0; i < 14; i++) {
 
-   // Include only legal frequencies for some countries
+   /* Include only legal frequencies for some countries */
if ((GET_DOT11D_INFO(priv->ieee80211)->channel_map)[i+1]) {
range->freq[val].i = i + 1;
range->freq[val].m = ieee80211_wlan_frequencies[i] * 
10;
range->freq[val].e = 1;
val++;
} else {
-   // FIXME: do we need to set anything for channels
-   // we don't use ?
+   /* FIXME: do we need to set anything for channels */
+   /* we don't use ? */
}
 
if (val == IW_MAX_FREQUENCIES)
@@ -478,7 +478,7 @@ static int r8192_wx_set_wap(struct net_device *dev,
 
int ret;
struct r8192_priv *priv = ieee80211_priv(dev);
-//struct sockaddr *temp = (struct sockaddr *)awrq;
+   /* struct sockaddr *temp = (struct sockaddr *)awrq; */
down(&priv->wx_sem);
 
ret = ieee80211_wx_set_wap(priv->ieee80211, info, awrq, extra);
@@ -517,11 +517,11 @@ static int r8192_wx_set_enc(struct net_device *dev,
struct ieee80211_device *ieee = priv->ieee80211;
int ret;
 
-   //u32 TargetContent;
+   /* u32 TargetContent; */
u32 hwkey[4] = {0, 0, 0, 0};
u8 mask = 0xff;
u32 key_idx = 0;
-   //u8 broadcast_addr[6] ={   0xff,0xff,0xff,0xff,0xff,0xff};
+   /* u8 broadcast_addr[6] ={  0xff,0xff,0xff,0xff,0xff,0xff}; */
u8 zero_addr[4][6] = {  {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  

[PATCH 4/5] Staging: rtl8192u: r8192U_wx.c Added a space for code-style issue

2014-05-28 Thread Chaitanya Hazarey
Added a space around '|' to address:

ERROR: need consistent spacing around '|' (ctx:VxW)

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index b533784..09b1e81 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -987,7 +987,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct 
net_device *dev)
wstats->qual.level = tmp_level;
wstats->qual.qual = tmp_qual;
wstats->qual.noise = tmp_noise;
-   wstats->qual.updated = IW_QUAL_ALL_UPDATED| IW_QUAL_DBM;
+   wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
return wstats;
 }
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 5/5] Staging: rtl8192u: r8192U_wx.c Removed commented out dead code

2014-05-28 Thread Chaitanya Hazarey
Removed dead code from the file.

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 15 ---
 1 file changed, 15 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 09b1e81..f2c970e 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -517,11 +517,9 @@ static int r8192_wx_set_enc(struct net_device *dev,
struct ieee80211_device *ieee = priv->ieee80211;
int ret;
 
-   /* u32 TargetContent; */
u32 hwkey[4] = {0, 0, 0, 0};
u8 mask = 0xff;
u32 key_idx = 0;
-   /* u8 broadcast_addr[6] ={  0xff,0xff,0xff,0xff,0xff,0xff}; */
u8 zero_addr[4][6] = {  {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
@@ -667,14 +665,6 @@ static int r8192_wx_set_retry(struct net_device *dev,
 */
 
rtl8192_commit(dev);
-   /*
-   if(priv->up){
-   rtl8180_rtx_disable(dev);
-   rtl8180_rx_enable(dev);
-   rtl8180_tx_enable(dev);
-
-   }
-   */
 exit:
up(&priv->wx_sem);
 
@@ -953,14 +943,9 @@ static const struct iw_priv_args r8192_private_args[] = {
 
 
 static iw_handler r8192_private_handler[] = {
-   /* r8192_wx_set_monitor, */ /* SIOCIWFIRSTPRIV */
r8192_wx_set_crcmon,   /*SIOCIWSECONDPRIV*/
-   /* r8192_wx_set_forceassociate, */
-   /* r8192_wx_set_beaconinterval, */
-   /* r8192_wx_set_monitor_type, */
r8192_wx_set_scan_type,
r8192_wx_set_rawtx,
-   /* r8192_wx_null, */
r8192_wx_force_reset,
 };
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] Staging: rtl8192u: r8192U_wx.c Various Code cleanups and code-style additions

2014-05-28 Thread Chaitanya Hazarey
ok will send a new one out soon.

Thanks for looking into this and sorry about the repetition.

Chaitanya

On Wed, May 28, 2014 at 4:36 PM, Greg KH  wrote:
> On Wed, May 28, 2014 at 04:23:48PM -0700, Chaitanya Hazarey wrote:
>> Removed dead code
>> Deleted stray newlines
>> Added newlines for better code readability
>
> These should all be broken up into individual patches.
>
> Remember, each patch should just do _one_ thing.
>
> thanks,
>
> greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] Staging: rtl8192u: r8192U_wx.c Fixed misplaced brace

2014-05-28 Thread Chaitanya Hazarey
Please ignore this patch, there seems something wrong with it, will
resend with a new subject.

Thanks,

Chaitanya

On Wed, May 28, 2014 at 4:17 PM, Chaitanya Hazarey  wrote:
> Fixed a misplaced brace in a function
>
> Signed-off-by: Chaitanya Hazarey 
> ---
>  drivers/staging/rtl8192u/r8192U_wx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
> b/drivers/staging/rtl8192u/r8192U_wx.c
> index 1af7c5d..675a12d 100644
> --- a/drivers/staging/rtl8192u/r8192U_wx.c
> +++ b/drivers/staging/rtl8192u/r8192U_wx.c
> @@ -616,7 +616,8 @@ static int r8192_wx_set_enc(struct net_device *dev,
>
>
>  static int r8192_wx_set_scan_type(struct net_device *dev, struct 
> iw_request_info *aa,
> -   union iwreq_data *wrqu, char *p){
> +   union iwreq_data *wrqu, char *p)
> +{
>
> struct r8192_priv *priv = ieee80211_priv(dev);
> int *parms = (int *)p;
> --
> 1.9.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] Staging: rtl8192u: r8192U_wx.c Fixed a misplaced brace

2014-05-28 Thread Chaitanya Hazarey
Fixed a misplaced brace in a function

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 1af7c5d..675a12d 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -616,7 +616,8 @@ static int r8192_wx_set_enc(struct net_device *dev,
 
 
 static int r8192_wx_set_scan_type(struct net_device *dev, struct 
iw_request_info *aa,
-   union iwreq_data *wrqu, char *p){
+   union iwreq_data *wrqu, char *p)
+{
 
struct r8192_priv *priv = ieee80211_priv(dev);
int *parms = (int *)p;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] Staging: rtl8192u: r8192U_wx.c Various Code cleanups and code-style additions

2014-05-28 Thread Chaitanya Hazarey
Removed dead code
Deleted stray newlines
Added newlines for better code readability

Addressed the following errors:

ERROR: do not use C99 // comments
ERROR: need consistent spacing around '|' (ctx:VxW)

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 155 +--
 1 file changed, 76 insertions(+), 79 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 675a12d..ad9bc0b 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -57,6 +57,7 @@ static int r8192_wx_get_rate(struct net_device *dev,
 union iwreq_data *wrqu, char *extra)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
+
return ieee80211_wx_get_rate(priv->ieee80211, info, wrqu, extra);
 }
 
@@ -100,6 +101,7 @@ static int r8192_wx_get_rts(struct net_device *dev,
 union iwreq_data *wrqu, char *extra)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
+
return ieee80211_wx_get_rts(priv->ieee80211, info, wrqu, extra);
 }
 
@@ -124,6 +126,7 @@ static int r8192_wx_get_power(struct net_device *dev,
 union iwreq_data *wrqu, char *extra)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
+
return ieee80211_wx_get_power(priv->ieee80211, info, wrqu, extra);
 }
 
@@ -180,8 +183,8 @@ static int r8192_wx_set_crcmon(struct net_device *dev,
  priv->crcmon ? "accepted" : "rejected");
 
if (prev != priv->crcmon && priv->up) {
-   //rtl8180_down(dev);
-   //rtl8180_up(dev);
+   /*rtl8180_down(dev);
+ rtl8180_up(dev); */
}
 
up(&priv->wx_sem);
@@ -194,6 +197,7 @@ static int r8192_wx_set_mode(struct net_device *dev, struct 
iw_request_info *a,
 {
struct r8192_priv *priv = ieee80211_priv(dev);
int ret;
+
down(&priv->wx_sem);
 
ret = ieee80211_wx_set_mode(priv->ieee80211, a, wrqu, b);
@@ -249,15 +253,15 @@ static int rtl8180_wx_get_range(struct net_device *dev,
/* ~5 Mb/s real (802.11b) */
range->throughput = 5 * 1000 * 1000;
 
-   // TODO: Not used in 802.11b?
-// range->min_nwid;/* Minimal NWID we are able to set */
-   // TODO: Not used in 802.11b?
-// range->max_nwid;/* Maximal NWID we are able to set */
+   /* TODO: Not used in 802.11b? */
+   /*range->min_nwid; */   /* Minimal NWID we are able to set */
+   /* TODO: Not used in 802.11b? */
+   /*range->max_nwid; */   /* Maximal NWID we are able to set */
 
/* Old Frequency (backward compat - moved lower ) */
-// range->old_num_channels;
-// range->old_num_frequency;
-// range->old_freq[6]; /* Filler to keep "version" at the same offset */
+   /*range->old_num_channels; */
+   /*range->old_num_frequency; */
+   /*range->old_freq[6]; */ /* Filler to keep "version" at the same offset 
*/
if (priv->rf_set_sens != NULL)
range->sensitivity = priv->max_sens;/* signal level 
threshold range */
 
@@ -292,26 +296,26 @@ static int rtl8180_wx_get_range(struct net_device *dev,
range->we_version_compiled = WIRELESS_EXT;
range->we_version_source = 16;
 
-// range->retry_capa;  /* What retry options are supported */
-// range->retry_flags; /* How to decode max/min retry limit */
-// range->r_time_flags;/* How to decode max/min retry life */
-// range->min_retry;   /* Minimal number of retries */
-// range->max_retry;   /* Maximal number of retries */
-// range->min_r_time;  /* Minimal retry lifetime */
-// range->max_r_time;  /* Maximal retry lifetime */
+   /*range->retry_capa; */ /* What retry options are supported */
+   /*range->retry_flags; *//* How to decode max/min retry limit */
+   /*range->r_time_flags; */   /* How to decode max/min retry life */
+   /*range->min_retry; */  /* Minimal number of retries */
+   /*range->max_retry; */  /* Maximal number of retries */
+   /*range->min_r_time; */ /* Minimal retry lifetime */
+   /*range->max_r_time; */ /* Maximal retry lifetime */
 
 
for (i = 0, val = 0; i < 14; i++) {
 
-   // Include only legal frequencies for some countries
+   /* Include only legal frequencies for some countries */
if ((GET_DOT11D_INFO(priv->ieee80211)->channel_map)[i+1]) {
range->freq[val].i = i + 1;
range->freq[val].m = ieee80211_wlan_frequencies[i] * 
10;
range->freq[val].e = 1;
val++;
} else {
- 

Re: [PATCH 2/2] Staging: rtl8192u: r8192U_wx.c Code cleanup and code-style additions

2014-05-28 Thread Chaitanya Hazarey
Please ignore this patch, there seems something wrong with it, will
resend with a new subject.

Thanks,

Chaitanya

On Wed, May 28, 2014 at 4:17 PM, Chaitanya Hazarey  wrote:
> Removed dead code
> Deleted stray newlines
> Added newlines for better code readability
>
> Addressed the following errors:
>
> ERROR: do not use C99 // comments
> ERROR: need consistent spacing around '|' (ctx:VxW)
>
> Signed-off-by: Chaitanya Hazarey 
> ---
>  drivers/staging/rtl8192u/r8192U_wx.c | 155 
> +--
>  1 file changed, 76 insertions(+), 79 deletions(-)
>
> diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
> b/drivers/staging/rtl8192u/r8192U_wx.c
> index 675a12d..ad9bc0b 100644
> --- a/drivers/staging/rtl8192u/r8192U_wx.c
> +++ b/drivers/staging/rtl8192u/r8192U_wx.c
> @@ -57,6 +57,7 @@ static int r8192_wx_get_rate(struct net_device *dev,
>  union iwreq_data *wrqu, char *extra)
>  {
> struct r8192_priv *priv = ieee80211_priv(dev);
> +
> return ieee80211_wx_get_rate(priv->ieee80211, info, wrqu, extra);
>  }
>
> @@ -100,6 +101,7 @@ static int r8192_wx_get_rts(struct net_device *dev,
>  union iwreq_data *wrqu, char *extra)
>  {
> struct r8192_priv *priv = ieee80211_priv(dev);
> +
> return ieee80211_wx_get_rts(priv->ieee80211, info, wrqu, extra);
>  }
>
> @@ -124,6 +126,7 @@ static int r8192_wx_get_power(struct net_device *dev,
>  union iwreq_data *wrqu, char *extra)
>  {
> struct r8192_priv *priv = ieee80211_priv(dev);
> +
> return ieee80211_wx_get_power(priv->ieee80211, info, wrqu, extra);
>  }
>
> @@ -180,8 +183,8 @@ static int r8192_wx_set_crcmon(struct net_device *dev,
>   priv->crcmon ? "accepted" : "rejected");
>
> if (prev != priv->crcmon && priv->up) {
> -   //rtl8180_down(dev);
> -   //rtl8180_up(dev);
> +   /*rtl8180_down(dev);
> + rtl8180_up(dev); */
> }
>
> up(&priv->wx_sem);
> @@ -194,6 +197,7 @@ static int r8192_wx_set_mode(struct net_device *dev, 
> struct iw_request_info *a,
>  {
> struct r8192_priv *priv = ieee80211_priv(dev);
> int ret;
> +
> down(&priv->wx_sem);
>
> ret = ieee80211_wx_set_mode(priv->ieee80211, a, wrqu, b);
> @@ -249,15 +253,15 @@ static int rtl8180_wx_get_range(struct net_device *dev,
> /* ~5 Mb/s real (802.11b) */
> range->throughput = 5 * 1000 * 1000;
>
> -   // TODO: Not used in 802.11b?
> -// range->min_nwid;/* Minimal NWID we are able to set */
> -   // TODO: Not used in 802.11b?
> -// range->max_nwid;/* Maximal NWID we are able to set */
> +   /* TODO: Not used in 802.11b? */
> +   /*range->min_nwid; */   /* Minimal NWID we are able to set */
> +   /* TODO: Not used in 802.11b? */
> +   /*range->max_nwid; */   /* Maximal NWID we are able to set */
>
> /* Old Frequency (backward compat - moved lower ) */
> -// range->old_num_channels;
> -// range->old_num_frequency;
> -// range->old_freq[6]; /* Filler to keep "version" at the same offset */
> +   /*range->old_num_channels; */
> +   /*range->old_num_frequency; */
> +   /*range->old_freq[6]; */ /* Filler to keep "version" at the same 
> offset */
> if (priv->rf_set_sens != NULL)
> range->sensitivity = priv->max_sens;/* signal level 
> threshold range */
>
> @@ -292,26 +296,26 @@ static int rtl8180_wx_get_range(struct net_device *dev,
> range->we_version_compiled = WIRELESS_EXT;
> range->we_version_source = 16;
>
> -// range->retry_capa;  /* What retry options are supported */
> -// range->retry_flags; /* How to decode max/min retry limit */
> -// range->r_time_flags;/* How to decode max/min retry life */
> -// range->min_retry;   /* Minimal number of retries */
> -// range->max_retry;   /* Maximal number of retries */
> -// range->min_r_time;  /* Minimal retry lifetime */
> -// range->max_r_time;  /* Maximal retry lifetime */
> +   /*range->retry_capa; */ /* What retry options are supported */
> +   /*range->retry_flags; *//* How to decode max/min retry limit 
> */
> +   /*range->r_time_flags; */   /* How to decode max/min retry life */
> +   /*range->min_retry; */  /* Minimal number of retries */
> +   /*range->max_r

[PATCH 2/2] Staging: rtl8192u: r8192U_wx.c Code cleanup and code-style additions

2014-05-28 Thread Chaitanya Hazarey
Removed dead code
Deleted stray newlines
Added newlines for better code readability

Addressed the following errors:

ERROR: do not use C99 // comments
ERROR: need consistent spacing around '|' (ctx:VxW)

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 155 +--
 1 file changed, 76 insertions(+), 79 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 675a12d..ad9bc0b 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -57,6 +57,7 @@ static int r8192_wx_get_rate(struct net_device *dev,
 union iwreq_data *wrqu, char *extra)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
+
return ieee80211_wx_get_rate(priv->ieee80211, info, wrqu, extra);
 }
 
@@ -100,6 +101,7 @@ static int r8192_wx_get_rts(struct net_device *dev,
 union iwreq_data *wrqu, char *extra)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
+
return ieee80211_wx_get_rts(priv->ieee80211, info, wrqu, extra);
 }
 
@@ -124,6 +126,7 @@ static int r8192_wx_get_power(struct net_device *dev,
 union iwreq_data *wrqu, char *extra)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
+
return ieee80211_wx_get_power(priv->ieee80211, info, wrqu, extra);
 }
 
@@ -180,8 +183,8 @@ static int r8192_wx_set_crcmon(struct net_device *dev,
  priv->crcmon ? "accepted" : "rejected");
 
if (prev != priv->crcmon && priv->up) {
-   //rtl8180_down(dev);
-   //rtl8180_up(dev);
+   /*rtl8180_down(dev);
+ rtl8180_up(dev); */
}
 
up(&priv->wx_sem);
@@ -194,6 +197,7 @@ static int r8192_wx_set_mode(struct net_device *dev, struct 
iw_request_info *a,
 {
struct r8192_priv *priv = ieee80211_priv(dev);
int ret;
+
down(&priv->wx_sem);
 
ret = ieee80211_wx_set_mode(priv->ieee80211, a, wrqu, b);
@@ -249,15 +253,15 @@ static int rtl8180_wx_get_range(struct net_device *dev,
/* ~5 Mb/s real (802.11b) */
range->throughput = 5 * 1000 * 1000;
 
-   // TODO: Not used in 802.11b?
-// range->min_nwid;/* Minimal NWID we are able to set */
-   // TODO: Not used in 802.11b?
-// range->max_nwid;/* Maximal NWID we are able to set */
+   /* TODO: Not used in 802.11b? */
+   /*range->min_nwid; */   /* Minimal NWID we are able to set */
+   /* TODO: Not used in 802.11b? */
+   /*range->max_nwid; */   /* Maximal NWID we are able to set */
 
/* Old Frequency (backward compat - moved lower ) */
-// range->old_num_channels;
-// range->old_num_frequency;
-// range->old_freq[6]; /* Filler to keep "version" at the same offset */
+   /*range->old_num_channels; */
+   /*range->old_num_frequency; */
+   /*range->old_freq[6]; */ /* Filler to keep "version" at the same offset 
*/
if (priv->rf_set_sens != NULL)
range->sensitivity = priv->max_sens;/* signal level 
threshold range */
 
@@ -292,26 +296,26 @@ static int rtl8180_wx_get_range(struct net_device *dev,
range->we_version_compiled = WIRELESS_EXT;
range->we_version_source = 16;
 
-// range->retry_capa;  /* What retry options are supported */
-// range->retry_flags; /* How to decode max/min retry limit */
-// range->r_time_flags;/* How to decode max/min retry life */
-// range->min_retry;   /* Minimal number of retries */
-// range->max_retry;   /* Maximal number of retries */
-// range->min_r_time;  /* Minimal retry lifetime */
-// range->max_r_time;  /* Maximal retry lifetime */
+   /*range->retry_capa; */ /* What retry options are supported */
+   /*range->retry_flags; *//* How to decode max/min retry limit */
+   /*range->r_time_flags; */   /* How to decode max/min retry life */
+   /*range->min_retry; */  /* Minimal number of retries */
+   /*range->max_retry; */  /* Maximal number of retries */
+   /*range->min_r_time; */ /* Minimal retry lifetime */
+   /*range->max_r_time; */ /* Maximal retry lifetime */
 
 
for (i = 0, val = 0; i < 14; i++) {
 
-   // Include only legal frequencies for some countries
+   /* Include only legal frequencies for some countries */
if ((GET_DOT11D_INFO(priv->ieee80211)->channel_map)[i+1]) {
range->freq[val].i = i + 1;
range->freq[val].m = ieee80211_wlan_frequencies[i] * 
10;
range->freq[val].e = 1;
val++;
} else {
- 

[PATCH 1/2] Staging: rtl8192u: r8192U_wx.c Fixed misplaced brace

2014-05-28 Thread Chaitanya Hazarey
Fixed a misplaced brace in a function

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 1af7c5d..675a12d 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -616,7 +616,8 @@ static int r8192_wx_set_enc(struct net_device *dev,
 
 
 static int r8192_wx_set_scan_type(struct net_device *dev, struct 
iw_request_info *aa,
-   union iwreq_data *wrqu, char *p){
+   union iwreq_data *wrqu, char *p)
+{
 
struct r8192_priv *priv = ieee80211_priv(dev);
int *parms = (int *)p;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] Staging: rtl8192u: r8192U_wx.c Added {} braces and newlines

2014-05-28 Thread Chaitanya Hazarey
Added {} braces and newlines to address the following:

ERROR: else should follow close brace '}'
ERROR: space required before the open brace '{'
ERROR: trailing statements should be on next line
ERROR: space required before the open parenthesis '('
ERROR: that open brace { should be on the previous line

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 84 
 1 file changed, 46 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 1ba03ad..1af7c5d 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -315,7 +315,7 @@ static int rtl8180_wx_get_range(struct net_device *dev,
}
 
if (val == IW_MAX_FREQUENCIES)
-   break;
+   break;
}
range->num_frequency = val;
range->num_channels = val;
@@ -333,15 +333,14 @@ static int r8192_wx_set_scan(struct net_device *dev, 
struct iw_request_info *a,
struct ieee80211_device *ieee = priv->ieee80211;
int ret = 0;
 
-   if (!priv->up) return -ENETDOWN;
+   if (!priv->up)
+   return -ENETDOWN;
 
if (priv->ieee80211->LinkDetectInfo.bBusyTraffic == true)
return -EAGAIN;
-   if (wrqu->data.flags & IW_SCAN_THIS_ESSID)
-   {
+   if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
struct iw_scan_req *req = (struct iw_scan_req *)b;
-   if (req->essid_len)
-   {
+   if (req->essid_len) {
//printk("==**&*&*&**===>scan set ssid:%s\n", 
req->essid);
ieee->current_network.ssid_len = req->essid_len;
memcpy(ieee->current_network.ssid, req->essid, 
req->essid_len);
@@ -354,9 +353,9 @@ static int r8192_wx_set_scan(struct net_device *dev, struct 
iw_request_info *a,
priv->ieee80211->scanning = 0;
ieee80211_softmac_scan_syncro(priv->ieee80211);
ret = 0;
+   } else {
+   ret = ieee80211_wx_set_scan(priv->ieee80211, a, wrqu, b);
}
-   else
-   ret = ieee80211_wx_set_scan(priv->ieee80211, a, wrqu, b);
up(&priv->wx_sem);
return ret;
 }
@@ -369,7 +368,8 @@ static int r8192_wx_get_scan(struct net_device *dev, struct 
iw_request_info *a,
int ret;
struct r8192_priv *priv = ieee80211_priv(dev);
 
-   if (!priv->up) return -ENETDOWN;
+   if (!priv->up)
+   return -ENETDOWN;
 
down(&priv->wx_sem);
 
@@ -530,7 +530,8 @@ static int r8192_wx_set_enc(struct net_device *dev,
{0x00, 0x00, 0x00, 0x00, 0x00, 0x03} };
int i;
 
-   if (!priv->up) return -ENETDOWN;
+   if (!priv->up)
+   return -ENETDOWN;
 
down(&priv->wx_sem);
 
@@ -546,8 +547,10 @@ static int r8192_wx_set_enc(struct net_device *dev,
 
for (i = 0; i < 4; i++) {
hwkey[i] |=  key[4*i+0]&mask;
-   if (i == 1 && (4*i+1) == wrqu->encoding.length) mask = 
0x00;
-   if (i == 3 && (4*i+1) == wrqu->encoding.length) mask = 
0x00;
+   if (i == 1 && (4*i+1) == wrqu->encoding.length)
+   mask = 0x00;
+   if (i == 3 && (4*i+1) == wrqu->encoding.length)
+   mask = 0x00;
hwkey[i] |= (key[4*i+1]&mask)<<8;
hwkey[i] |= (key[4*i+2]&mask)<<16;
hwkey[i] |= (key[4*i+3]&mask)<<24;
@@ -557,12 +560,23 @@ static int r8192_wx_set_enc(struct net_device *dev,
#define CONF_WEP104 0x14
 
switch (wrqu->encoding.flags & IW_ENCODE_INDEX) {
-   case 0: key_idx = ieee->tx_keyidx; break;
-   case 1: key_idx = 0; break;
-   case 2: key_idx = 1; break;
-   case 3: key_idx = 2; break;
-   case 4: key_idx = 3; break;
-   default: break;
+   case 0:
+   key_idx = ieee->tx_keyidx;
+   break;
+   case 1:
+   key_idx = 0;
+   break;
+   case 2:
+   key_idx = 1;
+   break;
+   case 3:
+   key_idx = 2;
+   break;
+   case 4:
+   key_idx = 3;
+   break;
+   default:
+   break;
}
 
if (wrqu->encoding.length == 0x5) {
@@ -591,

[PATCH 1/2] Staging: rtl8192u: r8192U_wx.c Added missing spaces

2014-05-28 Thread Chaitanya Hazarey
Added spaces needed in the proper places to address:

WARNING: please, no spaces at the start of a line
WARNING: missing space after struct definition
ERROR: spaces required around that '!=' (ctx:WxV)
ERROR: spaces required around that '=' (ctx:WxV)
ERROR: spaces required around that '=' (ctx:VxW)
ERROR: spaces required around that '&&' (ctx:VxV)
ERROR: spaces required around that '!=' (ctx:VxV)
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: space required before the open parenthesis '('
ERROR: space required before the open brace '{'
ERROR: space required after that ',' (ctx:VxV)
ERROR: space required after that close brace '}'
ERROR: space prohibited before that '--' (ctx:WxO)
ERROR: space prohibited before that close parenthesis ')'
ERROR: space prohibited after that open parenthesis '('

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c | 146 +--
 1 file changed, 73 insertions(+), 73 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index dab716f..1ba03ad 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -24,8 +24,8 @@
 #include "dot11d.h"
 
 #define RATE_COUNT 12
-u32 rtl8180_rates[] = {100,200,550,1100,
-   600,900,1200,1800,2400,3600,4800,5400};
+u32 rtl8180_rates[] = {100, 200, 550, 1100,
+   600, 900, 1200, 1800, 2400, 3600, 4800, 
5400};
 
 
 #ifndef ENETDOWN
@@ -38,16 +38,16 @@ static int r8192_wx_get_freq(struct net_device *dev,
 {
struct r8192_priv *priv = ieee80211_priv(dev);
 
-   return ieee80211_wx_get_freq(priv->ieee80211,a,wrqu,b);
+   return ieee80211_wx_get_freq(priv->ieee80211, a, wrqu, b);
 }
 
 
 static int r8192_wx_get_mode(struct net_device *dev, struct iw_request_info *a,
 union iwreq_data *wrqu, char *b)
 {
-   struct r8192_priv *priv=ieee80211_priv(dev);
+   struct r8192_priv *priv = ieee80211_priv(dev);
 
-   return ieee80211_wx_get_mode(priv->ieee80211,a,wrqu,b);
+   return ieee80211_wx_get_mode(priv->ieee80211, a, wrqu, b);
 }
 
 
@@ -57,7 +57,7 @@ static int r8192_wx_get_rate(struct net_device *dev,
 union iwreq_data *wrqu, char *extra)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
-   return ieee80211_wx_get_rate(priv->ieee80211,info,wrqu,extra);
+   return ieee80211_wx_get_rate(priv->ieee80211, info, wrqu, extra);
 }
 
 
@@ -71,7 +71,7 @@ static int r8192_wx_set_rate(struct net_device *dev,
 
down(&priv->wx_sem);
 
-   ret = ieee80211_wx_set_rate(priv->ieee80211,info,wrqu,extra);
+   ret = ieee80211_wx_set_rate(priv->ieee80211, info, wrqu, extra);
 
up(&priv->wx_sem);
 
@@ -88,7 +88,7 @@ static int r8192_wx_set_rts(struct net_device *dev,
 
down(&priv->wx_sem);
 
-   ret = ieee80211_wx_set_rts(priv->ieee80211,info,wrqu,extra);
+   ret = ieee80211_wx_set_rts(priv->ieee80211, info, wrqu, extra);
 
up(&priv->wx_sem);
 
@@ -100,7 +100,7 @@ static int r8192_wx_get_rts(struct net_device *dev,
 union iwreq_data *wrqu, char *extra)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
-   return ieee80211_wx_get_rts(priv->ieee80211,info,wrqu,extra);
+   return ieee80211_wx_get_rts(priv->ieee80211, info, wrqu, extra);
 }
 
 static int r8192_wx_set_power(struct net_device *dev,
@@ -112,7 +112,7 @@ static int r8192_wx_set_power(struct net_device *dev,
 
down(&priv->wx_sem);
 
-   ret = ieee80211_wx_set_power(priv->ieee80211,info,wrqu,extra);
+   ret = ieee80211_wx_set_power(priv->ieee80211, info, wrqu, extra);
 
up(&priv->wx_sem);
 
@@ -124,7 +124,7 @@ static int r8192_wx_get_power(struct net_device *dev,
 union iwreq_data *wrqu, char *extra)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
-   return ieee80211_wx_get_power(priv->ieee80211,info,wrqu,extra);
+   return ieee80211_wx_get_power(priv->ieee80211, info, wrqu, extra);
 }
 
 static int r8192_wx_force_reset(struct net_device *dev,
@@ -135,7 +135,7 @@ static int r8192_wx_force_reset(struct net_device *dev,
 
down(&priv->wx_sem);
 
-   printk("%s(): force reset ! extra is %d\n",__func__, *extra);
+   printk("%s(): force reset ! extra is %d\n", __func__, *extra);
priv->force_reset = *extra;
up(&priv->wx_sem);
return 0;
@@ -171,15 +171,15 @@ static int r8192_wx_s

[PATCH] Staging: rtl8192u: r8180_93cx6.c Added missing spaces

2014-05-27 Thread Chaitanya Hazarey
Added spaces needed in the proper places to address:

ERROR: space required after that ',' (ctx:VxV)
ERROR: space required after that ';' (ctx:VxV)
ERROR: space required after that close brace '}'
ERROR: space required before the open brace '{'
ERROR: space required before the open parenthesis '('
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '==' (ctx:VxV)

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8180_93cx6.c | 46 +-
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c 
b/drivers/staging/rtl8192u/r8180_93cx6.c
index cd06054..fb8a7a8 100644
--- a/drivers/staging/rtl8192u/r8180_93cx6.c
+++ b/drivers/staging/rtl8192u/r8180_93cx6.c
@@ -53,7 +53,7 @@ static void eprom_ck_cycle(struct net_device *dev)
 }
 
 
-static void eprom_w(struct net_device *dev,short bit)
+static void eprom_w(struct net_device *dev, short bit)
 {
u8 cmdreg;
 
@@ -86,7 +86,7 @@ static void eprom_send_bits_string(struct net_device *dev, 
short b[], int len)
 {
int i;
 
-   for(i=0; iepromtype==EPROM_93c56){
-   addr_str[7]=addr & 1;
-   addr_str[6]=addr & (1<<1);
-   addr_str[5]=addr & (1<<2);
-   addr_str[4]=addr & (1<<3);
-   addr_str[3]=addr & (1<<4);
-   addr_str[2]=addr & (1<<5);
-   addr_str[1]=addr & (1<<6);
-   addr_str[0]=addr & (1<<7);
-   addr_len=8;
-   }else{
-   addr_str[5]=addr & 1;
-   addr_str[4]=addr & (1<<1);
-   addr_str[3]=addr & (1<<2);
-   addr_str[2]=addr & (1<<3);
-   addr_str[1]=addr & (1<<4);
-   addr_str[0]=addr & (1<<5);
-   addr_len=6;
+   if (priv->epromtype == EPROM_93c56) {
+   addr_str[7] = addr & 1;
+   addr_str[6] = addr & (1<<1);
+   addr_str[5] = addr & (1<<2);
+   addr_str[4] = addr & (1<<3);
+   addr_str[3] = addr & (1<<4);
+   addr_str[2] = addr & (1<<5);
+   addr_str[1] = addr & (1<<6);
+   addr_str[0] = addr & (1<<7);
+   addr_len = 8;
+   } else {
+   addr_str[5] = addr & 1;
+   addr_str[4] = addr & (1<<1);
+   addr_str[3] = addr & (1<<2);
+   addr_str[2] = addr & (1<<3);
+   addr_str[1] = addr & (1<<4);
+   addr_str[0] = addr & (1<<5);
+   addr_len = 6;
}
eprom_cs(dev, 1);
eprom_ck_cycle(dev);
@@ -137,7 +137,7 @@ u32 eprom_read(struct net_device *dev, u32 addr)
//I'm unsure if it is necessary, but anyway shouldn't hurt
eprom_w(dev, 0);
 
-   for(i=0;i<16;i++){
+   for (i = 0; i < 16; i++) {
//eeprom needs a clk cycle between writing opcode&adr
//and reading data. (eeprom outs a dummy 0)
eprom_ck_cycle(dev);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/6] Staging: rtl8192u: r8180_93cx6.c & r8192U_wx.c fix checkpatch.pl errors and warnings

2014-05-27 Thread Chaitanya Hazarey
Well, it is what it is, will send the patch the right way.

Best,

Chaitanya

On Tue, May 27, 2014 at 1:39 PM, Dan Carpenter  wrote:
> On Tue, May 27, 2014 at 01:09:45PM -0700, Chaitanya Hazarey wrote:
>> Fixed the following:
>>
>> ERROR: do not use C99 // comments
>> ERROR: space required after that ',' (ctx:VxV)
>> ERROR: space required after that ';' (ctx:VxV)
>> ERROR: space required before the open brace '{'
>> ERROR: spaces required around that '=' (ctx:VxV)
>> ERROR: spaces required around that '<' (ctx:VxV)
>> ERROR: space required after that close brace '}'
>> ERROR: spaces required around that '==' (ctx:VxV)
>> ERROR: space required before the open parenthesis '('
>>
>
> All of these patches have the same subject.  And also they aren't
> broken up in the correct way.  Basically for this kind of thing we want
> to see one kind of cleanup per patch.
>
> [patch 1/6] Staging: rtl8192u: add missing spaces
> [patch 2/6] Staging: rtl8192u: delete commented out code
> [patch 3/6] Staging: rtl8192u: clean up c99 comments
> [patch 4/6] Staging: rtl8192u: reformat long lines
> ...
>
> Etc.
>
> Sorry for asking people to redo these again...
>
> regards,
> dan carpenter
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Staging: rtl8192u: r8180_93cx6.c & r8192U_wx.c fix checkpatch.pl errors and warnings

2014-05-27 Thread Chaitanya Hazarey
Hey DaeSeok,

I fixed all of them except -

this "if" condition like below:
if (5 == wrqu->encoding.length || 13 == wrqu->encoding.length)
  mask = 0x00;
and this should be outside "for" loop

Can you please elaborate on this?

Thanks,

Chaitanya

On Mon, May 26, 2014 at 11:56 PM, DaeSeok Youn  wrote:
> Hi,
>
> 2014-05-27 14:43 GMT+09:00 Chaitanya Hazarey :
>> Fixed the following:
>>
>> ERROR: do not use C99 // comments
>> ERROR: else should follow close brace '}'
>> ERROR: need consistent spacing around '*' (ctx:WxV)
>> ERROR: need consistent spacing around '|' (ctx:VxW)
>> ERROR: space prohibited after that open parenthesis '('
>> ERROR: space prohibited before that '--' (ctx:WxO)
>> ERROR: space prohibited before that close parenthesis ')'
>> ERROR: space required after that ',' (ctx:VxV)
>> ERROR: space required after that ';' (ctx:VxV)
>> ERROR: space required after that close brace '}'
>> ERROR: space required before the open brace '{'
>> ERROR: space required before the open parenthesis '('
>> ERROR: spaces required around that '!=' (ctx:VxV)
>> ERROR: spaces required around that '!=' (ctx:WxV)
>> ERROR: spaces required around that '&&' (ctx:VxV)
>> ERROR: spaces required around that '<' (ctx:VxV)
>> ERROR: spaces required around that '=' (ctx:VxV)
>> ERROR: spaces required around that '=' (ctx:VxW)
>> ERROR: spaces required around that '=' (ctx:WxV)
>> ERROR: spaces required around that '==' (ctx:VxV)
>> ERROR: that open brace { should be on the previous line
>> ERROR: trailing statements should be on next line
>> WARNING: Missing a blank line after declarations
>> WARNING: missing space after struct definition
>> WARNING: please, no spaces at the start of a line
>> WARNING: suspect code indent for conditional statements (16, 16)
>
> Please break this up into smaller patches.
> And need to resend this patch.
>>
>> Signed-off-by: Chaitanya Hazarey 
>> ---
>>  drivers/staging/rtl8192u/r8180_93cx6.c |   58 ++---
>>  drivers/staging/rtl8192u/r8192U_wx.c   |  373 
>> +---
>>  2 files changed, 223 insertions(+), 208 deletions(-)
>>
>> diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c 
>> b/drivers/staging/rtl8192u/r8180_93cx6.c
>> index cd06054..7a0051e 100644
>> --- a/drivers/staging/rtl8192u/r8180_93cx6.c
>> +++ b/drivers/staging/rtl8192u/r8180_93cx6.c
>> @@ -53,7 +53,7 @@ static void eprom_ck_cycle(struct net_device *dev)
>>  }
>>
>>
>> -static void eprom_w(struct net_device *dev,short bit)
>> +static void eprom_w(struct net_device *dev, short bit)
>>  {
>> u8 cmdreg;
>>
>> @@ -86,7 +86,7 @@ static void eprom_send_bits_string(struct net_device *dev, 
>> short b[], int len)
>>  {
>> int i;
>>
>> -   for(i=0; i> +   for (i = 0 ; i < len ; i++) {
> I think it doesn't need to add a space between "i = 0" and ";".
> just like below:
> for (i = 0; i < len; i++) {
>
>> eprom_w(dev, b[i]);
>> eprom_ck_cycle(dev);
>> }
>> @@ -96,50 +96,50 @@ static void eprom_send_bits_string(struct net_device 
>> *dev, short b[], int len)
>>  u32 eprom_read(struct net_device *dev, u32 addr)
>>  {
>> struct r8192_priv *priv = ieee80211_priv(dev);
>> -   short read_cmd[]={1,1,0};
>> +   short read_cmd[] = {1, 1, 0};
>> short addr_str[8];
>> int i;
>> int addr_len;
>> u32 ret;
>>
>> -   ret=0;
>> -   //enable EPROM programming
>> +   ret = 0;
>> +   /* enable EPROM programming */
>> write_nic_byte_E(dev, EPROM_CMD,
>>(EPROM_CMD_PROGRAM<> force_pci_posting(dev);
>> udelay(EPROM_DELAY);
>>
>> -   if (priv->epromtype==EPROM_93c56){
>> -   addr_str[7]=addr & 1;
>> -   addr_str[6]=addr & (1<<1);
>> -   addr_str[5]=addr & (1<<2);
>> -   addr_str[4]=addr & (1<<3);
>> -   addr_str[3]=addr & (1<<4);
>> -   addr_str[2]=addr & (1<<5);
>> -   addr_str[1]=addr & (1<<6);
>> -   addr_str[0]=addr & (1<<7);
>> -   addr_len=8;
>> -   

[PATCH 2/6] Staging: rtl8192u: r8180_93cx6.c & r8192U_wx.c fix checkpatch.pl errors and warnings

2014-05-27 Thread Chaitanya Hazarey
Cleaned up dead code, added curly {} braces where needed
and fixed the following:

ERROR: do not use C99 // comments
ERROR: else should follow close brace '}'
ERROR: space required after that ',' (ctx:VxV)
ERROR: space required before the open brace '{'
ERROR: spaces required around that '=' (ctx:WxV)
ERROR: space required after that close brace '}'
ERROR: spaces required around that '=' (ctx:VxW)
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '!=' (ctx:WxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: spaces required around that '!=' (ctx:VxV)
ERROR: spaces required around that '&&' (ctx:VxV)
ERROR: trailing statements should be on next line
ERROR: space prohibited before that '--' (ctx:WxO)
ERROR: need consistent spacing around '|' (ctx:VxW)
ERROR: need consistent spacing around '*' (ctx:WxV)
ERROR: space required before the open parenthesis '('
ERROR: that open brace { should be on the previous line
ERROR: space prohibited after that open parenthesis '('
ERROR: space prohibited before that close parenthesis ')'

WARNING: missing space after struct definition
WARNING: Missing a blank line after declarations
WARNING: please, no spaces at the start of a line
WARNING: suspect code indent for conditional statements (16, 16)
WARNING: __func__ should be used instead of gcc specific __FUNCTION__

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c |   13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index dab716f..ca0e21c 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -24,8 +24,8 @@
 #include "dot11d.h"
 
 #define RATE_COUNT 12
-u32 rtl8180_rates[] = {100,200,550,1100,
-   600,900,1200,1800,2400,3600,4800,5400};
+u32 rtl8180_rates[] = {100, 200, 550, 1100,
+   600, 900, 1200, 1800, 2400, 3600, 4800, 
5400};
 
 
 #ifndef ENETDOWN
@@ -38,16 +38,16 @@ static int r8192_wx_get_freq(struct net_device *dev,
 {
struct r8192_priv *priv = ieee80211_priv(dev);
 
-   return ieee80211_wx_get_freq(priv->ieee80211,a,wrqu,b);
+   return ieee80211_wx_get_freq(priv->ieee80211, a, wrqu, b);
 }
 
 
 static int r8192_wx_get_mode(struct net_device *dev, struct iw_request_info *a,
 union iwreq_data *wrqu, char *b)
 {
-   struct r8192_priv *priv=ieee80211_priv(dev);
+   struct r8192_priv *priv = ieee80211_priv(dev);
 
-   return ieee80211_wx_get_mode(priv->ieee80211,a,wrqu,b);
+   return ieee80211_wx_get_mode(priv->ieee80211, a, wrqu, b);
 }
 
 
@@ -57,7 +57,8 @@ static int r8192_wx_get_rate(struct net_device *dev,
 union iwreq_data *wrqu, char *extra)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
-   return ieee80211_wx_get_rate(priv->ieee80211,info,wrqu,extra);
+
+   return ieee80211_wx_get_rate(priv->ieee80211, info, wrqu, extra);
 }
 
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/6] Staging: rtl8192u: r8180_93cx6.c & r8192U_wx.c fix checkpatch.pl errors and warnings

2014-05-27 Thread Chaitanya Hazarey
Cleaned up dead code, added curly {} braces where needed
and fixed the following:

ERROR: do not use C99 // comments
ERROR: else should follow close brace '}'
ERROR: space required after that ',' (ctx:VxV)
ERROR: space required before the open brace '{'
ERROR: spaces required around that '=' (ctx:WxV)
ERROR: space required after that close brace '}'
ERROR: spaces required around that '=' (ctx:VxW)
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '!=' (ctx:WxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: spaces required around that '!=' (ctx:VxV)
ERROR: spaces required around that '&&' (ctx:VxV)
ERROR: trailing statements should be on next line
ERROR: space prohibited before that '--' (ctx:WxO)
ERROR: need consistent spacing around '|' (ctx:VxW)
ERROR: need consistent spacing around '*' (ctx:WxV)
ERROR: space required before the open parenthesis '('
ERROR: that open brace { should be on the previous line
ERROR: space prohibited after that open parenthesis '('
ERROR: space prohibited before that close parenthesis ')'

WARNING: missing space after struct definition
WARNING: Missing a blank line after declarations
WARNING: please, no spaces at the start of a line
WARNING: suspect code indent for conditional statements (16, 16)
WARNING: __func__ should be used instead of gcc specific __FUNCTION__

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c |   63 +-
 1 file changed, 31 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 7f8a3e0..6b48c08 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -252,16 +252,16 @@ static int rtl8180_wx_get_range(struct net_device *dev,
/* ~5 Mb/s real (802.11b) */
range->throughput = 5 * 1000 * 1000;
 
-   // TODO: Not used in 802.11b?
-// range->min_nwid;/* Minimal NWID we are able to set */
-   // TODO: Not used in 802.11b?
-// range->max_nwid;/* Maximal NWID we are able to set */
+   /* TODO: Not used in 802.11b? */
+/* range->min_nwid; */ /* Minimal NWID we are able to set */
+   /* TODO: Not used in 802.11b? */
+/* range->max_nwid; */ /* Maximal NWID we are able to set */
 
/* Old Frequency (backward compat - moved lower ) */
-// range->old_num_channels;
-// range->old_num_frequency;
-// range->old_freq[6]; /* Filler to keep "version" at the same offset */
-   if(priv->rf_set_sens != NULL)
+/* range->old_num_channels; */
+/* range->old_num_frequency; */
+/* range->old_freq[6]; */ /* Filler to keep "version" at the same offset */
+   if (priv->rf_set_sens != NULL)
range->sensitivity = priv->max_sens;/* signal level 
threshold range */
 
range->max_qual.qual = 100;
@@ -284,7 +284,7 @@ static int rtl8180_wx_get_range(struct net_device *dev,
range->min_frag = MIN_FRAG_THRESHOLD;
range->max_frag = MAX_FRAG_THRESHOLD;
 
-   range->min_pmp=0;
+   range->min_pmp = 0;
range->max_pmp = 500;
range->min_pmt = 0;
range->max_pmt = 65535*1000;
@@ -295,30 +295,30 @@ static int rtl8180_wx_get_range(struct net_device *dev,
range->we_version_compiled = WIRELESS_EXT;
range->we_version_source = 16;
 
-// range->retry_capa;  /* What retry options are supported */
-// range->retry_flags; /* How to decode max/min retry limit */
-// range->r_time_flags;/* How to decode max/min retry life */
-// range->min_retry;   /* Minimal number of retries */
-// range->max_retry;   /* Maximal number of retries */
-// range->min_r_time;  /* Minimal retry lifetime */
-// range->max_r_time;  /* Maximal retry lifetime */
+/* range->retry_capa; */   /* What retry options are supported */
+/* range->retry_flags; */  /* How to decode max/min retry limit */
+/* range->r_time_flags; */ /* How to decode max/min retry life */
+/* range->min_retry; *//* Minimal number of retries */
+/* range->max_retry; *//* Maximal number of retries */
+/* range->min_r_time; */   /* Minimal retry lifetime */
+/* range->max_r_time; */   /* Maximal retry lifetime */
 
 
for (i = 0, val = 0; i < 14; i++) {
 
-   // Include only legal frequencies for some countries
+   /* Include only legal frequencies for some countries */
if ((GET_DOT11D_INFO(priv->ieee80211)->channel_map)[i+1]) {

[PATCH 3/6] Staging: rtl8192u: r8180_93cx6.c & r8192U_wx.c fix checkpatch.pl errors and warnings

2014-05-27 Thread Chaitanya Hazarey
Cleaned up dead code, added curly {} braces where needed
and fixed the following:

ERROR: do not use C99 // comments
ERROR: else should follow close brace '}'
ERROR: space required after that ',' (ctx:VxV)
ERROR: space required before the open brace '{'
ERROR: spaces required around that '=' (ctx:WxV)
ERROR: space required after that close brace '}'
ERROR: spaces required around that '=' (ctx:VxW)
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '!=' (ctx:WxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: spaces required around that '!=' (ctx:VxV)
ERROR: spaces required around that '&&' (ctx:VxV)
ERROR: trailing statements should be on next line
ERROR: space prohibited before that '--' (ctx:WxO)
ERROR: need consistent spacing around '|' (ctx:VxW)
ERROR: need consistent spacing around '*' (ctx:WxV)
ERROR: space required before the open parenthesis '('
ERROR: that open brace { should be on the previous line
ERROR: space prohibited after that open parenthesis '('
ERROR: space prohibited before that close parenthesis ')'

WARNING: missing space after struct definition
WARNING: Missing a blank line after declarations
WARNING: please, no spaces at the start of a line
WARNING: suspect code indent for conditional statements (16, 16)
WARNING: __func__ should be used instead of gcc specific __FUNCTION__

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c |   28 +++-
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index ca0e21c..7f8a3e0 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -72,7 +72,7 @@ static int r8192_wx_set_rate(struct net_device *dev,
 
down(&priv->wx_sem);
 
-   ret = ieee80211_wx_set_rate(priv->ieee80211,info,wrqu,extra);
+   ret = ieee80211_wx_set_rate(priv->ieee80211, info, wrqu, extra);
 
up(&priv->wx_sem);
 
@@ -89,7 +89,7 @@ static int r8192_wx_set_rts(struct net_device *dev,
 
down(&priv->wx_sem);
 
-   ret = ieee80211_wx_set_rts(priv->ieee80211,info,wrqu,extra);
+   ret = ieee80211_wx_set_rts(priv->ieee80211, info, wrqu, extra);
 
up(&priv->wx_sem);
 
@@ -101,7 +101,7 @@ static int r8192_wx_get_rts(struct net_device *dev,
 union iwreq_data *wrqu, char *extra)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
-   return ieee80211_wx_get_rts(priv->ieee80211,info,wrqu,extra);
+   return ieee80211_wx_get_rts(priv->ieee80211, info, wrqu, extra);
 }
 
 static int r8192_wx_set_power(struct net_device *dev,
@@ -113,7 +113,7 @@ static int r8192_wx_set_power(struct net_device *dev,
 
down(&priv->wx_sem);
 
-   ret = ieee80211_wx_set_power(priv->ieee80211,info,wrqu,extra);
+   ret = ieee80211_wx_set_power(priv->ieee80211, info, wrqu, extra);
 
up(&priv->wx_sem);
 
@@ -125,7 +125,8 @@ static int r8192_wx_get_power(struct net_device *dev,
 union iwreq_data *wrqu, char *extra)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
-   return ieee80211_wx_get_power(priv->ieee80211,info,wrqu,extra);
+
+   return ieee80211_wx_get_power(priv->ieee80211, info, wrqu, extra);
 }
 
 static int r8192_wx_force_reset(struct net_device *dev,
@@ -136,7 +137,7 @@ static int r8192_wx_force_reset(struct net_device *dev,
 
down(&priv->wx_sem);
 
-   printk("%s(): force reset ! extra is %d\n",__func__, *extra);
+   printk("%s(): force reset ! extra is %d\n", __func__, *extra);
priv->force_reset = *extra;
up(&priv->wx_sem);
return 0;
@@ -172,17 +173,17 @@ static int r8192_wx_set_crcmon(struct net_device *dev,
 
down(&priv->wx_sem);
 
-   if(enable)
-   priv->crcmon=1;
+   if (enable)
+   priv->crcmon = 1;
else
-   priv->crcmon=0;
+   priv->crcmon = 0;
 
DMESG("bad CRC in monitor mode are %s",
  priv->crcmon ? "accepted" : "rejected");
 
-   if(prev != priv->crcmon && priv->up){
-   //rtl8180_down(dev);
-   //rtl8180_up(dev);
+   if (prev != priv->crcmon && priv->up) {
+   /*rtl8180_down(dev);*/
+   /*rtl8180_up(dev);*/
}
 
up(&priv->wx_sem);
@@ -195,9 +196,10 @@ static int r8192_wx_set_mode(struct net_device *dev, 
struct iw_request_info *a,
 {
struct r8192_priv *priv = ieee80211_priv(dev);

[PATCH 5/6] Staging: rtl8192u: r8180_93cx6.c & r8192U_wx.c fix checkpatch.pl errors and warnings

2014-05-27 Thread Chaitanya Hazarey
Cleaned up dead code, added curly {} braces where needed
and fixed the following:

ERROR: do not use C99 // comments
ERROR: else should follow close brace '}'
ERROR: space required after that ',' (ctx:VxV)
ERROR: space required before the open brace '{'
ERROR: spaces required around that '=' (ctx:WxV)
ERROR: space required after that close brace '}'
ERROR: spaces required around that '=' (ctx:VxW)
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '!=' (ctx:WxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: spaces required around that '!=' (ctx:VxV)
ERROR: spaces required around that '&&' (ctx:VxV)
ERROR: trailing statements should be on next line
ERROR: space prohibited before that '--' (ctx:WxO)
ERROR: need consistent spacing around '|' (ctx:VxW)
ERROR: need consistent spacing around '*' (ctx:WxV)
ERROR: space required before the open parenthesis '('
ERROR: that open brace { should be on the previous line
ERROR: space prohibited after that open parenthesis '('
ERROR: space prohibited before that close parenthesis ')'

WARNING: missing space after struct definition
WARNING: Missing a blank line after declarations
WARNING: please, no spaces at the start of a line
WARNING: suspect code indent for conditional statements (16, 16)
WARNING: __func__ should be used instead of gcc specific __FUNCTION__

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c |  144 ++
 1 file changed, 76 insertions(+), 68 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 6b48c08..7480c0e 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -388,9 +388,10 @@ static int r8192_wx_set_essid(struct net_device *dev,
 {
struct r8192_priv *priv = ieee80211_priv(dev);
int ret;
+
down(&priv->wx_sem);
 
-   ret = ieee80211_wx_set_essid(priv->ieee80211,a,wrqu,b);
+   ret = ieee80211_wx_set_essid(priv->ieee80211, a, wrqu, b);
 
up(&priv->wx_sem);
 
@@ -482,10 +483,11 @@ static int r8192_wx_set_wap(struct net_device *dev,
 
int ret;
struct r8192_priv *priv = ieee80211_priv(dev);
-//struct sockaddr *temp = (struct sockaddr *)awrq;
+/*  struct sockaddr *temp = (struct sockaddr *)awrq; */
+
down(&priv->wx_sem);
 
-   ret = ieee80211_wx_set_wap(priv->ieee80211,info,awrq,extra);
+   ret = ieee80211_wx_set_wap(priv->ieee80211, info, awrq, extra);
 
up(&priv->wx_sem);
 
@@ -500,7 +502,7 @@ static int r8192_wx_get_wap(struct net_device *dev,
 {
struct r8192_priv *priv = ieee80211_priv(dev);
 
-   return ieee80211_wx_get_wap(priv->ieee80211,info,wrqu,extra);
+   return ieee80211_wx_get_wap(priv->ieee80211, info, wrqu, extra);
 }
 
 
@@ -520,36 +522,34 @@ static int r8192_wx_set_enc(struct net_device *dev,
struct r8192_priv *priv = ieee80211_priv(dev);
struct ieee80211_device *ieee = priv->ieee80211;
int ret;
-
-   //u32 TargetContent;
-   u32 hwkey[4]={0,0,0,0};
-   u8 mask=0xff;
-   u32 key_idx=0;
-   //u8 broadcast_addr[6] ={   0xff,0xff,0xff,0xff,0xff,0xff};
-   u8 zero_addr[4][6] ={   {0x00,0x00,0x00,0x00,0x00,0x00},
-   {0x00,0x00,0x00,0x00,0x00,0x01},
-   {0x00,0x00,0x00,0x00,0x00,0x02},
-   {0x00,0x00,0x00,0x00,0x00,0x03} };
+   u32 hwkey[4] = {0, 0, 0, 0};
+   u8 mask = 0xff;
+   u32 key_idx = 0;
+   u8 zero_addr[4][6] = {  {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+   {0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+   {0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
+   {0x00, 0x00, 0x00, 0x00, 0x00, 0x03} };
int i;
 
-   if(!priv->up) return -ENETDOWN;
+   if (!priv->up)
+   return -ENETDOWN;
 
down(&priv->wx_sem);
 
RT_TRACE(COMP_SEC, "Setting SW wep key");
-   ret = ieee80211_wx_set_encode(priv->ieee80211,info,wrqu,key);
+   ret = ieee80211_wx_set_encode(priv->ieee80211, info, wrqu, key);
 
up(&priv->wx_sem);
 
+   /*sometimes, the length is zero while we do not type key value */
+   if (wrqu->encoding.length != 0) {
 
-
-   //sometimes, the length is zero while we do not type key value
-   if(wrqu->encoding.length!=0){
-
-   for(i=0 ; i<4 ; i++){
+   for (i = 0; i < 4 ; i++) {
hwkey[i] |=  key[4*i+0]&mask;
-   if(i==1&&(4*i+1

[PATCH 6/6] Staging: rtl8192u: r8180_93cx6.c & r8192U_wx.c fix checkpatch.pl errors and warnings

2014-05-27 Thread Chaitanya Hazarey
Cleaned up dead code, added curly {} braces where needed
and fixed the following:

ERROR: do not use C99 // comments
ERROR: else should follow close brace '}'
ERROR: space required after that ',' (ctx:VxV)
ERROR: space required before the open brace '{'
ERROR: spaces required around that '=' (ctx:WxV)
ERROR: space required after that close brace '}'
ERROR: spaces required around that '=' (ctx:VxW)
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '!=' (ctx:WxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: spaces required around that '!=' (ctx:VxV)
ERROR: spaces required around that '&&' (ctx:VxV)
ERROR: trailing statements should be on next line
ERROR: space prohibited before that '--' (ctx:WxO)
ERROR: need consistent spacing around '|' (ctx:VxW)
ERROR: need consistent spacing around '*' (ctx:WxV)
ERROR: space required before the open parenthesis '('
ERROR: that open brace { should be on the previous line
ERROR: space prohibited after that open parenthesis '('
ERROR: space prohibited before that close parenthesis ')'

WARNING: missing space after struct definition
WARNING: Missing a blank line after declarations
WARNING: please, no spaces at the start of a line
WARNING: suspect code indent for conditional statements (16, 16)
WARNING: __func__ should be used instead of gcc specific __FUNCTION__

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8192U_wx.c |  131 --
 1 file changed, 61 insertions(+), 70 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index 7480c0e..ad95895 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -740,77 +740,72 @@ exit:
return err;
 }
 
-//hw security need to reorganized.
+/*hw security need to reorganized. */
 static int r8192_wx_set_enc_ext(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
 {
-   int ret=0;
+   int ret = 0;
struct r8192_priv *priv = ieee80211_priv(dev);
struct ieee80211_device *ieee = priv->ieee80211;
-   //printk("===>%s()\n", __func__);
-
 
down(&priv->wx_sem);
ret = ieee80211_wx_set_encode_ext(priv->ieee80211, info, wrqu, extra);
 
{
-   u8 broadcast_addr[6] = {0xff,0xff,0xff,0xff,0xff,0xff};
+   u8 broadcast_addr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
u8 zero[6] = {0};
u32 key[4] = {0};
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
struct iw_point *encoding = &wrqu->encoding;
u8 idx = 0, alg = 0, group = 0;
+
if ((encoding->flags & IW_ENCODE_DISABLED) ||
-   ext->alg == IW_ENCODE_ALG_NONE) //none is not allowed to use 
hwsec WB 2008.07.01
+   ext->alg == IW_ENCODE_ALG_NONE)
+   /*none is not allowed to use hwsec WB 2008.07.01 */
goto end_hw_sec;
 
-   alg =  (ext->alg == IW_ENCODE_ALG_CCMP)?KEY_TYPE_CCMP:ext->alg; 
// as IW_ENCODE_ALG_CCMP is defined to be 3 and KEY_TYPE_CCMP is defined to 4;
+   /* as IW_ENCODE_ALG_CCMP is defined to be 3 and KEY_TYPE_CCMP 
is defined to 4; */
+   alg =  (ext->alg == IW_ENCODE_ALG_CCMP)?KEY_TYPE_CCMP:ext->alg;
idx = encoding->flags & IW_ENCODE_INDEX;
if (idx)
-   idx --;
+   idx--;
group = ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY;
 
-   if ((!group) || (IW_MODE_ADHOC == ieee->iw_mode) || (alg ==  
KEY_TYPE_WEP40))
-   {
-   if ((ext->key_len == 13) && (alg == KEY_TYPE_WEP40) )
+   if ((!group) || (IW_MODE_ADHOC == ieee->iw_mode) || (alg ==  
KEY_TYPE_WEP40)) {
+   if ((ext->key_len == 13) && (alg == KEY_TYPE_WEP40))
alg = KEY_TYPE_WEP104;
ieee->pairwise_key_type = alg;
EnableHWSecurityConfig8192(dev);
}
-   memcpy((u8 *)key, ext->key, 16); //we only get 16 bytes 
key.why? WB 2008.7.1
-
-   if ((alg & KEY_TYPE_WEP40) && (ieee->auth_mode !=2) )
-   {
-
-   setKey( dev,
-   idx,//EntryNo
-   idx, //KeyIndex
-   alg,  //KeyT

[PATCH 1/6] Staging: rtl8192u: r8180_93cx6.c & r8192U_wx.c fix checkpatch.pl errors and warnings

2014-05-27 Thread Chaitanya Hazarey
Fixed the following:

ERROR: do not use C99 // comments
ERROR: space required after that ',' (ctx:VxV)
ERROR: space required after that ';' (ctx:VxV)
ERROR: space required before the open brace '{'
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: space required after that close brace '}'
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: space required before the open parenthesis '('

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8180_93cx6.c |   58 
 1 file changed, 29 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c 
b/drivers/staging/rtl8192u/r8180_93cx6.c
index cd06054..a68068f 100644
--- a/drivers/staging/rtl8192u/r8180_93cx6.c
+++ b/drivers/staging/rtl8192u/r8180_93cx6.c
@@ -53,7 +53,7 @@ static void eprom_ck_cycle(struct net_device *dev)
 }
 
 
-static void eprom_w(struct net_device *dev,short bit)
+static void eprom_w(struct net_device *dev, short bit)
 {
u8 cmdreg;
 
@@ -86,7 +86,7 @@ static void eprom_send_bits_string(struct net_device *dev, 
short b[], int len)
 {
int i;
 
-   for(i=0; iepromtype==EPROM_93c56){
-   addr_str[7]=addr & 1;
-   addr_str[6]=addr & (1<<1);
-   addr_str[5]=addr & (1<<2);
-   addr_str[4]=addr & (1<<3);
-   addr_str[3]=addr & (1<<4);
-   addr_str[2]=addr & (1<<5);
-   addr_str[1]=addr & (1<<6);
-   addr_str[0]=addr & (1<<7);
-   addr_len=8;
-   }else{
-   addr_str[5]=addr & 1;
-   addr_str[4]=addr & (1<<1);
-   addr_str[3]=addr & (1<<2);
-   addr_str[2]=addr & (1<<3);
-   addr_str[1]=addr & (1<<4);
-   addr_str[0]=addr & (1<<5);
-   addr_len=6;
+   if (priv->epromtype == EPROM_93c56) {
+   addr_str[7] = addr & 1;
+   addr_str[6] = addr & (1<<1);
+   addr_str[5] = addr & (1<<2);
+   addr_str[4] = addr & (1<<3);
+   addr_str[3] = addr & (1<<4);
+   addr_str[2] = addr & (1<<5);
+   addr_str[1] = addr & (1<<6);
+   addr_str[0] = addr & (1<<7);
+   addr_len = 8;
+   } else {
+   addr_str[5] = addr & 1;
+   addr_str[4] = addr & (1<<1);
+   addr_str[3] = addr & (1<<2);
+   addr_str[2] = addr & (1<<3);
+   addr_str[1] = addr & (1<<4);
+   addr_str[0] = addr & (1<<5);
+   addr_len = 6;
}
eprom_cs(dev, 1);
eprom_ck_cycle(dev);
eprom_send_bits_string(dev, read_cmd, 3);
eprom_send_bits_string(dev, addr_str, addr_len);
 
-   //keep chip pin D to low state while reading.
-   //I'm unsure if it is necessary, but anyway shouldn't hurt
+   /* keep chip pin D to low state while reading.*/
+   /* I'm unsure if it is necessary, but anyway shouldn't hurt*/
eprom_w(dev, 0);
 
-   for(i=0;i<16;i++){
-   //eeprom needs a clk cycle between writing opcode&adr
-   //and reading data. (eeprom outs a dummy 0)
+   for (i = 0; i < 16; i++) {
+   /* eeprom needs a clk cycle between writing opcode&adr */
+   /* and reading data. (eeprom outs a dummy 0) */
eprom_ck_cycle(dev);
ret |= (eprom_r(dev)<<(15-i));
}
@@ -147,7 +147,7 @@ u32 eprom_read(struct net_device *dev, u32 addr)
eprom_cs(dev, 0);
eprom_ck_cycle(dev);
 
-   //disable EPROM programming
+   /* disable EPROM programming */
write_nic_byte_E(dev, EPROM_CMD,
   (EPROM_CMD_NORMAL<http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Staging: rtl8192u: r8180_93cx6.c & r8192U_wx.c fix checkpatch.pl errors and warnings

2014-05-27 Thread Chaitanya Hazarey
Hey there,

Thanks for looking into this,

Will be sending out the modified version soon.

Thanks,

Chaitanya

On Mon, May 26, 2014 at 11:56 PM, DaeSeok Youn  wrote:
> Hi,
>
> 2014-05-27 14:43 GMT+09:00 Chaitanya Hazarey :
>> Fixed the following:
>>
>> ERROR: do not use C99 // comments
>> ERROR: else should follow close brace '}'
>> ERROR: need consistent spacing around '*' (ctx:WxV)
>> ERROR: need consistent spacing around '|' (ctx:VxW)
>> ERROR: space prohibited after that open parenthesis '('
>> ERROR: space prohibited before that '--' (ctx:WxO)
>> ERROR: space prohibited before that close parenthesis ')'
>> ERROR: space required after that ',' (ctx:VxV)
>> ERROR: space required after that ';' (ctx:VxV)
>> ERROR: space required after that close brace '}'
>> ERROR: space required before the open brace '{'
>> ERROR: space required before the open parenthesis '('
>> ERROR: spaces required around that '!=' (ctx:VxV)
>> ERROR: spaces required around that '!=' (ctx:WxV)
>> ERROR: spaces required around that '&&' (ctx:VxV)
>> ERROR: spaces required around that '<' (ctx:VxV)
>> ERROR: spaces required around that '=' (ctx:VxV)
>> ERROR: spaces required around that '=' (ctx:VxW)
>> ERROR: spaces required around that '=' (ctx:WxV)
>> ERROR: spaces required around that '==' (ctx:VxV)
>> ERROR: that open brace { should be on the previous line
>> ERROR: trailing statements should be on next line
>> WARNING: Missing a blank line after declarations
>> WARNING: missing space after struct definition
>> WARNING: please, no spaces at the start of a line
>> WARNING: suspect code indent for conditional statements (16, 16)
>
> Please break this up into smaller patches.
> And need to resend this patch.
>>
>> Signed-off-by: Chaitanya Hazarey 
>> ---
>>  drivers/staging/rtl8192u/r8180_93cx6.c |   58 ++---
>>  drivers/staging/rtl8192u/r8192U_wx.c   |  373 
>> +---
>>  2 files changed, 223 insertions(+), 208 deletions(-)
>>
>> diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c 
>> b/drivers/staging/rtl8192u/r8180_93cx6.c
>> index cd06054..7a0051e 100644
>> --- a/drivers/staging/rtl8192u/r8180_93cx6.c
>> +++ b/drivers/staging/rtl8192u/r8180_93cx6.c
>> @@ -53,7 +53,7 @@ static void eprom_ck_cycle(struct net_device *dev)
>>  }
>>
>>
>> -static void eprom_w(struct net_device *dev,short bit)
>> +static void eprom_w(struct net_device *dev, short bit)
>>  {
>> u8 cmdreg;
>>
>> @@ -86,7 +86,7 @@ static void eprom_send_bits_string(struct net_device *dev, 
>> short b[], int len)
>>  {
>> int i;
>>
>> -   for(i=0; i> +   for (i = 0 ; i < len ; i++) {
> I think it doesn't need to add a space between "i = 0" and ";".
> just like below:
> for (i = 0; i < len; i++) {
>
>> eprom_w(dev, b[i]);
>> eprom_ck_cycle(dev);
>> }
>> @@ -96,50 +96,50 @@ static void eprom_send_bits_string(struct net_device 
>> *dev, short b[], int len)
>>  u32 eprom_read(struct net_device *dev, u32 addr)
>>  {
>> struct r8192_priv *priv = ieee80211_priv(dev);
>> -   short read_cmd[]={1,1,0};
>> +   short read_cmd[] = {1, 1, 0};
>> short addr_str[8];
>> int i;
>> int addr_len;
>> u32 ret;
>>
>> -   ret=0;
>> -   //enable EPROM programming
>> +   ret = 0;
>> +   /* enable EPROM programming */
>> write_nic_byte_E(dev, EPROM_CMD,
>>(EPROM_CMD_PROGRAM<> force_pci_posting(dev);
>> udelay(EPROM_DELAY);
>>
>> -   if (priv->epromtype==EPROM_93c56){
>> -   addr_str[7]=addr & 1;
>> -   addr_str[6]=addr & (1<<1);
>> -   addr_str[5]=addr & (1<<2);
>> -   addr_str[4]=addr & (1<<3);
>> -   addr_str[3]=addr & (1<<4);
>> -   addr_str[2]=addr & (1<<5);
>> -   addr_str[1]=addr & (1<<6);
>> -   addr_str[0]=addr & (1<<7);
>> -   addr_len=8;
>> -   }else{
>> -   addr_str[5]=addr & 1;
>> -   addr_str[4]=addr & (1<<1);
>> -

[PATCH] Staging: rtl8192u: r8180_93cx6.c & r8192U_wx.c fix checkpatch.pl errors and warnings

2014-05-26 Thread Chaitanya Hazarey
Fixed the following:

ERROR: do not use C99 // comments
ERROR: else should follow close brace '}'
ERROR: need consistent spacing around '*' (ctx:WxV)
ERROR: need consistent spacing around '|' (ctx:VxW)
ERROR: space prohibited after that open parenthesis '('
ERROR: space prohibited before that '--' (ctx:WxO)
ERROR: space prohibited before that close parenthesis ')'
ERROR: space required after that ',' (ctx:VxV)
ERROR: space required after that ';' (ctx:VxV)
ERROR: space required after that close brace '}'
ERROR: space required before the open brace '{'
ERROR: space required before the open parenthesis '('
ERROR: spaces required around that '!=' (ctx:VxV)
ERROR: spaces required around that '!=' (ctx:WxV)
ERROR: spaces required around that '&&' (ctx:VxV)
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: spaces required around that '=' (ctx:VxV)
ERROR: spaces required around that '=' (ctx:VxW)
ERROR: spaces required around that '=' (ctx:WxV)
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: that open brace { should be on the previous line
ERROR: trailing statements should be on next line
WARNING: Missing a blank line after declarations
WARNING: missing space after struct definition
WARNING: please, no spaces at the start of a line
WARNING: suspect code indent for conditional statements (16, 16)

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8180_93cx6.c |   58 ++---
 drivers/staging/rtl8192u/r8192U_wx.c   |  373 +---
 2 files changed, 223 insertions(+), 208 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c 
b/drivers/staging/rtl8192u/r8180_93cx6.c
index cd06054..7a0051e 100644
--- a/drivers/staging/rtl8192u/r8180_93cx6.c
+++ b/drivers/staging/rtl8192u/r8180_93cx6.c
@@ -53,7 +53,7 @@ static void eprom_ck_cycle(struct net_device *dev)
 }
 
 
-static void eprom_w(struct net_device *dev,short bit)
+static void eprom_w(struct net_device *dev, short bit)
 {
u8 cmdreg;
 
@@ -86,7 +86,7 @@ static void eprom_send_bits_string(struct net_device *dev, 
short b[], int len)
 {
int i;
 
-   for(i=0; iepromtype==EPROM_93c56){
-   addr_str[7]=addr & 1;
-   addr_str[6]=addr & (1<<1);
-   addr_str[5]=addr & (1<<2);
-   addr_str[4]=addr & (1<<3);
-   addr_str[3]=addr & (1<<4);
-   addr_str[2]=addr & (1<<5);
-   addr_str[1]=addr & (1<<6);
-   addr_str[0]=addr & (1<<7);
-   addr_len=8;
-   }else{
-   addr_str[5]=addr & 1;
-   addr_str[4]=addr & (1<<1);
-   addr_str[3]=addr & (1<<2);
-   addr_str[2]=addr & (1<<3);
-   addr_str[1]=addr & (1<<4);
-   addr_str[0]=addr & (1<<5);
-   addr_len=6;
+   if (priv->epromtype == EPROM_93c56) {
+   addr_str[7] = addr & 1;
+   addr_str[6] = addr & (1<<1);
+   addr_str[5] = addr & (1<<2);
+   addr_str[4] = addr & (1<<3);
+   addr_str[3] = addr & (1<<4);
+   addr_str[2] = addr & (1<<5);
+   addr_str[1] = addr & (1<<6);
+   addr_str[0] = addr & (1<<7);
+   addr_len = 8;
+   } else {
+   addr_str[5] = addr & 1;
+   addr_str[4] = addr & (1<<1);
+   addr_str[3] = addr & (1<<2);
+   addr_str[2] = addr & (1<<3);
+   addr_str[1] = addr & (1<<4);
+   addr_str[0] = addr & (1<<5);
+   addr_len = 6;
}
eprom_cs(dev, 1);
eprom_ck_cycle(dev);
eprom_send_bits_string(dev, read_cmd, 3);
eprom_send_bits_string(dev, addr_str, addr_len);
 
-   //keep chip pin D to low state while reading.
-   //I'm unsure if it is necessary, but anyway shouldn't hurt
+   /* keep chip pin D to low state while reading.*/
+   /* I'm unsure if it is necessary, but anyway shouldn't hurt*/
eprom_w(dev, 0);
 
-   for(i=0;i<16;i++){
-   //eeprom needs a clk cycle between writing opcode&adr
-   //and reading data. (eeprom outs a dummy 0)
+   for (i = 0 ; i < 16 ; i++) {
+   /* eeprom needs a clk cycle between writing opcode&adr */
+   /* and reading data. (eeprom outs a dummy 0) */
eprom_ck_cycle(dev);
ret |= (eprom_r(dev)<<(15-i));
}
@@ -147,7 +147,7 @@ u32 eprom_read(struct net_device *dev, u32 addr)
  

Re: [PATCH] Staging: rtl8192u: r8180_93cx6.c & r8192U_wx.c fix checkpatch.pl errors and warnings

2014-05-26 Thread Chaitanya Hazarey
Please ignore this.

Chaitanya

On Mon, May 26, 2014 at 10:32 PM, Chaitanya Hazarey  wrote:
> Fixed the following:
>
> WARNING: line over 80 characters
> ERROR: do not use C99 // comments
> ERROR: else should follow close brace '}'
> ERROR: space required after that ',' (ctx:VxV)
> ERROR: space required after that ';' (ctx:VxV)
> WARNING: missing space after struct definition
> ERROR: space required before the open brace '{'
> ERROR: spaces required around that '=' (ctx:VxV)
> WARNING: Missing a blank line after declarations
> ERROR: spaces required around that '=' (ctx:VxW)
> ERROR: spaces required around that '=' (ctx:WxV)
> ERROR: space required after that close brace '}'
> ERROR: spaces required around that '<' (ctx:VxV)
> ERROR: trailing statements should be on next line
> ERROR: spaces required around that '==' (ctx:VxV)
> ERROR: spaces required around that '!=' (ctx:WxV)
> ERROR: spaces required around that '&&' (ctx:VxV)
> WARNING: please, no spaces at the start of a line
> ERROR: spaces required around that '!=' (ctx:VxV)
> ERROR: space prohibited before that '--' (ctx:WxO)
> ERROR: need consistent spacing around '|' (ctx:VxW)
> ERROR: need consistent spacing around '*' (ctx:WxV)
> ERROR: space required before the open parenthesis '('
> WARNING: printk() should include KERN_ facility level
> ERROR: space prohibited after that open parenthesis '('
> ERROR: that open brace { should be on the previous line
> ERROR: space prohibited before that close parenthesis ')'
> WARNING: suspect code indent for conditional statements (16, 16)
> WARNING: __func__ should be used instead of gcc specific __FUNCTION__
>
> Signed-off-by: Chaitanya Hazarey 
> ---
>  drivers/staging/rtl8192u/r8180_93cx6.c |   58 ++---
>  drivers/staging/rtl8192u/r8192U_wx.c   |  373 
> +---
>  2 files changed, 223 insertions(+), 208 deletions(-)
>
> diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c 
> b/drivers/staging/rtl8192u/r8180_93cx6.c
> index cd06054..7a0051e 100644
> --- a/drivers/staging/rtl8192u/r8180_93cx6.c
> +++ b/drivers/staging/rtl8192u/r8180_93cx6.c
> @@ -53,7 +53,7 @@ static void eprom_ck_cycle(struct net_device *dev)
>  }
>
>
> -static void eprom_w(struct net_device *dev,short bit)
> +static void eprom_w(struct net_device *dev, short bit)
>  {
> u8 cmdreg;
>
> @@ -86,7 +86,7 @@ static void eprom_send_bits_string(struct net_device *dev, 
> short b[], int len)
>  {
> int i;
>
> -   for(i=0; i +   for (i = 0 ; i < len ; i++) {
> eprom_w(dev, b[i]);
> eprom_ck_cycle(dev);
> }
> @@ -96,50 +96,50 @@ static void eprom_send_bits_string(struct net_device 
> *dev, short b[], int len)
>  u32 eprom_read(struct net_device *dev, u32 addr)
>  {
> struct r8192_priv *priv = ieee80211_priv(dev);
> -   short read_cmd[]={1,1,0};
> +   short read_cmd[] = {1, 1, 0};
> short addr_str[8];
> int i;
> int addr_len;
> u32 ret;
>
> -   ret=0;
> -   //enable EPROM programming
> +   ret = 0;
> +   /* enable EPROM programming */
> write_nic_byte_E(dev, EPROM_CMD,
>(EPROM_CMD_PROGRAM< force_pci_posting(dev);
> udelay(EPROM_DELAY);
>
> -   if (priv->epromtype==EPROM_93c56){
> -   addr_str[7]=addr & 1;
> -   addr_str[6]=addr & (1<<1);
> -   addr_str[5]=addr & (1<<2);
> -   addr_str[4]=addr & (1<<3);
> -   addr_str[3]=addr & (1<<4);
> -   addr_str[2]=addr & (1<<5);
> -   addr_str[1]=addr & (1<<6);
> -   addr_str[0]=addr & (1<<7);
> -   addr_len=8;
> -   }else{
> -   addr_str[5]=addr & 1;
> -   addr_str[4]=addr & (1<<1);
> -   addr_str[3]=addr & (1<<2);
> -   addr_str[2]=addr & (1<<3);
> -   addr_str[1]=addr & (1<<4);
> -   addr_str[0]=addr & (1<<5);
> -   addr_len=6;
> +   if (priv->epromtype == EPROM_93c56) {
> +   addr_str[7] = addr & 1;
> +   addr_str[6] = addr & (1<<1);
> +   addr_str[5] = addr & (1<<2);
> +   addr_str[4] = addr & (1<<3);
> +   addr_str[3] = addr & (1<<4);
> +   a

[PATCH] Staging: rtl8192u: r8180_93cx6.c & r8192U_wx.c fix checkpatch.pl errors and warnings

2014-05-26 Thread Chaitanya Hazarey
Fixed the following:

WARNING: line over 80 characters
ERROR: do not use C99 // comments
ERROR: else should follow close brace '}'
ERROR: space required after that ',' (ctx:VxV)
ERROR: space required after that ';' (ctx:VxV)
WARNING: missing space after struct definition
ERROR: space required before the open brace '{'
ERROR: spaces required around that '=' (ctx:VxV)
WARNING: Missing a blank line after declarations
ERROR: spaces required around that '=' (ctx:VxW)
ERROR: spaces required around that '=' (ctx:WxV)
ERROR: space required after that close brace '}'
ERROR: spaces required around that '<' (ctx:VxV)
ERROR: trailing statements should be on next line
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: spaces required around that '!=' (ctx:WxV)
ERROR: spaces required around that '&&' (ctx:VxV)
WARNING: please, no spaces at the start of a line
ERROR: spaces required around that '!=' (ctx:VxV)
ERROR: space prohibited before that '--' (ctx:WxO)
ERROR: need consistent spacing around '|' (ctx:VxW)
ERROR: need consistent spacing around '*' (ctx:WxV)
ERROR: space required before the open parenthesis '('
WARNING: printk() should include KERN_ facility level
ERROR: space prohibited after that open parenthesis '('
ERROR: that open brace { should be on the previous line
ERROR: space prohibited before that close parenthesis ')'
WARNING: suspect code indent for conditional statements (16, 16)
WARNING: __func__ should be used instead of gcc specific __FUNCTION__

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r8180_93cx6.c |   58 ++---
 drivers/staging/rtl8192u/r8192U_wx.c   |  373 +---
 2 files changed, 223 insertions(+), 208 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c 
b/drivers/staging/rtl8192u/r8180_93cx6.c
index cd06054..7a0051e 100644
--- a/drivers/staging/rtl8192u/r8180_93cx6.c
+++ b/drivers/staging/rtl8192u/r8180_93cx6.c
@@ -53,7 +53,7 @@ static void eprom_ck_cycle(struct net_device *dev)
 }
 
 
-static void eprom_w(struct net_device *dev,short bit)
+static void eprom_w(struct net_device *dev, short bit)
 {
u8 cmdreg;
 
@@ -86,7 +86,7 @@ static void eprom_send_bits_string(struct net_device *dev, 
short b[], int len)
 {
int i;
 
-   for(i=0; iepromtype==EPROM_93c56){
-   addr_str[7]=addr & 1;
-   addr_str[6]=addr & (1<<1);
-   addr_str[5]=addr & (1<<2);
-   addr_str[4]=addr & (1<<3);
-   addr_str[3]=addr & (1<<4);
-   addr_str[2]=addr & (1<<5);
-   addr_str[1]=addr & (1<<6);
-   addr_str[0]=addr & (1<<7);
-   addr_len=8;
-   }else{
-   addr_str[5]=addr & 1;
-   addr_str[4]=addr & (1<<1);
-   addr_str[3]=addr & (1<<2);
-   addr_str[2]=addr & (1<<3);
-   addr_str[1]=addr & (1<<4);
-   addr_str[0]=addr & (1<<5);
-   addr_len=6;
+   if (priv->epromtype == EPROM_93c56) {
+   addr_str[7] = addr & 1;
+   addr_str[6] = addr & (1<<1);
+   addr_str[5] = addr & (1<<2);
+   addr_str[4] = addr & (1<<3);
+   addr_str[3] = addr & (1<<4);
+   addr_str[2] = addr & (1<<5);
+   addr_str[1] = addr & (1<<6);
+   addr_str[0] = addr & (1<<7);
+   addr_len = 8;
+   } else {
+   addr_str[5] = addr & 1;
+   addr_str[4] = addr & (1<<1);
+   addr_str[3] = addr & (1<<2);
+   addr_str[2] = addr & (1<<3);
+   addr_str[1] = addr & (1<<4);
+   addr_str[0] = addr & (1<<5);
+   addr_len = 6;
}
eprom_cs(dev, 1);
eprom_ck_cycle(dev);
eprom_send_bits_string(dev, read_cmd, 3);
eprom_send_bits_string(dev, addr_str, addr_len);
 
-   //keep chip pin D to low state while reading.
-   //I'm unsure if it is necessary, but anyway shouldn't hurt
+   /* keep chip pin D to low state while reading.*/
+   /* I'm unsure if it is necessary, but anyway shouldn't hurt*/
eprom_w(dev, 0);
 
-   for(i=0;i<16;i++){
-   //eeprom needs a clk cycle between writing opcode&adr
-   //and reading data. (eeprom outs a dummy 0)
+   for (i = 0 ; i < 16 ; i++) {
+   /* eeprom needs a clk cycle between writing opcode&adr */
+   /* and reading data. (eeprom outs a dummy 0) */
   

[PATCH] Staging: Silicom: bpctl_mod.c & bypass.c: Adding blank lines

2014-05-25 Thread Chaitanya Hazarey
Added a blank line after declarations in many places to fix
the following warning issued by checkpatch.pl:

WARNING: Missing a blank line after declarations

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/silicom/bpctl_mod.c|   88 +++-
 drivers/staging/silicom/bypasslib/bypass.c |2 +
 2 files changed, 88 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/silicom/bpctl_mod.c 
b/drivers/staging/silicom/bpctl_mod.c
index e361cde..22bf4bf 100644
--- a/drivers/staging/silicom/bpctl_mod.c
+++ b/drivers/staging/silicom/bpctl_mod.c
@@ -752,6 +752,7 @@ static void write_reg(struct bpctl_dev *pbpctl_dev, 
unsigned char value,
uint32_t ctrl_ext = 0, ctrl = 0;
struct bpctl_dev *pbpctl_dev_c = NULL;
unsigned long flags;
+
if (pbpctl_dev->bp_10g9) {
pbpctl_dev_c = get_status_port_fn(pbpctl_dev);
if (!pbpctl_dev_c)
@@ -927,6 +928,7 @@ static int read_reg(struct bpctl_dev *pbpctl_dev, unsigned 
char addr)
 
 #ifdef BP_SYNC_FLAG
unsigned long flags;
+
spin_lock_irqsave(&pbpctl_dev->bypass_wr_lock, flags);
 #else
atomic_set(&pbpctl_dev->wdt_busy, 1);
@@ -1563,6 +1565,7 @@ int pulse_set_fn(struct bpctl_dev *pbpctl_dev, unsigned 
int counter)
 int zero_set_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
 
@@ -1588,6 +1591,7 @@ int zero_set_fn(struct bpctl_dev *pbpctl_dev)
 int pulse_get2_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
 
@@ -1603,6 +1607,7 @@ int pulse_get2_fn(struct bpctl_dev *pbpctl_dev)
 int pulse_get1_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
 
@@ -1666,6 +1671,7 @@ static struct bpctl_dev *lookup_port(struct bpctl_dev 
*dev)
 {
struct bpctl_dev *p;
int n;
+
for (n = 0, p = bpctl_dev_arr; n < device_num && p->pdev; n++) {
if (p->bus == dev->bus
&& p->slot == dev->slot
@@ -1843,6 +1849,7 @@ static int bypass_off(struct bpctl_dev *pbpctl_dev)
 static int tap_off(struct bpctl_dev *pbpctl_dev)
 {
int ret = BP_NOT_CAP;
+
if ((pbpctl_dev->bp_caps & TAP_CAP)
&& (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER)) {
write_data(pbpctl_dev, TAP_OFF);
@@ -1856,6 +1863,7 @@ static int tap_off(struct bpctl_dev *pbpctl_dev)
 static int tap_on(struct bpctl_dev *pbpctl_dev)
 {
int ret = BP_NOT_CAP;
+
if ((pbpctl_dev->bp_caps & TAP_CAP)
&& (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER)) {
write_data(pbpctl_dev, TAP_ON);
@@ -1869,6 +1877,7 @@ static int tap_on(struct bpctl_dev *pbpctl_dev)
 static int disc_off(struct bpctl_dev *pbpctl_dev)
 {
int ret = 0;
+
if ((pbpctl_dev->bp_caps & DISC_CAP) && (pbpctl_dev->bp_ext_ver >= 
0x8)) {
write_data(pbpctl_dev, DISC_OFF);
msec_delay_bp(LATCH_DELAY);
@@ -1881,6 +1890,7 @@ static int disc_off(struct bpctl_dev *pbpctl_dev)
 static int disc_on(struct bpctl_dev *pbpctl_dev)
 {
int ret = 0;
+
if ((pbpctl_dev->bp_caps & DISC_CAP) && (pbpctl_dev->bp_ext_ver >= 
0x8)) {
write_data(pbpctl_dev, /*DISC_ON */ 0x85);
msec_delay_bp(LATCH_DELAY);
@@ -2270,6 +2280,7 @@ static int set_tx(struct bpctl_dev *pbpctl_dev, int 
tx_state)
 {
int ret = 0, ctrl = 0;
struct bpctl_dev *pbpctl_dev_m;
+
if ((is_bypass_fn(pbpctl_dev)) == 1)
pbpctl_dev_m = pbpctl_dev;
else
@@ -2802,6 +2813,7 @@ int wdt_time_left(struct bpctl_dev *pbpctl_dev)
 static int wdt_timer(struct bpctl_dev *pbpctl_dev, int *time_left)
 {
int ret = 0;
+
if (pbpctl_dev->bp_caps & WD_CTL_CAP) {
{
if (pbpctl_dev->wdt_status == WDT_STATUS_UNKNOWN)
@@ -3014,6 +3026,7 @@ static int tx_status(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl = 0;
struct bpctl_dev *pbpctl_dev_m;
+
if ((is_bypass_fn(pbpctl_dev)) == 1)
pbpctl_dev_m = pbpctl_dev;
else
@@ -3195,6 +3208,7 @@ static int bypass_change_status(struct bpctl_dev 
*pbpctl_dev)
 static int bypass_status(struct bpctl_dev *pbpctl_dev)
 {
u32 ctrl_ext = 0;
+
if (pbpctl_dev->bp_caps & BP_CAP) {
 
struct bpctl_dev *pbpctl_dev_b = NULL;
@@ -3323,6 +3337,7 @@ static int dis_bypass_cap_status(struct bpctl_dev 
*pbpctl_dev)
 static int wdt_programmed(struct bpctl_dev *pbpctl_dev, int *timeout)
 {
int ret = 0;
+
if (pbpctl_dev->bp_caps & WD_CTL_CAP) {
if (pbpctl_dev->bp_ext_ver >= PXG2BPI_VE

Re: [PATCH] Staging: Silicom: bpctl_mod.c & bypass.c: Adding blank lines

2014-05-25 Thread Chaitanya Hazarey
On its way.

Chaitanya

On Sun, May 25, 2014 at 5:51 PM, Greg KH  wrote:
> On Sun, May 25, 2014 at 05:36:58PM -0700, Chaitanya Hazarey wrote:
>> Added a blank line after declarations in many places to fix the following 
>> warning issued by checkpatch.pl:
>
> Always wrap your lines at 72 columns, like git asks you to when you type
> in the commit message.
>
>> WARNING: Missing a blank line after declarations
>>
>> The reason why it was not applying clean against Greg's tree was that 
>> bpctl_mod.c had changed in the functions which are a part of this patch.
>
> This doesn't belong as part of the changelog, right?  Please resend and
> put it below the --- line, if you want to.
>
> Can you redo this with the changelog fixed up please?
>
> thanks,
>
> greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Staging: Silicom: bpctl_mod.c & bypass.c: Adding blank lines

2014-05-25 Thread Chaitanya Hazarey
Added a blank line after declarations in many places to fix the following 
warning issued by checkpatch.pl:

WARNING: Missing a blank line after declarations

The reason why it was not applying clean against Greg's tree was that 
bpctl_mod.c had changed in the functions which are a part of this patch. 

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/silicom/bpctl_mod.c|   88 +++-
 drivers/staging/silicom/bypasslib/bypass.c |2 +
 2 files changed, 88 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/silicom/bpctl_mod.c 
b/drivers/staging/silicom/bpctl_mod.c
index e361cde..22bf4bf 100644
--- a/drivers/staging/silicom/bpctl_mod.c
+++ b/drivers/staging/silicom/bpctl_mod.c
@@ -752,6 +752,7 @@ static void write_reg(struct bpctl_dev *pbpctl_dev, 
unsigned char value,
uint32_t ctrl_ext = 0, ctrl = 0;
struct bpctl_dev *pbpctl_dev_c = NULL;
unsigned long flags;
+
if (pbpctl_dev->bp_10g9) {
pbpctl_dev_c = get_status_port_fn(pbpctl_dev);
if (!pbpctl_dev_c)
@@ -927,6 +928,7 @@ static int read_reg(struct bpctl_dev *pbpctl_dev, unsigned 
char addr)
 
 #ifdef BP_SYNC_FLAG
unsigned long flags;
+
spin_lock_irqsave(&pbpctl_dev->bypass_wr_lock, flags);
 #else
atomic_set(&pbpctl_dev->wdt_busy, 1);
@@ -1563,6 +1565,7 @@ int pulse_set_fn(struct bpctl_dev *pbpctl_dev, unsigned 
int counter)
 int zero_set_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
 
@@ -1588,6 +1591,7 @@ int zero_set_fn(struct bpctl_dev *pbpctl_dev)
 int pulse_get2_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
 
@@ -1603,6 +1607,7 @@ int pulse_get2_fn(struct bpctl_dev *pbpctl_dev)
 int pulse_get1_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
 
@@ -1666,6 +1671,7 @@ static struct bpctl_dev *lookup_port(struct bpctl_dev 
*dev)
 {
struct bpctl_dev *p;
int n;
+
for (n = 0, p = bpctl_dev_arr; n < device_num && p->pdev; n++) {
if (p->bus == dev->bus
&& p->slot == dev->slot
@@ -1843,6 +1849,7 @@ static int bypass_off(struct bpctl_dev *pbpctl_dev)
 static int tap_off(struct bpctl_dev *pbpctl_dev)
 {
int ret = BP_NOT_CAP;
+
if ((pbpctl_dev->bp_caps & TAP_CAP)
&& (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER)) {
write_data(pbpctl_dev, TAP_OFF);
@@ -1856,6 +1863,7 @@ static int tap_off(struct bpctl_dev *pbpctl_dev)
 static int tap_on(struct bpctl_dev *pbpctl_dev)
 {
int ret = BP_NOT_CAP;
+
if ((pbpctl_dev->bp_caps & TAP_CAP)
&& (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER)) {
write_data(pbpctl_dev, TAP_ON);
@@ -1869,6 +1877,7 @@ static int tap_on(struct bpctl_dev *pbpctl_dev)
 static int disc_off(struct bpctl_dev *pbpctl_dev)
 {
int ret = 0;
+
if ((pbpctl_dev->bp_caps & DISC_CAP) && (pbpctl_dev->bp_ext_ver >= 
0x8)) {
write_data(pbpctl_dev, DISC_OFF);
msec_delay_bp(LATCH_DELAY);
@@ -1881,6 +1890,7 @@ static int disc_off(struct bpctl_dev *pbpctl_dev)
 static int disc_on(struct bpctl_dev *pbpctl_dev)
 {
int ret = 0;
+
if ((pbpctl_dev->bp_caps & DISC_CAP) && (pbpctl_dev->bp_ext_ver >= 
0x8)) {
write_data(pbpctl_dev, /*DISC_ON */ 0x85);
msec_delay_bp(LATCH_DELAY);
@@ -2270,6 +2280,7 @@ static int set_tx(struct bpctl_dev *pbpctl_dev, int 
tx_state)
 {
int ret = 0, ctrl = 0;
struct bpctl_dev *pbpctl_dev_m;
+
if ((is_bypass_fn(pbpctl_dev)) == 1)
pbpctl_dev_m = pbpctl_dev;
else
@@ -2802,6 +2813,7 @@ int wdt_time_left(struct bpctl_dev *pbpctl_dev)
 static int wdt_timer(struct bpctl_dev *pbpctl_dev, int *time_left)
 {
int ret = 0;
+
if (pbpctl_dev->bp_caps & WD_CTL_CAP) {
{
if (pbpctl_dev->wdt_status == WDT_STATUS_UNKNOWN)
@@ -3014,6 +3026,7 @@ static int tx_status(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl = 0;
struct bpctl_dev *pbpctl_dev_m;
+
if ((is_bypass_fn(pbpctl_dev)) == 1)
pbpctl_dev_m = pbpctl_dev;
else
@@ -3195,6 +3208,7 @@ static int bypass_change_status(struct bpctl_dev 
*pbpctl_dev)
 static int bypass_status(struct bpctl_dev *pbpctl_dev)
 {
u32 ctrl_ext = 0;
+
if (pbpctl_dev->bp_caps & BP_CAP) {
 
struct bpctl_dev *pbpctl_dev_b = NULL;
@@ -3323,6 +3337,7 @@ static int dis_bypass_cap_status(struct bpctl_dev 
*pbpctl_dev)
 static int wdt_programmed(struct bpctl_dev *pbpctl_dev, int *timeout)
 {
 

Re: [PATCH] Staging: Silicom: bpctl_mod.c & bypass.c: Fixed a lot of checkpatch.pl warnings

2014-05-25 Thread Chaitanya Hazarey
OK sure, will do Dan.

Greg, the patch has some issues, I did sync to your staging-next
branch and am having issues applying it.

Will send an update when i am able to do it.

Thanks,

Chaitanya

On Sun, May 25, 2014 at 3:30 PM, Dan Carpenter  wrote:
> Since you're redoing this one anyway, please use a more specific subject
> like:
>
> [PATCH] Staging: Silicom: bpctl_mod.c & bypass.c: add blank lines
>
> regards,
> dan carpenter
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Staging: Silicom: bpctl_mod.c & bypass.c: Fixed a lot of checkpatch.pl warnings

2014-05-25 Thread Chaitanya Hazarey
Added a blank line after declarations in many places to fix the following 
warning issued by checkpatch.pl:

WARNING: Missing a blank line after declarations

Lets see if this works now, this patch is prepared against Greg's staging tree.

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/silicom/bpctl_mod.c|   92 +++-
 drivers/staging/silicom/bypasslib/bypass.c |2 +
 2 files changed, 91 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/silicom/bpctl_mod.c 
b/drivers/staging/silicom/bpctl_mod.c
index 6b9365b..b7f9893 100644
--- a/drivers/staging/silicom/bpctl_mod.c
+++ b/drivers/staging/silicom/bpctl_mod.c
@@ -749,6 +749,7 @@ static void write_reg(struct bpctl_dev *pbpctl_dev, 
unsigned char value,
uint32_t ctrl_ext = 0, ctrl = 0;
struct bpctl_dev *pbpctl_dev_c = NULL;
unsigned long flags;
+
if (pbpctl_dev->bp_10g9) {
pbpctl_dev_c = get_status_port_fn(pbpctl_dev);
if (!pbpctl_dev_c)
@@ -924,6 +925,7 @@ static int read_reg(struct bpctl_dev *pbpctl_dev, unsigned 
char addr)
 
 #ifdef BP_SYNC_FLAG
unsigned long flags;
+
spin_lock_irqsave(&pbpctl_dev->bypass_wr_lock, flags);
 #else
atomic_set(&pbpctl_dev->wdt_busy, 1);
@@ -1560,6 +1562,7 @@ int pulse_set_fn(struct bpctl_dev *pbpctl_dev, unsigned 
int counter)
 int zero_set_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
 
@@ -1585,6 +1588,7 @@ int zero_set_fn(struct bpctl_dev *pbpctl_dev)
 int pulse_get2_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
 
@@ -1600,6 +1604,7 @@ int pulse_get2_fn(struct bpctl_dev *pbpctl_dev)
 int pulse_get1_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
 
@@ -1663,6 +1668,7 @@ static struct bpctl_dev *lookup_port(struct bpctl_dev 
*dev)
 {
struct bpctl_dev *p;
int n;
+
for (n = 0, p = bpctl_dev_arr; n < device_num && p->pdev; n++) {
if (p->bus == dev->bus
&& p->slot == dev->slot
@@ -1840,6 +1846,7 @@ static int bypass_off(struct bpctl_dev *pbpctl_dev)
 static int tap_off(struct bpctl_dev *pbpctl_dev)
 {
int ret = BP_NOT_CAP;
+
if ((pbpctl_dev->bp_caps & TAP_CAP)
&& (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER)) {
write_data(pbpctl_dev, TAP_OFF);
@@ -1853,6 +1860,7 @@ static int tap_off(struct bpctl_dev *pbpctl_dev)
 static int tap_on(struct bpctl_dev *pbpctl_dev)
 {
int ret = BP_NOT_CAP;
+
if ((pbpctl_dev->bp_caps & TAP_CAP)
&& (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER)) {
write_data(pbpctl_dev, TAP_ON);
@@ -1866,6 +1874,7 @@ static int tap_on(struct bpctl_dev *pbpctl_dev)
 static int disc_off(struct bpctl_dev *pbpctl_dev)
 {
int ret = 0;
+
if ((pbpctl_dev->bp_caps & DISC_CAP) && (pbpctl_dev->bp_ext_ver >= 
0x8)) {
write_data(pbpctl_dev, DISC_OFF);
msec_delay_bp(LATCH_DELAY);
@@ -1878,6 +1887,7 @@ static int disc_off(struct bpctl_dev *pbpctl_dev)
 static int disc_on(struct bpctl_dev *pbpctl_dev)
 {
int ret = 0;
+
if ((pbpctl_dev->bp_caps & DISC_CAP) && (pbpctl_dev->bp_ext_ver >= 
0x8)) {
write_data(pbpctl_dev, /*DISC_ON */ 0x85);
msec_delay_bp(LATCH_DELAY);
@@ -2267,6 +2277,7 @@ static int set_tx(struct bpctl_dev *pbpctl_dev, int 
tx_state)
 {
int ret = 0, ctrl = 0;
struct bpctl_dev *pbpctl_dev_m;
+
if ((is_bypass_fn(pbpctl_dev)) == 1)
pbpctl_dev_m = pbpctl_dev;
else
@@ -2799,6 +2810,7 @@ int wdt_time_left(struct bpctl_dev *pbpctl_dev)
 static int wdt_timer(struct bpctl_dev *pbpctl_dev, int *time_left)
 {
int ret = 0;
+
if (pbpctl_dev->bp_caps & WD_CTL_CAP) {
{
if (pbpctl_dev->wdt_status == WDT_STATUS_UNKNOWN)
@@ -3011,6 +3023,7 @@ static int tx_status(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl = 0;
struct bpctl_dev *pbpctl_dev_m;
+
if ((is_bypass_fn(pbpctl_dev)) == 1)
pbpctl_dev_m = pbpctl_dev;
else
@@ -3192,6 +3205,7 @@ static int bypass_change_status(struct bpctl_dev 
*pbpctl_dev)
 static int bypass_status(struct bpctl_dev *pbpctl_dev)
 {
u32 ctrl_ext = 0;
+
if (pbpctl_dev->bp_caps & BP_CAP) {
 
struct bpctl_dev *pbpctl_dev_b = NULL;
@@ -3320,6 +3334,7 @@ static int dis_bypass_cap_status(struct bpctl_dev 
*pbpctl_dev)
 static int wdt_programmed(struct bpctl_dev *pbpctl_dev, int *timeout)
 {
int ret = 0;
+
if (pbpctl_dev->bp_caps &

Re: [PATCH] Staging: Silicom: bpctl_mod.c & bypass.c: Fixed a lot of checkpatch.pl warnings

2014-05-25 Thread Chaitanya Hazarey
Sorry Greg, this is taking so long, will make this against your tree
and send it out.

Thanks for looking into this,

Chaitanya

On Sun, May 25, 2014 at 11:03 AM, Greg KH  wrote:
> On Fri, May 23, 2014 at 10:25:28PM -0700, Chaitanya Hazarey wrote:
>> Added a blank line after declarations in many places to fix the
>> following warning issued by checkpatch.pl:
>>
>> WARNING: Missing a blank line after declarations
>>
>> Thanks Greg K-H and Dan for the patience. Hope it works this time, I did
>> apply it against staging and it was ok.
>
>
> Hm, something is odd, it still doesn't apply properly:
>
> $ p1 < ../s1
> checking file drivers/staging/silicom/bpctl_mod.c
> Hunk #40 FAILED at 4773.
> Hunk #41 FAILED at 4821.
> ...
> Hunk #89 FAILED at 7534.
> 3 out of 89 hunks FAILED
>
> Can you refresh this against my tree again and resend?  I think we are
> out of sync here still.
>
> thanks,
>
> greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Staging: rtl8192u: r819xU_firmware_img.c Fixed checkpatch.pl ERRORs

2014-05-25 Thread Chaitanya Hazarey
Fixed a lot of errors of the type "ERROR: space required after that ',' 
(ctx:VxV)"

Added tabs at the beginning of line.

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r819xU_firmware_img.c | 1042 
 1 file changed, 521 insertions(+), 521 deletions(-)

diff --git a/drivers/staging/rtl8192u/r819xU_firmware_img.c 
b/drivers/staging/rtl8192u/r819xU_firmware_img.c
index 0785de7..4eb43cf 100644
--- a/drivers/staging/rtl8192u/r819xU_firmware_img.c
+++ b/drivers/staging/rtl8192u/r819xU_firmware_img.c
@@ -3,546 +3,546 @@
 #include "r819xU_firmware_img.h"
 
 u32 Rtl8192UsbPHY_REGArray[] = {
-0x0, };
+   0x0, };
 
 u32 Rtl8192UsbPHY_REG_1T2RArray[] = {
-0x800,0x,
-0x804,0x0001,
-0x808,0xfc00,
-0x80c,0x001c,
-0x810,0x801010aa,
-0x814,0x008514d0,
-0x818,0x0040,
-0x81c,0x,
-0x820,0x0004,
-0x824,0x0069,
-0x828,0x0004,
-0x82c,0x00e9,
-0x830,0x0004,
-0x834,0x0069,
-0x838,0x0004,
-0x83c,0x00e9,
-0x840,0x,
-0x844,0x,
-0x848,0x,
-0x84c,0x,
-0x850,0x,
-0x854,0x,
-0x858,0x65a965a9,
-0x85c,0x65a965a9,
-0x860,0x001f0010,
-0x864,0x007f0010,
-0x868,0x001f0010,
-0x86c,0x007f0010,
-0x870,0x0f100f70,
-0x874,0x0f100f70,
-0x878,0x,
-0x87c,0x,
-0x880,0x6870e36c,
-0x884,0xe3573600,
-0x888,0x4260c340,
-0x88c,0xff00,
-0x890,0x,
-0x894,0xfffe,
-0x898,0x4c42382f,
-0x89c,0x00656056,
-0x8b0,0x,
-0x8e0,0x,
-0x8e4,0x,
-0x900,0x,
-0x904,0x0023,
-0x908,0x,
-0x90c,0x31121311,
-0xa00,0x00d0c7d8,
-0xa04,0x811f0008,
-0xa08,0x80cd8300,
-0xa0c,0x2e62740f,
-0xa10,0x95009b78,
-0xa14,0x11145008,
-0xa18,0x00881117,
-0xa1c,0x89140fa0,
-0xa20,0x1a1b,
-0xa24,0x090e1317,
-0xa28,0x0204,
-0xa2c,0x,
-0xc00,0x0040,
-0xc04,0x5433,
-0xc08,0x00e4,
-0xc0c,0x6c6c6c6c,
-0xc10,0x0880,
-0xc14,0x4100,
-0xc18,0x0800,
-0xc1c,0x4100,
-0xc20,0x0800,
-0xc24,0x4100,
-0xc28,0x0800,
-0xc2c,0x4100,
-0xc30,0x6de9ac44,
-0xc34,0x465c52cd,
-0xc38,0x497f5994,
-0xc3c,0x0a969764,
-0xc40,0x1f7c403f,
-0xc44,0x000100b7,
-0xc48,0xec02,
-0xc4c,0x0300,
-0xc50,0x69543420,
-0xc54,0x433c0094,
-0xc58,0x69543420,
-0xc5c,0x433c0094,
-0xc60,0x69543420,
-0xc64,0x433c0094,
-0xc68,0x69543420,
-0xc6c,0x433c0094,
-0xc70,0x2c7f000d,
-0xc74,0x0186175b,
-0xc78,0x001f,
-0xc7c,0x00b91612,
-0xc80,0x4100,
-0xc84,0x2000,
-0xc88,0x4100,
-0xc8c,0x2020,
-0xc90,0x4100,
-0xc94,0x,
-0xc98,0x4100,
-0xc9c,0x,
-0xca0,0x00492492,
-0xca4,0x,
-0xca8,0x,
-0xcac,0x,
-0xcb0,0x,
-0xcb4,0x,
-0xcb8,0x,
-0xcbc,0x00492492,
-0xcc0,0x,
-0xcc4,0x,
-0xcc8,0x,
-0xccc,0x,
-0xcd0,0x,
-0xcd4,0x,
-0xcd8,0x64b22427,
-0xcdc,0x00766932,
-0xce0,0x0022,
-0xd00,0x0750,
-0xd04,0x0403,
-0xd08,0x907f,
-0xd0c,0x0001,
-0xd10,0xa063,
-0xd14,0x3c63,
-0xd18,0x6a8f5b6b,
-0xd1c,0x,
-0xd20,0x,
-0xd24,0x,
-0xd28,0x,
-0xd2c,0xcc979975,
-0xd30,0x,
-0xd34,0x,
-0xd38,0x,
-0xd3c,0x00027293,
-0xd40,0x,
-0xd44,0x,
-0xd48,0x,
-0xd4c,0x,
-0xd50,0x6437140a,
-0xd54,0x024dbd02,
-0xd58,0x,
-0xd5c,0x04032064,
-0xe00,0x161a1a1a,
-0xe04,0x12121416,
-0xe08,0x1800,
-0xe0c,0x,
-0xe10,0x161a1a1a,
-0xe14,0x12121416,
-0xe18,0x161a1a1a,
-0xe1c,0x12121416,
+   0x800, 0x,
+   0x804, 0x0001,
+   0x808, 0xfc00,
+   0x80c, 0x001c,
+   0x810, 0x801010aa,
+   0x814, 0x008514d0,
+   0x818, 0x0040,
+   0x81c, 0x,
+   0x820, 0x0004,
+   0x824, 0x0069,
+   0x828, 0x0004,
+   0x82c, 0x00e9,
+   0x830, 0x0004,
+   0x834, 0x0069,
+   0x838, 0x0004,
+   0x83c, 0x00e9,
+   0x840, 0x,
+   0x844, 0x,
+   0x848, 0x,
+   0x84c, 0x,
+   0x850, 0x,
+   0x854, 0x,
+   0x858, 0x65a965a9,
+   0x85c, 0x65a965a9,
+   0x860, 0x001f0010,
+   0x864, 0x007f0010,
+   0x868, 0x001f0010,
+   0x86c, 0x007f0010,
+   0x870, 0x0f100f70,
+   0x874, 0x0f100f70,
+   0x878, 0x,
+   0x87c, 0x,
+   0x880, 0x6870e36c,
+   0x884, 0xe3573600,
+   0x888, 0x4260c340,
+   0x88c, 0xff00,
+   0x890, 0x,
+   0x894, 0xfffe,
+   0x898, 0x4c42382f,
+   0x89c, 0x00656056,
+   0x8b0, 0x,
+   0x8e0, 0x,
+   0x8e4, 0x,
+   0x900, 0x,
+   0x904, 0x0023,
+   0x908, 0x,
+   0x90c, 0x31121311,
+   0xa00, 0x00d0c7d8,
+   0xa04, 0x811f0008,
+   0xa08, 0x80cd8300,
+   0xa0c, 0x2e62740f,
+   0xa10, 0x95009b78,
+   0xa14, 0x11145008,
+   0xa18, 0x00881

[PATCH] Staging: rtl8192u: r819xU_firmware_img.c Fixed checkpatch.pl ERRORs

2014-05-24 Thread Chaitanya Hazarey
Fixed a lot of errors of the type "ERROR: space required after that ',' 
(ctx:VxV)"

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/rtl8192u/r819xU_firmware_img.c | 1036 
 1 file changed, 518 insertions(+), 518 deletions(-)

diff --git a/drivers/staging/rtl8192u/r819xU_firmware_img.c 
b/drivers/staging/rtl8192u/r819xU_firmware_img.c
index 0785de7..19ab9a7 100644
--- a/drivers/staging/rtl8192u/r819xU_firmware_img.c
+++ b/drivers/staging/rtl8192u/r819xU_firmware_img.c
@@ -6,322 +6,322 @@ u32 Rtl8192UsbPHY_REGArray[] = {
 0x0, };
 
 u32 Rtl8192UsbPHY_REG_1T2RArray[] = {
-0x800,0x,
-0x804,0x0001,
-0x808,0xfc00,
-0x80c,0x001c,
-0x810,0x801010aa,
-0x814,0x008514d0,
-0x818,0x0040,
-0x81c,0x,
-0x820,0x0004,
-0x824,0x0069,
-0x828,0x0004,
-0x82c,0x00e9,
-0x830,0x0004,
-0x834,0x0069,
-0x838,0x0004,
-0x83c,0x00e9,
-0x840,0x,
-0x844,0x,
-0x848,0x,
-0x84c,0x,
-0x850,0x,
-0x854,0x,
-0x858,0x65a965a9,
-0x85c,0x65a965a9,
-0x860,0x001f0010,
-0x864,0x007f0010,
-0x868,0x001f0010,
-0x86c,0x007f0010,
-0x870,0x0f100f70,
-0x874,0x0f100f70,
-0x878,0x,
-0x87c,0x,
-0x880,0x6870e36c,
-0x884,0xe3573600,
-0x888,0x4260c340,
-0x88c,0xff00,
-0x890,0x,
-0x894,0xfffe,
-0x898,0x4c42382f,
-0x89c,0x00656056,
-0x8b0,0x,
-0x8e0,0x,
-0x8e4,0x,
-0x900,0x,
-0x904,0x0023,
-0x908,0x,
-0x90c,0x31121311,
-0xa00,0x00d0c7d8,
-0xa04,0x811f0008,
-0xa08,0x80cd8300,
-0xa0c,0x2e62740f,
-0xa10,0x95009b78,
-0xa14,0x11145008,
-0xa18,0x00881117,
-0xa1c,0x89140fa0,
-0xa20,0x1a1b,
-0xa24,0x090e1317,
-0xa28,0x0204,
-0xa2c,0x,
-0xc00,0x0040,
-0xc04,0x5433,
-0xc08,0x00e4,
-0xc0c,0x6c6c6c6c,
-0xc10,0x0880,
-0xc14,0x4100,
-0xc18,0x0800,
-0xc1c,0x4100,
-0xc20,0x0800,
-0xc24,0x4100,
-0xc28,0x0800,
-0xc2c,0x4100,
-0xc30,0x6de9ac44,
-0xc34,0x465c52cd,
-0xc38,0x497f5994,
-0xc3c,0x0a969764,
-0xc40,0x1f7c403f,
-0xc44,0x000100b7,
-0xc48,0xec02,
-0xc4c,0x0300,
-0xc50,0x69543420,
-0xc54,0x433c0094,
-0xc58,0x69543420,
-0xc5c,0x433c0094,
-0xc60,0x69543420,
-0xc64,0x433c0094,
-0xc68,0x69543420,
-0xc6c,0x433c0094,
-0xc70,0x2c7f000d,
-0xc74,0x0186175b,
-0xc78,0x001f,
-0xc7c,0x00b91612,
-0xc80,0x4100,
-0xc84,0x2000,
-0xc88,0x4100,
-0xc8c,0x2020,
-0xc90,0x4100,
-0xc94,0x,
-0xc98,0x4100,
-0xc9c,0x,
-0xca0,0x00492492,
-0xca4,0x,
-0xca8,0x,
-0xcac,0x,
-0xcb0,0x,
-0xcb4,0x,
-0xcb8,0x,
-0xcbc,0x00492492,
-0xcc0,0x,
-0xcc4,0x,
-0xcc8,0x,
-0xccc,0x,
-0xcd0,0x,
-0xcd4,0x,
-0xcd8,0x64b22427,
-0xcdc,0x00766932,
-0xce0,0x0022,
-0xd00,0x0750,
-0xd04,0x0403,
-0xd08,0x907f,
-0xd0c,0x0001,
-0xd10,0xa063,
-0xd14,0x3c63,
-0xd18,0x6a8f5b6b,
-0xd1c,0x,
-0xd20,0x,
-0xd24,0x,
-0xd28,0x,
-0xd2c,0xcc979975,
-0xd30,0x,
-0xd34,0x,
-0xd38,0x,
-0xd3c,0x00027293,
-0xd40,0x,
-0xd44,0x,
-0xd48,0x,
-0xd4c,0x,
-0xd50,0x6437140a,
-0xd54,0x024dbd02,
-0xd58,0x,
-0xd5c,0x04032064,
-0xe00,0x161a1a1a,
-0xe04,0x12121416,
-0xe08,0x1800,
-0xe0c,0x,
-0xe10,0x161a1a1a,
-0xe14,0x12121416,
-0xe18,0x161a1a1a,
-0xe1c,0x12121416,
+0x800, 0x,
+0x804, 0x0001,
+0x808, 0xfc00,
+0x80c, 0x001c,
+0x810, 0x801010aa,
+0x814, 0x008514d0,
+0x818, 0x0040,
+0x81c, 0x,
+0x820, 0x0004,
+0x824, 0x0069,
+0x828, 0x0004,
+0x82c, 0x00e9,
+0x830, 0x0004,
+0x834, 0x0069,
+0x838, 0x0004,
+0x83c, 0x00e9,
+0x840, 0x,
+0x844, 0x,
+0x848, 0x,
+0x84c, 0x,
+0x850, 0x,
+0x854, 0x,
+0x858, 0x65a965a9,
+0x85c, 0x65a965a9,
+0x860, 0x001f0010,
+0x864, 0x007f0010,
+0x868, 0x001f0010,
+0x86c, 0x007f0010,
+0x870, 0x0f100f70,
+0x874, 0x0f100f70,
+0x878, 0x,
+0x87c, 0x,
+0x880, 0x6870e36c,
+0x884, 0xe3573600,
+0x888, 0x4260c340,
+0x88c, 0xff00,
+0x890, 0x,
+0x894, 0xfffe,
+0x898, 0x4c42382f,
+0x89c, 0x00656056,
+0x8b0, 0x,
+0x8e0, 0x,
+0x8e4, 0x,
+0x900, 0x,
+0x904, 0x0023,
+0x908, 0x,
+0x90c, 0x31121311,
+0xa00, 0x00d0c7d8,
+0xa04, 0x811f0008,
+0xa08, 0x80cd8300,
+0xa0c, 0x2e62740f,
+0xa10, 0x95009b78,
+0xa14, 0x11145008,
+0xa18, 0x00881117,
+0xa1c, 0x89140fa0,
+0xa20, 0x1a1b,
+0xa24, 0x090e1317,
+0xa28, 0x0204,
+0xa2c, 0x,
+0xc00, 0x0040,
+0xc04, 0x5433,
+0xc08, 0x00e4,
+0xc0c, 0x6c6c6c6c,
+0xc10, 0x0880,
+0xc14, 0x4100,
+0xc18, 0x0800,
+0xc1c, 0x4100,
+0xc20, 0x0800,
+0xc24, 0x4100,
+0xc28, 0x0800,
+0xc2c, 0x4100,
+0xc30, 0x6de9ac44,
+0xc34, 0x465c52cd,
+0xc38, 0x497f5994,
+0xc3c, 0x0a969764,
+0xc40, 0x1f7c403f,
+0xc44, 0x000100b7,
+0xc48, 0xec02

Re: [PATCH] Staging: Silicom: bpctl_mod.c: Fixed a lot of checkpatch.pl warnings

2014-05-23 Thread Chaitanya Hazarey
Forgot to add - what went wrong - I had deleted some whitespaces which
made the git apply mad.

Thanks,

Chaitanya

On Fri, May 23, 2014 at 10:32 PM, Chaitanya Hazarey  wrote:
> Thanks Greg for looking into it,
>
> I have resubmitted using a new email, hope that works out.
>
> Thanks,
>
> Chaitanya
>
> On Fri, May 23, 2014 at 3:26 PM, Greg KH  wrote:
>> On Fri, May 23, 2014 at 02:47:10PM -0700, Chaitanya Hazarey wrote:
>>> Added a blank line after declarations in many places to fix the following 
>>> warning issued by checkpatch.pl:
>>>
>>> WARNING: Missing a blank line after declarations
>>> ---
>>>  drivers/staging/silicom/bpctl_mod.c |   90 
>>> ++-
>>>  1 file changed, 88 insertions(+), 2 deletions(-)
>>
>> Something is corrupted in this patch and it doesn't apply properly.  Can
>> you resend it to yourself and try to figure out what went wrong?
>>
>> thanks,
>>
>> greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Staging: Silicom: bpctl_mod.c: Fixed a lot of checkpatch.pl warnings

2014-05-23 Thread Chaitanya Hazarey
Thanks Greg for looking into it,

I have resubmitted using a new email, hope that works out.

Thanks,

Chaitanya

On Fri, May 23, 2014 at 3:26 PM, Greg KH  wrote:
> On Fri, May 23, 2014 at 02:47:10PM -0700, Chaitanya Hazarey wrote:
>> Added a blank line after declarations in many places to fix the following 
>> warning issued by checkpatch.pl:
>>
>> WARNING: Missing a blank line after declarations
>> ---
>>  drivers/staging/silicom/bpctl_mod.c |   90 
>> ++-
>>  1 file changed, 88 insertions(+), 2 deletions(-)
>
> Something is corrupted in this patch and it doesn't apply properly.  Can
> you resend it to yourself and try to figure out what went wrong?
>
> thanks,
>
> greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Staging: Silicom: Bypasslib: Fixed a couple of checkpatch.pl warnings

2014-05-23 Thread Chaitanya Hazarey
Hey Dan,

Thanks for your patience, I have resubmitted via a new email. Hope that works.

Thanks,

Chaitanya

On Fri, May 23, 2014 at 3:54 PM, Dan Carpenter  wrote:
> On Fri, May 23, 2014 at 02:39:43PM -0700, Chaitanya Hazarey wrote:
>> Added a blank line after declarations to fix the following warnings issued 
>> by checkpatch.pl:
>>
>> drivers/staging/silicom/bypasslib/bypass.c:138: WARNING: Missing a blank 
>> line after declarations
>> drivers/staging/silicom/bypasslib/bypass.c:189: WARNING: Missing a blank 
>> line after declarations
>>
>> Signed-off-by: Chaitanya Hazarey 
>
> Still doesn't apply, I'm afraid.
>
>> ---
>>  drivers/staging/silicom/bypasslib/bypass.c |2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/staging/silicom/bypasslib/bypass.c 
>> b/drivers/staging/silicom/bypasslib/bypass.c
>> index a58251f..8e714a8 100644
>> --- a/drivers/staging/silicom/bypasslib/bypass.c
>> +++ b/drivers/staging/silicom/bypasslib/bypass.c
>> @@ -135,6 +135,7 @@ static int doit(int cmd, int if_index, int *data)
>>  static int is_dev_sd(int if_index)
>>  {
>>   int ret = 0;
>> +
>>   SET_BPLIB_INT_FN(is_bypass, int, if_index, ret);
>>   return ret >= 0 ? 1 : 0;
>>  }
>> @@ -186,6 +187,7 @@ static int is_bypass_dev(int if_index)
>>  static int is_bypass(int if_index)
>>  {
>>   int ret = 0;
>> +
>>   SET_BPLIB_INT_FN(is_bypass, int, if_index, ret);
>>   if (ret < 0)
>
> There was supposed to be a blank line between the call to
> SET_BPLIB_INT_FN() and the return check and it got deleted for some
> reason.
>
> regards,
> dan carpetner
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Staging: Silicom: bpctl_mod.c & bypass.c: Fixed a lot of checkpatch.pl warnings

2014-05-23 Thread Chaitanya Hazarey
Added a blank line after declarations in many places to fix the following 
warning issued by checkpatch.pl:

WARNING: Missing a blank line after declarations

Thanks Greg K-H and Dan for the patience. Hope it works this time, I did apply 
it against staging and it was ok. 

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/silicom/bpctl_mod.c|   92 +++-
 drivers/staging/silicom/bypasslib/bypass.c |2 +
 2 files changed, 91 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/silicom/bpctl_mod.c 
b/drivers/staging/silicom/bpctl_mod.c
index 7f3d884..83f1072 100644
--- a/drivers/staging/silicom/bpctl_mod.c
+++ b/drivers/staging/silicom/bpctl_mod.c
@@ -752,6 +752,7 @@ static void write_reg(struct bpctl_dev *pbpctl_dev, 
unsigned char value,
uint32_t ctrl_ext = 0, ctrl = 0;
struct bpctl_dev *pbpctl_dev_c = NULL;
unsigned long flags;
+
if (pbpctl_dev->bp_10g9) {
pbpctl_dev_c = get_status_port_fn(pbpctl_dev);
if (!pbpctl_dev_c)
@@ -927,6 +928,7 @@ static int read_reg(struct bpctl_dev *pbpctl_dev, unsigned 
char addr)
 
 #ifdef BP_SYNC_FLAG
unsigned long flags;
+
spin_lock_irqsave(&pbpctl_dev->bypass_wr_lock, flags);
 #else
atomic_set(&pbpctl_dev->wdt_busy, 1);
@@ -1563,6 +1565,7 @@ int pulse_set_fn(struct bpctl_dev *pbpctl_dev, unsigned 
int counter)
 int zero_set_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
 
@@ -1588,6 +1591,7 @@ int zero_set_fn(struct bpctl_dev *pbpctl_dev)
 int pulse_get2_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
 
@@ -1603,6 +1607,7 @@ int pulse_get2_fn(struct bpctl_dev *pbpctl_dev)
 int pulse_get1_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
 
@@ -1666,6 +1671,7 @@ static struct bpctl_dev *lookup_port(struct bpctl_dev 
*dev)
 {
struct bpctl_dev *p;
int n;
+
for (n = 0, p = bpctl_dev_arr; n < device_num && p->pdev; n++) {
if (p->bus == dev->bus
&& p->slot == dev->slot
@@ -1843,6 +1849,7 @@ static int bypass_off(struct bpctl_dev *pbpctl_dev)
 static int tap_off(struct bpctl_dev *pbpctl_dev)
 {
int ret = BP_NOT_CAP;
+
if ((pbpctl_dev->bp_caps & TAP_CAP)
&& (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER)) {
write_data(pbpctl_dev, TAP_OFF);
@@ -1856,6 +1863,7 @@ static int tap_off(struct bpctl_dev *pbpctl_dev)
 static int tap_on(struct bpctl_dev *pbpctl_dev)
 {
int ret = BP_NOT_CAP;
+
if ((pbpctl_dev->bp_caps & TAP_CAP)
&& (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER)) {
write_data(pbpctl_dev, TAP_ON);
@@ -1869,6 +1877,7 @@ static int tap_on(struct bpctl_dev *pbpctl_dev)
 static int disc_off(struct bpctl_dev *pbpctl_dev)
 {
int ret = 0;
+
if ((pbpctl_dev->bp_caps & DISC_CAP) && (pbpctl_dev->bp_ext_ver >= 
0x8)) {
write_data(pbpctl_dev, DISC_OFF);
msec_delay_bp(LATCH_DELAY);
@@ -1881,6 +1890,7 @@ static int disc_off(struct bpctl_dev *pbpctl_dev)
 static int disc_on(struct bpctl_dev *pbpctl_dev)
 {
int ret = 0;
+
if ((pbpctl_dev->bp_caps & DISC_CAP) && (pbpctl_dev->bp_ext_ver >= 
0x8)) {
write_data(pbpctl_dev, /*DISC_ON */ 0x85);
msec_delay_bp(LATCH_DELAY);
@@ -2270,6 +2280,7 @@ static int set_tx(struct bpctl_dev *pbpctl_dev, int 
tx_state)
 {
int ret = 0, ctrl = 0;
struct bpctl_dev *pbpctl_dev_m;
+
if ((is_bypass_fn(pbpctl_dev)) == 1)
pbpctl_dev_m = pbpctl_dev;
else
@@ -2802,6 +2813,7 @@ int wdt_time_left(struct bpctl_dev *pbpctl_dev)
 static int wdt_timer(struct bpctl_dev *pbpctl_dev, int *time_left)
 {
int ret = 0;
+
if (pbpctl_dev->bp_caps & WD_CTL_CAP) {
{
if (pbpctl_dev->wdt_status == WDT_STATUS_UNKNOWN)
@@ -3014,6 +3026,7 @@ static int tx_status(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl = 0;
struct bpctl_dev *pbpctl_dev_m;
+
if ((is_bypass_fn(pbpctl_dev)) == 1)
pbpctl_dev_m = pbpctl_dev;
else
@@ -3195,6 +3208,7 @@ static int bypass_change_status(struct bpctl_dev 
*pbpctl_dev)
 static int bypass_status(struct bpctl_dev *pbpctl_dev)
 {
u32 ctrl_ext = 0;
+
if (pbpctl_dev->bp_caps & BP_CAP) {
 
struct bpctl_dev *pbpctl_dev_b = NULL;
@@ -3323,6 +3337,7 @@ static int dis_bypass_cap_status(struct bpctl_dev 
*pbpctl_dev)
 static int wdt_programmed(struct bpctl_dev *pbpctl_dev, int *timeout)
 {
int ret = 0;
+
 

[PATCH] Staging: Silicom: bpctl_mod.c: Fixed a lot of checkpatch.pl warnings

2014-05-23 Thread Chaitanya Hazarey
Added a blank line after declarations in many places to fix the following 
warning issued by checkpatch.pl:

WARNING: Missing a blank line after declarations
---
 drivers/staging/silicom/bpctl_mod.c |   90 ++-
 1 file changed, 88 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/silicom/bpctl_mod.c 
b/drivers/staging/silicom/bpctl_mod.c
index 7f3d884..f0c6831 100644
--- a/drivers/staging/silicom/bpctl_mod.c
+++ b/drivers/staging/silicom/bpctl_mod.c
@@ -752,6 +752,7 @@ static void write_reg(struct bpctl_dev *pbpctl_dev, 
unsigned char value,
uint32_t ctrl_ext = 0, ctrl = 0;
struct bpctl_dev *pbpctl_dev_c = NULL;
unsigned long flags;
+
if (pbpctl_dev->bp_10g9) {
pbpctl_dev_c = get_status_port_fn(pbpctl_dev);
if (!pbpctl_dev_c)
@@ -927,6 +928,7 @@ static int read_reg(struct bpctl_dev *pbpctl_dev, unsigned 
char addr)
 #ifdef BP_SYNC_FLAG
unsigned long flags;
+
spin_lock_irqsave(&pbpctl_dev->bypass_wr_lock, flags);
 #else
atomic_set(&pbpctl_dev->wdt_busy, 1);
@@ -1563,6 +1565,7 @@ int pulse_set_fn(struct bpctl_dev *pbpctl_dev, unsigned 
int counter)
 int zero_set_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
@@ -1588,6 +1591,7 @@ int zero_set_fn(struct bpctl_dev *pbpctl_dev)
 int pulse_get2_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
@@ -1603,6 +1607,7 @@ int pulse_get2_fn(struct bpctl_dev *pbpctl_dev)
 int pulse_get1_fn(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl_ext = 0, ctrl_value = 0;
+
if (!pbpctl_dev)
return -1;
@@ -1666,6 +1671,7 @@ static struct bpctl_dev *lookup_port(struct bpctl_dev 
*dev)
 {
struct bpctl_dev *p;
int n;
+
for (n = 0, p = bpctl_dev_arr; n < device_num && p->pdev; n++) {
if (p->bus == dev->bus
&& p->slot == dev->slot
@@ -1843,6 +1849,7 @@ static int bypass_off(struct bpctl_dev *pbpctl_dev)
 static int tap_off(struct bpctl_dev *pbpctl_dev)
 {
int ret = BP_NOT_CAP;
+
if ((pbpctl_dev->bp_caps & TAP_CAP)
&& (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER)) {
write_data(pbpctl_dev, TAP_OFF);
@@ -1856,6 +1863,7 @@ static int tap_off(struct bpctl_dev *pbpctl_dev)
 static int tap_on(struct bpctl_dev *pbpctl_dev)
 {
int ret = BP_NOT_CAP;
+
if ((pbpctl_dev->bp_caps & TAP_CAP)
&& (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER)) {
write_data(pbpctl_dev, TAP_ON);
@@ -1869,6 +1877,7 @@ static int tap_on(struct bpctl_dev *pbpctl_dev)
 static int disc_off(struct bpctl_dev *pbpctl_dev)
 {
int ret = 0;
+
if ((pbpctl_dev->bp_caps & DISC_CAP) && (pbpctl_dev->bp_ext_ver >= 
0x8)) {
write_data(pbpctl_dev, DISC_OFF);
msec_delay_bp(LATCH_DELAY);
@@ -2270,6 +2279,7 @@ static int set_tx(struct bpctl_dev *pbpctl_dev, int 
tx_state)
 {
int ret = 0, ctrl = 0;
struct bpctl_dev *pbpctl_dev_m;
+
if ((is_bypass_fn(pbpctl_dev)) == 1)
pbpctl_dev_m = pbpctl_dev;
else
@@ -2802,6 +2812,7 @@ int wdt_time_left(struct bpctl_dev *pbpctl_dev)
 static int wdt_timer(struct bpctl_dev *pbpctl_dev, int *time_left)
 {
int ret = 0;
+
if (pbpctl_dev->bp_caps & WD_CTL_CAP) {
{
if (pbpctl_dev->wdt_status == WDT_STATUS_UNKNOWN)
@@ -3014,6 +3025,7 @@ static int tx_status(struct bpctl_dev *pbpctl_dev)
 {
uint32_t ctrl = 0;
struct bpctl_dev *pbpctl_dev_m;
+
if ((is_bypass_fn(pbpctl_dev)) == 1)
pbpctl_dev_m = pbpctl_dev;
else
@@ -3195,6 +3207,7 @@ static int bypass_change_status(struct bpctl_dev 
*pbpctl_dev)
 static int bypass_status(struct bpctl_dev *pbpctl_dev)
 {
u32 ctrl_ext = 0;
+
if (pbpctl_dev->bp_caps & BP_CAP) {
struct bpctl_dev *pbpctl_dev_b = NULL;
@@ -3323,6 +3336,7 @@ static int dis_bypass_cap_status(struct bpctl_dev 
*pbpctl_dev)
 static int wdt_programmed(struct bpctl_dev *pbpctl_dev, int *timeout)
 {
int ret = 0;
+
if (pbpctl_dev->bp_caps & WD_CTL_CAP) {
if (pbpctl_dev->bp_ext_ver >= PXG2BPI_VER) {
if ((read_reg(pbpctl_dev, STATUS_REG_ADDR)) &
@@ -3386,6 +3400,7 @@ static int tap_flag_status(struct bpctl_dev *pbpctl_dev)
 static int tap_flag_status_clear(struct bpctl_dev *pbpctl_dev)
 {
uint32_t status_reg = 0;
+
if (pbpctl_dev->bp_caps & TAP_STATUS_CAP) {
if (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER) {
status_reg = read_reg(pbpctl_dev, STATUS_TAP_REG_ADDR);
@@ -3400,6 +3415,7 @@ static int tap_flag_status_clear(struct bpctl_dev 
*pbpctl_dev)
 static int tap_change_status(struct bpctl_dev *pbpctl_dev)
 {
int r

[PATCH] Staging: Silicom: Bypasslib: Fixed a couple of checkpatch.pl warnings

2014-05-23 Thread Chaitanya Hazarey
Added a blank line after declarations to fix the following warnings issued by 
checkpatch.pl:

drivers/staging/silicom/bypasslib/bypass.c:138: WARNING: Missing a blank line 
after declarations
drivers/staging/silicom/bypasslib/bypass.c:189: WARNING: Missing a blank line 
after declarations

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/silicom/bypasslib/bypass.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/silicom/bypasslib/bypass.c 
b/drivers/staging/silicom/bypasslib/bypass.c
index a58251f..8e714a8 100644
--- a/drivers/staging/silicom/bypasslib/bypass.c
+++ b/drivers/staging/silicom/bypasslib/bypass.c
@@ -135,6 +135,7 @@ static int doit(int cmd, int if_index, int *data)
 static int is_dev_sd(int if_index)
 {
int ret = 0;
+
SET_BPLIB_INT_FN(is_bypass, int, if_index, ret);
return ret >= 0 ? 1 : 0;
 }
@@ -186,6 +187,7 @@ static int is_bypass_dev(int if_index)
 static int is_bypass(int if_index)
 {
int ret = 0;
+
SET_BPLIB_INT_FN(is_bypass, int, if_index, ret);
if (ret < 0)
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Staging: xgifb: Fixed a code-style warning

2014-05-23 Thread Chaitanya Hazarey
Added a blank line after declarations to fix the following warning issued by 
checkpatch.pl:

drivers/staging/xgifb/vb_init.c:800: WARNING: Missing a blank line after 
declarations

Signed-off-by: Chaitanya Hazarey 
---
 drivers/staging/xgifb/vb_setmode.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/xgifb/vb_setmode.c 
b/drivers/staging/xgifb/vb_setmode.c
index c638c8f..8795e17 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -5462,6 +5462,7 @@ unsigned char XGISetModeNew(struct xgifb_video_info 
*xgifb_info,
unsigned short ModeIdIndex;
struct vb_device_info VBINF;
struct vb_device_info *pVBInfo = &VBINF;
+
pVBInfo->IF_DEF_LVDS = 0;
 
if (HwDeviceExtension->jChipType >= XG20)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Staging: Media: sn9c102: Fixed a pointer declaration coding style issue

2014-05-23 Thread Chaitanya Hazarey
Hey Dan,

Sorry my bad, will resubmit the patch in a proper manner with the
required corrections.

Thanks for looking into this.

Thanks,

Chaitanya

On Fri, May 23, 2014 at 12:10 AM, Dan Carpenter
 wrote:
> On Thu, May 22, 2014 at 04:11:38PM -0700, Chaitanya wrote:
>> Fixed the ERROR thrown off by checkpatch.pl.
>>
>
> Put the error message here, or say what it was.
>
>> Signed-off-by: Chaitanya Hazarey 
>
> Could you change your email client so it has your last in the From:
> header?
>
> This patch doesn't apply.  Read this:
> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/Documentation/email-clients.txt
>
> regards,
> dan carpenter
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/