[PATCH 3/3] staging/rtl8187se: Fix spacing coding style in ieee80211/dot11d.c

2012-11-30 Thread YAMANE Toshiaki
The following errors fixed.
- ERROR: "foo * bar" should be "foo *bar"
- ERROR: "(foo*)" should be "(foo *)"

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/ieee80211/dot11d.c |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/dot11d.c 
b/drivers/staging/rtl8187se/ieee80211/dot11d.c
index b61a66d..9d2d5c5 100644
--- a/drivers/staging/rtl8187se/ieee80211/dot11d.c
+++ b/drivers/staging/rtl8187se/ieee80211/dot11d.c
@@ -67,9 +67,9 @@ Dot11d_Reset(struct ieee80211_device *ieee)
 void
 Dot11d_UpdateCountryIe(
struct ieee80211_device *dev,
-   u8 *pTaddr,
+   u8 *pTaddr,
u16 CoutryIeLen,
-   u8 * pCoutryIe
+   u8 *pCoutryIe
)
 {
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
@@ -107,7 +107,7 @@ Dot11d_UpdateCountryIe(
MaxChnlNum = pTriple->FirstChnl + j;
}
 
-   pTriple = (PCHNL_TXPOWER_TRIPLE)((u8*)pTriple + 3);
+   pTriple = (PCHNL_TXPOWER_TRIPLE)((u8 *)pTriple + 3);
}
 #if 1
//printk("Dot11d_UpdateCountryIe(): Channel List:\n");
@@ -148,7 +148,7 @@ DOT11D_GetMaxTxPwrInDbm(
 
 void
 DOT11D_ScanComplete(
-   struct ieee80211_device * dev
+   struct ieee80211_device *dev
)
 {
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
@@ -170,7 +170,7 @@ DOT11D_ScanComplete(
 }
 
 int IsLegalChannel(
-   struct ieee80211_device * dev,
+   struct ieee80211_device *dev,
u8 channel
 )
 {
@@ -186,7 +186,7 @@ int IsLegalChannel(
 }
 
 int ToLegalChannel(
-   struct ieee80211_device * dev,
+   struct ieee80211_device *dev,
u8 channel
 )
 {
-- 
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 2/3] staging/rtl8187se: Fix spacing coding style in ieee80211/dot11d.c

2012-11-30 Thread YAMANE Toshiaki
The following errors and warnings fixed.
- WARNING: braces {} are not necessary for single statement blocks
- ERROR: that open brace { should be on the previous line
- ERROR: space required before the open parenthesis '('
- ERROR: space prohibited after that open parenthesis '('

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/ieee80211/dot11d.c |   57 +++---
 1 file changed, 23 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/dot11d.c 
b/drivers/staging/rtl8187se/ieee80211/dot11d.c
index 247916b..b61a66d 100644
--- a/drivers/staging/rtl8187se/ieee80211/dot11d.c
+++ b/drivers/staging/rtl8187se/ieee80211/dot11d.c
@@ -39,12 +39,11 @@ Dot11d_Reset(struct ieee80211_device *ieee)
memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1);
memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
// Set new channel map
-   for (i = 1; i <= 11; i++) {
+   for (i = 1; i <= 11; i++)
(pDot11dInfo->channel_map)[i] = 1;
-   }
-   for (i = 12; i <= 14; i++) {
+
+   for (i = 12; i <= 14; i++)
(pDot11dInfo->channel_map)[i] = 2;
-   }
 
pDot11dInfo->State = DOT11D_STATE_NONE;
pDot11dInfo->CountryIeLen = 0;
@@ -77,8 +76,7 @@ Dot11d_UpdateCountryIe(
u8 i, j, NumTriples, MaxChnlNum;
PCHNL_TXPOWER_TRIPLE pTriple;
 
-   if((CoutryIeLen - 3)%3 != 0)
-   {
+   if ((CoutryIeLen - 3)%3 != 0) {
printk("Dot11d_UpdateCountryIe(): Invalid country IE, skip 
it1\n");
Dot11d_Reset(dev);
return;
@@ -89,23 +87,21 @@ Dot11d_UpdateCountryIe(
MaxChnlNum = 0;
NumTriples = (CoutryIeLen - 3) / 3; // skip 3-byte country string.
pTriple = (PCHNL_TXPOWER_TRIPLE)(pCoutryIe + 3);
-   for(i = 0; i < NumTriples; i++)
-   {
-   if(MaxChnlNum >= pTriple->FirstChnl)
-   { // It is not in a monotonically increasing order, so stop 
processing.
+   for (i = 0; i < NumTriples; i++) {
+   if (MaxChnlNum >= pTriple->FirstChnl) {
+   // It is not in a monotonically increasing order, so stop 
processing.
printk("Dot11d_UpdateCountryIe(): Invalid country IE, 
skip it1\n");
Dot11d_Reset(dev);
return;
}
-   if(MAX_CHANNEL_NUMBER < (pTriple->FirstChnl + 
pTriple->NumChnls))
-   { // It is not a valid set of channel id, so stop processing.
+   if (MAX_CHANNEL_NUMBER < (pTriple->FirstChnl + 
pTriple->NumChnls)) {
+   // It is not a valid set of channel id, so stop processing.
printk("Dot11d_UpdateCountryIe(): Invalid country IE, 
skip it2\n");
Dot11d_Reset(dev);
return;
}
 
-   for(j = 0 ; j < pTriple->NumChnls; j++)
-   {
+   for (j = 0 ; j < pTriple->NumChnls; j++) {
pDot11dInfo->channel_map[pTriple->FirstChnl + j] = 1;
pDot11dInfo->MaxTxPwrDbmList[pTriple->FirstChnl + j] = 
pTriple->MaxTxPowerInDbm;
MaxChnlNum = pTriple->FirstChnl + j;
@@ -116,8 +112,8 @@ Dot11d_UpdateCountryIe(
 #if 1
//printk("Dot11d_UpdateCountryIe(): Channel List:\n");
printk("Channel List:");
-   for(i = 1; i <= MAX_CHANNEL_NUMBER; i++)
-   if(pDot11dInfo->channel_map[i] > 0)
+   for (i = 1; i <= MAX_CHANNEL_NUMBER; i++)
+   if (pDot11dInfo->channel_map[i] > 0)
printk(" %d", i);
printk("\n");
 #endif
@@ -138,13 +134,11 @@ DOT11D_GetMaxTxPwrInDbm(
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
u8 MaxTxPwrInDbm = 255;
 
-   if(MAX_CHANNEL_NUMBER < Channel)
-   {
+   if (MAX_CHANNEL_NUMBER < Channel) {
printk("DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n");
return MaxTxPwrInDbm;
}
-   if(pDot11dInfo->channel_map[Channel])
-   {
+   if (pDot11dInfo->channel_map[Channel]) {
MaxTxPwrInDbm = pDot11dInfo->MaxTxPwrDbmList[Channel];
}
 
@@ -159,15 +153,14 @@ DOT11D_ScanComplete(
 {
PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(dev);
 
-   switch(pDot11dInfo->State)
-   {
+   switch (pDot11dInfo->State) {
case DOT11D_STATE_LEARNED:
pDot11dInfo->State = DOT11D_STATE_DONE;
break;
 
case DOT11D_STATE_DONE:
-   if( GET_CIE_WATCHDOG(dev) == 0 )
-   { // Reset country IE if previous one is gone.
+   if (GET_C

[PATCH 1/3] staging/rtl8187se: Fix spacing coding style in ieee80211/dot11d.c

2012-11-30 Thread YAMANE Toshiaki
The following errors fixed.
- ERROR: spaces required around that '=' (ctx:VxV)
- ERROR: spaces required around that '<=' (ctx:VxV)
- ERROR: space required after that ',' (ctx:VxV)

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/ieee80211/dot11d.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/dot11d.c 
b/drivers/staging/rtl8187se/ieee80211/dot11d.c
index 0e93eb0..247916b 100644
--- a/drivers/staging/rtl8187se/ieee80211/dot11d.c
+++ b/drivers/staging/rtl8187se/ieee80211/dot11d.c
@@ -39,10 +39,10 @@ Dot11d_Reset(struct ieee80211_device *ieee)
memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1);
memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1);
// Set new channel map
-   for (i=1; i<=11; i++) {
+   for (i = 1; i <= 11; i++) {
(pDot11dInfo->channel_map)[i] = 1;
}
-   for (i=12; i<=14; i++) {
+   for (i = 12; i <= 14; i++) {
(pDot11dInfo->channel_map)[i] = 2;
}
 
@@ -116,7 +116,7 @@ Dot11d_UpdateCountryIe(
 #if 1
//printk("Dot11d_UpdateCountryIe(): Channel List:\n");
printk("Channel List:");
-   for(i=1; i<= MAX_CHANNEL_NUMBER; i++)
+   for(i = 1; i <= MAX_CHANNEL_NUMBER; i++)
if(pDot11dInfo->channel_map[i] > 0)
printk(" %d", i);
printk("\n");
@@ -125,7 +125,7 @@ Dot11d_UpdateCountryIe(
UPDATE_CIE_SRC(dev, pTaddr);
 
pDot11dInfo->CountryIeLen = CoutryIeLen;
-   memcpy(pDot11dInfo->CountryIeBuf, pCoutryIe,CoutryIeLen);
+   memcpy(pDot11dInfo->CountryIeBuf, pCoutryIe, CoutryIeLen);
pDot11dInfo->State = DOT11D_STATE_LEARNED;
 }
 
@@ -202,7 +202,7 @@ int ToLegalChannel(
u8 default_chn = 0;
u32 i = 0;
 
-   for (i=1; i<= MAX_CHANNEL_NUMBER; i++)
+   for (i = 1; i <= MAX_CHANNEL_NUMBER; i++)
{
if(pDot11dInfo->channel_map[i] > 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/


Re: [PATCH] staging/serqt_usb2: Refactor qt_status_change_check() in serqt_usb2.c

2012-11-30 Thread YAMANE Toshiaki
On Fri, Nov 30, 2012 at 5:25 PM, Dan Carpenter  wrote:
> On Thu, Nov 29, 2012 at 06:10:26PM -0800, Greg Kroah-Hartman wrote:
>> On Thu, Nov 29, 2012 at 01:57:56PM +0900, YAMANE Toshiaki wrote:
>> >
>> > -   ProcessLineStatus(qt_port, data[i + 3]);
>> > -
>> > i += 3;
>> > +   ProcessLineStatus(qt_port, data[i]);
>>
>> I think you just changed the logic in this function, didn't you?
>
> This should be ok.  The i += 3 was there in the original, it's just
> moved up a line.

Thanks for your kindness reply.

But please discard this patch.
Let me consider this patch again.


Regards,

YAMANE Toshiaki
--
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/serqt_usb2: Refactor qt_status_change_check() in serqt_usb2.c

2012-11-29 Thread YAMANE Toshiaki
On Fri, Nov 30, 2012 at 11:10 AM, Greg Kroah-Hartman
 wrote:
> On Thu, Nov 29, 2012 at 01:57:56PM +0900, YAMANE Toshiaki wrote:
>> Improved position to increment variable i,
>> And typo fixes.
>>
>> Signed-off-by: YAMANE Toshiaki 
>> ---
>>  drivers/staging/serqt_usb2/serqt_usb2.c |   12 ++--
>>  1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c 
>> b/drivers/staging/serqt_usb2/serqt_usb2.c
>> index 1b3e995..095d6f2 100644
>> --- a/drivers/staging/serqt_usb2/serqt_usb2.c
>> +++ b/drivers/staging/serqt_usb2/serqt_usb2.c
>> @@ -309,26 +309,26 @@ static void qt_status_change_check(struct tty_struct 
>> *tty,
>>   case 0x00:
>>   if (i > (RxCount - 4)) {
>>   dev_dbg(&port->dev,
>> - "Illegal escape seuences in 
>> received data\n");
>> + "Illegal escape sequence in 
>> received data\n");
>
> This is a different type of fix from:
>
>>   break;
>>   }
>>
>> - ProcessLineStatus(qt_port, data[i + 3]);
>> -
>>   i += 3;
>> + ProcessLineStatus(qt_port, data[i]);
>
> I think you just changed the logic in this function, didn't you?
>
>> +
>>   flag = 1;
>>   break;
>>
>>   case 0x01:
>>   if (i > (RxCount - 4)) {
>>   dev_dbg(&port->dev,
>> - "Illegal escape seuences in 
>> received data\n");
>> + "Illegal escape sequence in 
>> received data\n");
>>   break;
>>   }
>>
>> - ProcessModemStatus(qt_port, data[i + 3]);
>> -
>>   i += 3;
>> + ProcessModemStatus(qt_port, data[i]);
>
> Same here, what happens to i after this?
>
> Please break into two patches, and verify that you didn't break anything
> here.

Greg-san,

I am sorry for confusion.
I sent the patch twice since following patch was applied (gregkh/staging-next)

commit 9d36976fad3008fcc4209789566f7f3e7763f212
Modify qt_status_change_check() and delete qt_status_change().

-Incorporate comment of Mr.Joe Perches (sent Nov.17)
-I sent yesterday

Please discard the patches.

Thanks,


YAMANE Toshiaki
--
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/rtl8187se: Use netdev_ printks in ieee80211/ieee80211_wx.c

2012-11-29 Thread YAMANE Toshiaki
The following warnings fixed.
-WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then 
pr_warn(...  to printk(KERN_WARNING ...
-WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then pr_debug(... 
 to printk(KERN_DEBUG ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c
index 9d46087..e014f7e 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c
@@ -336,9 +336,8 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
kfree(new_crypt);
new_crypt = NULL;
 
-   printk(KERN_WARNING "%s: could not initialize WEP: "
-  "load module ieee80211_crypt_wep\n",
-  dev->name);
+   netdev_warn(ieee->dev,
+   "could not initialize WEP: load module 
ieee80211_crypt_wep\n");
return -EOPNOTSUPP;
}
*crypt = new_crypt;
@@ -410,7 +409,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
if (ieee->reset_on_keychange &&
ieee->iw_mode != IW_MODE_INFRA &&
ieee->reset_port && ieee->reset_port(dev)) {
-   printk(KERN_DEBUG "%s: reset_port failed\n", dev->name);
+   netdev_dbg(ieee->dev, "reset_port failed\n");
return -EINVAL;
}
return 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 3/4] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_wx.c

2012-11-29 Thread YAMANE Toshiaki
The following errors fixed.
-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)

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c
index e37555b..9d46087 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c
@@ -221,7 +221,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
list_for_each_entry(network, &ieee->network_list, list) {
i++;
 
-   if ((stop-ev)<200) {
+   if ((stop-ev) < 200) {
err = -E2BIG;
break;
}
@@ -683,13 +683,13 @@ int ieee80211_wx_set_auth(struct ieee80211_device *ieee,
break;
 
case IW_AUTH_80211_AUTH_ALG:
-   ieee->open_wep = (data->value&IW_AUTH_ALG_OPEN_SYSTEM)?1:0;
+   ieee->open_wep = (data->value&IW_AUTH_ALG_OPEN_SYSTEM) ? 1 : 0;
//printk("open_wep:%d\n", ieee->open_wep);
break;
 
 #if 1
case IW_AUTH_WPA_ENABLED:
-   ieee->wpa_enabled = (data->value)?1:0;
+   ieee->wpa_enabled = (data->value) ? 1 : 0;
//printk("enable wpa:%d\n", ieee->wpa_enabled);
break;
 
@@ -711,7 +711,7 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, 
u8 *ie, size_t len)
 {
u8 *buf = NULL;
 
-   if (len>MAX_WPA_IE_LEN || (len && ie == NULL)) {
+   if (len > MAX_WPA_IE_LEN || (len && ie == NULL)) {
printk("return error out, len:%zu\n", len);
return -EINVAL;
}
-- 
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 2/4] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_wx.c

2012-11-29 Thread YAMANE Toshiaki
The following errors fixed.
-ERROR: that open brace { should be on the previous line
-ERROR: space required before the open parenthesis '('
-ERROR: else should follow close brace '}'
-ERROR: space required before the open brace '{'

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c |   25 +++-
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c
index 9185a21..e37555b 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c
@@ -217,22 +217,18 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
down(&ieee->wx_sem);
spin_lock_irqsave(&ieee->lock, flags);
 
-   if(!ieee->bHwRadioOff)
-   {
+   if (!ieee->bHwRadioOff) {
list_for_each_entry(network, &ieee->network_list, list) {
i++;
 
-   if((stop-ev)<200)
-   {
+   if ((stop-ev)<200) {
err = -E2BIG;
break;
}
if (ieee->scan_age == 0 ||
-   time_after(network->last_scanned + ieee->scan_age, 
jiffies))
-   {
+   time_after(network->last_scanned + ieee->scan_age, 
jiffies)) {
ev = rtl818x_translate_scan(ieee, ev, stop, 
network, info);
-   }
-   else
+   } else
IEEE80211_DEBUG_SCAN(
"Not showing network '%s ("
"%pM)' due to age (%lums).\n",
@@ -430,7 +426,7 @@ int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
 
IEEE80211_DEBUG_WX("GET_ENCODE\n");
 
-   if(ieee->iw_mode == IW_MODE_MONITOR)
+   if (ieee->iw_mode == IW_MODE_MONITOR)
return -1;
 
key = erq->flags & IW_ENCODE_INDEX;
@@ -715,15 +711,13 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device 
*ieee, u8 *ie, size_t len)
 {
u8 *buf = NULL;
 
-   if (len>MAX_WPA_IE_LEN || (len && ie == NULL))
-   {
+   if (len>MAX_WPA_IE_LEN || (len && ie == NULL)) {
printk("return error out, len:%zu\n", len);
return -EINVAL;
}
 
-   if (len)
-   {
-   if (len != ie[1]+2){
+   if (len) {
+   if (len != ie[1]+2) {
printk("len:%zu, ie:%d\n", len, ie[1]);
return -EINVAL;
}
@@ -733,8 +727,7 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, 
u8 *ie, size_t len)
kfree(ieee->wpa_ie);
ieee->wpa_ie = buf;
ieee->wpa_ie_len = len;
-   }
-   else{
+   } else {
kfree(ieee->wpa_ie);
ieee->wpa_ie = NULL;
ieee->wpa_ie_len = 0;
-- 
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 1/4] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_wx.c

2012-11-29 Thread YAMANE Toshiaki
The following errors and warnings fixed.
- ERROR: code indent should use tabs where possible
- WARNING: please, no spaces at the start of a line
- WARNING: please, no space before tabs

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c |  372 ++--
 1 file changed, 186 insertions(+), 186 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c
index c7917b2..9185a21 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c
@@ -41,9 +41,9 @@ static const char *ieee80211_modes[] = {
 
 #define MAX_CUSTOM_LEN 64
 static inline char *rtl818x_translate_scan(struct ieee80211_device *ieee,
-  char *start, char *stop,
-   struct ieee80211_network *network,
-   struct iw_request_info *info)
+  char *start, char *stop,
+  struct ieee80211_network *network,
+  struct iw_request_info *info)
 {
char custom[MAX_CUSTOM_LEN];
char *p;
@@ -78,9 +78,9 @@ static inline char *rtl818x_translate_scan(struct 
ieee80211_device *ieee,
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11%s", 
ieee80211_modes[network->mode]);
start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_CHAR_LEN);
 
-/* Add mode */
-iwe.cmd = SIOCGIWMODE;
-if (network->capability &
+   /* Add mode */
+   iwe.cmd = SIOCGIWMODE;
+   if (network->capability &
(WLAN_CAPABILITY_BSS | WLAN_CAPABILITY_IBSS)) {
if (network->capability & WLAN_CAPABILITY_BSS)
iwe.u.mode = IW_MODE_MASTER;
@@ -90,7 +90,7 @@ static inline char *rtl818x_translate_scan(struct 
ieee80211_device *ieee,
start = iwe_stream_add_event(info, start, stop, &iwe, 
IW_EV_UINT_LEN);
}
 
-/* Add frequency/channel */
+   /* Add frequency/channel */
iwe.cmd = SIOCGIWFREQ;
 /* iwe.u.freq.m = ieee80211_frequency(network->channel, network->mode);
iwe.u.freq.e = 3; */
@@ -168,23 +168,23 @@ static inline char *rtl818x_translate_scan(struct 
ieee80211_device *ieee,
if (iwe.u.data.length)
start = iwe_stream_add_point(info, start, stop, &iwe, custom);
 
-   memset(&iwe, 0, sizeof(iwe));
-if (network->wpa_ie_len) {
+   memset(&iwe, 0, sizeof(iwe));
+   if (network->wpa_ie_len) {
//  printk("wpa_ie_len:%d\n", network->wpa_ie_len);
-char buf[MAX_WPA_IE_LEN];
-memcpy(buf, network->wpa_ie, network->wpa_ie_len);
-iwe.cmd = IWEVGENIE;
-iwe.u.data.length = network->wpa_ie_len;
-start = iwe_stream_add_point(info, start, stop, &iwe, buf);
-}
-
-memset(&iwe, 0, sizeof(iwe));
-if (network->rsn_ie_len) {
+   char buf[MAX_WPA_IE_LEN];
+   memcpy(buf, network->wpa_ie, network->wpa_ie_len);
+   iwe.cmd = IWEVGENIE;
+   iwe.u.data.length = network->wpa_ie_len;
+   start = iwe_stream_add_point(info, start, stop, &iwe, buf);
+   }
+
+   memset(&iwe, 0, sizeof(iwe));
+   if (network->rsn_ie_len) {
//  printk("=>rsn_ie_len:\n", network->rsn_ie_len);
-char buf[MAX_WPA_IE_LEN];
-memcpy(buf, network->rsn_ie, network->rsn_ie_len);
-iwe.cmd = IWEVGENIE;
-iwe.u.data.length = network->rsn_ie_len;
+   char buf[MAX_WPA_IE_LEN];
+   memcpy(buf, network->rsn_ie, network->rsn_ie_len);
+   iwe.cmd = IWEVGENIE;
+   iwe.u.data.length = network->rsn_ie_len;
start = iwe_stream_add_point(info, start, stop, &iwe, buf);
}
 
@@ -359,7 +359,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
   key, escape_essid(sec.keys[key], len),
   erq->length, len);
sec.key_sizes[key] = len;
-   (*crypt)->ops->set_key(sec.keys[key], len, NULL,
+   (*crypt)->ops->set_key(sec.keys[key], len, NULL,
   (*crypt)->priv);
sec.flags |= (1 << key);
/* This ensures a key will be activated if no key is
@@ -472,218 +472,218 @@ int ieee80211_wx_get_encode(struct ieee80211_device 
*ieee,
 }
 
 int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
-   struct iw_request_info *info,
-

[PATCH] staging/serqt_usb2: Refactor qt_status_change_check() in serqt_usb2.c

2012-11-28 Thread YAMANE Toshiaki
Improved position to increment variable i,
And typo fixes.

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/serqt_usb2/serqt_usb2.c |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c 
b/drivers/staging/serqt_usb2/serqt_usb2.c
index 1b3e995..095d6f2 100644
--- a/drivers/staging/serqt_usb2/serqt_usb2.c
+++ b/drivers/staging/serqt_usb2/serqt_usb2.c
@@ -309,26 +309,26 @@ static void qt_status_change_check(struct tty_struct *tty,
case 0x00:
if (i > (RxCount - 4)) {
dev_dbg(&port->dev,
-   "Illegal escape seuences in 
received data\n");
+   "Illegal escape sequence in 
received data\n");
break;
}
 
-   ProcessLineStatus(qt_port, data[i + 3]);
-
i += 3;
+   ProcessLineStatus(qt_port, data[i]);
+
flag = 1;
break;
 
case 0x01:
if (i > (RxCount - 4)) {
dev_dbg(&port->dev,
-   "Illegal escape seuences in 
received data\n");
+   "Illegal escape sequence in 
received data\n");
break;
}
 
-   ProcessModemStatus(qt_port, data[i + 3]);
-
i += 3;
+   ProcessModemStatus(qt_port, data[i]);
+
flag = 1;
break;
 
-- 
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 8/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_rx.c

2012-11-28 Thread YAMANE Toshiaki
The following warnings fixed.
- WARNING: please, no spaces at the start of a line
- WARNING: please, no space before tabs

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c |   34 ++--
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
index 7534d20..446f15e 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
@@ -793,7 +793,7 @@ static inline int ieee80211_is_ofdm_rate(u8 rate)
case IEEE80211_OFDM_RATE_54MB:
return 1;
}
-return 0;
+   return 0;
 }
 
 static inline int ieee80211_SignalStrengthTranslate(
@@ -884,7 +884,7 @@ inline int ieee80211_network_init(
char *p;
 #endif
struct ieee80211_info_element *info_element;
-   u16 left;
+   u16 left;
u8 i;
short offset;
u8 curRate = 0, hOpRate = 0, curRate_ex = 0;
@@ -917,10 +917,10 @@ inline int ieee80211_network_init(
} else
network->flags |= NETWORK_HAS_CCK;
 
-   network->wpa_ie_len = 0;
-   network->rsn_ie_len = 0;
+   network->wpa_ie_len = 0;
+   network->rsn_ie_len = 0;
 
-   info_element = &beacon->info_element;
+   info_element = &beacon->info_element;
left = stats->len - ((void *)info_element - (void *)beacon);
while (left >= sizeof(struct ieee80211_info_element_hdr)) {
if (sizeof(struct ieee80211_info_element_hdr) + 
info_element->len > left) {
@@ -928,7 +928,7 @@ inline int ieee80211_network_init(
 info_element->len + sizeof(struct 
ieee80211_info_element),
 left);
return 1;
-   }
+   }
 
switch (info_element->id) {
case MFIE_TYPE_SSID:
@@ -941,8 +941,8 @@ inline int ieee80211_network_init(
network->ssid_len = min(info_element->len,
(u8)IW_ESSID_MAX_SIZE);
memcpy(network->ssid, info_element->data, 
network->ssid_len);
-   if (network->ssid_len < IW_ESSID_MAX_SIZE)
-   memset(network->ssid + network->ssid_len, 0,
+   if (network->ssid_len < IW_ESSID_MAX_SIZE)
+   memset(network->ssid + network->ssid_len, 0,
   IW_ESSID_MAX_SIZE - network->ssid_len);
 
IEEE80211_DEBUG_SCAN("MFIE_TYPE_SSID: '%s' len=%d.\n",
@@ -1002,14 +1002,14 @@ inline int ieee80211_network_init(
break;
 
case MFIE_TYPE_DS_SET:
-   IEEE80211_DEBUG_SCAN("MFIE_TYPE_DS_SET: %d\n",
+   IEEE80211_DEBUG_SCAN("MFIE_TYPE_DS_SET: %d\n",
 info_element->data[0]);
if (stats->freq == IEEE80211_24GHZ_BAND)
network->channel = info_element->data[0];
break;
 
-   case MFIE_TYPE_FH_SET:
-   IEEE80211_DEBUG_SCAN("MFIE_TYPE_FH_SET: ignored\n");
+   case MFIE_TYPE_FH_SET:
+   IEEE80211_DEBUG_SCAN("MFIE_TYPE_FH_SET: ignored\n");
break;
 
case MFIE_TYPE_CF_SET:
@@ -1137,14 +1137,14 @@ inline int ieee80211_network_init(
default:
IEEE80211_DEBUG_SCAN("unsupported IE %d\n",
 info_element->id);
-break;
-   }
+   break;
+   }
 
left -= sizeof(struct ieee80211_info_element_hdr) +
info_element->len;
info_element = (struct ieee80211_info_element *)
-   &info_element->data[info_element->len];
-   }
+   &info_element->data[info_element->len];
+   }
 //by amy 080312
network->HighestOperaRate = hOpRate;
 //by amy 080312
@@ -1204,8 +1204,8 @@ inline void update_network(struct ieee80211_network *dst,
unsigned char quality = src->stats.signalstrength;
unsigned char signal = 0;
unsigned char noise = 0;
-if (dst->stats.signalstrength > 0)
-quality = (dst->stats.signalstrength * 5 + 
src->stats.signalstrength + 5)/6;
+   if (dst->stats.signalstrength > 0)
+   quality = (dst->stats.signalstrength * 5 + 
src->stats.signalstrength + 5)/6;
signal =

[PATCH 7/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_rx.c

2012-11-28 Thread YAMANE Toshiaki
The following warnings fixed.
- WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c |   47 +---
 1 file changed, 20 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
index f14901d..7534d20 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
@@ -505,13 +505,11 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, 
struct sk_buff *skb,
 
 //YJ,add,080828,for keep alive
if ((fc & IEEE80211_FCTL_TODS) != IEEE80211_FCTL_TODS) {
-   if (!memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) {
+   if (!memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN))
ieee->NumRxUnicast++;
-   }
} else {
-   if (!memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN)) {
+   if (!memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN))
ieee->NumRxUnicast++;
-   }
}
 //YJ,add,080828,for keep alive,end
 
@@ -611,9 +609,8 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
type, stype, skb->len);
goto rx_dropped;
}
-   if (memcmp(bssid, ieee->current_network.bssid, ETH_ALEN)) {
+   if (memcmp(bssid, ieee->current_network.bssid, ETH_ALEN))
goto rx_dropped;
-   }
 
ieee->NumRxDataInPeriod++;
ieee->NumRxOkTotal++;
@@ -806,27 +803,27 @@ static inline int ieee80211_SignalStrengthTranslate(
int RetSS;
 
// Step 1. Scale mapping.
-   if (CurrSS >= 71 && CurrSS <= 100) {
+   if (CurrSS >= 71 && CurrSS <= 100)
RetSS = 90 + ((CurrSS - 70) / 3);
-   } else if (CurrSS >= 41 && CurrSS <= 70) {
+   else if (CurrSS >= 41 && CurrSS <= 70)
RetSS = 78 + ((CurrSS - 40) / 3);
-   } else if (CurrSS >= 31 && CurrSS <= 40) {
+   else if (CurrSS >= 31 && CurrSS <= 40)
RetSS = 66 + (CurrSS - 30);
-   } else if (CurrSS >= 21 && CurrSS <= 30) {
+   else if (CurrSS >= 21 && CurrSS <= 30)
RetSS = 54 + (CurrSS - 20);
-   } else if (CurrSS >= 5 && CurrSS <= 20) {
+   else if (CurrSS >= 5 && CurrSS <= 20)
RetSS = 42 + (((CurrSS - 5) * 2) / 3);
-   } else if (CurrSS == 4) {
+   else if (CurrSS == 4)
RetSS = 36;
-   } else if (CurrSS == 3) {
+   else if (CurrSS == 3)
RetSS = 27;
-   } else if (CurrSS == 2) {
+   else if (CurrSS == 2)
RetSS = 18;
-   } else if (CurrSS == 1) {
+   else if (CurrSS == 1)
RetSS = 9;
-   } else {
+   else
RetSS = CurrSS;
-   }
+
//RT_TRACE(COMP_DBG, DBG_LOUD, ("# After Mapping:  LastSS: %d, 
CurrSS: %d, RetSS: %d\n", LastSS, CurrSS, RetSS));
 
// Step 2. Smoothing.
@@ -848,9 +845,8 @@ static inline void ieee80211_extract_country_ie(
memcpy(network->CountryIeBuf, info_element->data, 
info_element->len);
network->CountryIeLen = info_element->len;
 
-   if (!IS_COUNTRY_IE_VALID(ieee)) {
+   if (!IS_COUNTRY_IE_VALID(ieee))
Dot11d_UpdateCountryIe(ieee, addr2, 
info_element->len, info_element->data);
-   }
}
 
//
@@ -858,9 +854,8 @@ static inline void ieee80211_extract_country_ie(
// some AP (e.g. Cisco 1242) don't include country IE in their
// probe response frame.
//
-   if (IS_EQUAL_CIE_SRC(ieee, addr2)) {
+   if (IS_EQUAL_CIE_SRC(ieee, addr2))
UPDATE_CIE_WATCHDOG(ieee);
-   }
}
 
 }
@@ -1058,9 +1053,9 @@ inline int ieee80211_network_init(
//  info_element->data[3+offset] ,
//  info_element->data[3+offset] & 
(1<<(ieee->assoc_id%8)));
 
-   if (info_element->data[3+offset] & 
(1<<(ieee->assoc_id%8))) {
+   if (info_element->data[3+offset] & 
(1<<(ieee->assoc_id%8)))
network->dtim_data |= IEEE80211_DTIM_UCAST;
-   }
+
break;
 
case MFIE_TYPE_IBSS_SET:
@@ -1094,9 +1089,8 @@ inline int ieee80211_network_init(
info_element->data[4] == 0x02) {
network

[PATCH 6/8] staging/rtl8187se: Use netdev_ printks in ieee80211/ieee80211_rx.c

2012-11-28 Thread YAMANE Toshiaki
The following warnings fixed.
- WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then 
pr_debug(...  to printk(KERN_DEBUG ...
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then 
pr_warn(...  to printk(KERN_WARNING ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then 
pr_info(...  to printk(KERN_INFO ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c |   23 ++--
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
index 43e344a..f14901d 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
@@ -308,9 +308,9 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, 
struct sk_buff *skb,
if (ieee->tkip_countermeasures &&
strcmp(crypt->ops->name, "TKIP") == 0) {
if (net_ratelimit()) {
-   printk(KERN_DEBUG "%s: TKIP countermeasures: dropped "
-  "received packet from %pM\n",
-  ieee->dev->name, hdr->addr2);
+   netdev_dbg(ieee->dev,
+  "TKIP countermeasures: dropped received 
packet from %pM\n",
+  ieee->dev->name, hdr->addr2);
}
return -1;
}
@@ -353,9 +353,9 @@ ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device 
*ieee, struct sk_buff *s
res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv);
atomic_dec(&crypt->refcnt);
if (res < 0) {
-   printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed"
-  " (SA=%pM keyidx=%d)\n",
-  ieee->dev->name, hdr->addr2, keyidx);
+   netdev_dbg(ieee->dev,
+  "MSDU decryption/MIC verification failed (SA=%pM 
keyidx=%d)\n",
+  hdr->addr2, keyidx);
return -1;
}
 
@@ -409,7 +409,8 @@ static int is_duplicate_packet(struct ieee80211_device 
*ieee,
if (p == &ieee->ibss_mac_hash[index]) {
entry = kmalloc(sizeof(struct ieee_ibss_seq), 
GFP_ATOMIC);
if (!entry) {
-   printk(KERN_WARNING "Cannot malloc new mac 
entry\n");
+   netdev_warn(ieee->dev,
+   "Cannot malloc new mac entry\n");
return 0;
}
memcpy(entry->mac, mac, ETH_ALEN);
@@ -491,8 +492,7 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
stats = &ieee->stats;
 
if (skb->len < 10) {
-   printk(KERN_INFO "%s: SKB length < 10\n",
-  dev->name);
+   netdev_info(ieee->dev, "SKB length < 10\n");
goto rx_dropped;
}
 
@@ -646,9 +646,8 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
flen -= hdrlen;
 
if (frag_skb->tail + flen > frag_skb->end) {
-   printk(KERN_WARNING "%s: host decrypted and "
-  "reassembled frame did not fit skb\n",
-  dev->name);
+   netdev_warn(ieee->dev,
+   "host decrypted and reassembled frame did 
not fit skb\n");
ieee80211_frag_cache_invalidate(ieee, hdr);
goto rx_dropped;
}
-- 
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 5/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_rx.c

2012-11-28 Thread YAMANE Toshiaki
The following errors fixed.
- ERROR: "foo* bar" should be "foo *bar"

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
index fb4b406..43e344a 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
@@ -292,7 +292,7 @@ static int ieee80211_is_eapol_frame(struct ieee80211_device 
*ieee,
 
 /* Called only as a tasklet (software IRQ), by ieee80211_rx */
 static inline int
-ieee80211_rx_frame_decrypt(struct ieee80211_device* ieee, struct sk_buff *skb,
+ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, struct sk_buff *skb,
   struct ieee80211_crypt_data *crypt)
 {
struct ieee80211_hdr_4addr *hdr;
@@ -337,7 +337,7 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device* ieee, 
struct sk_buff *skb,
 
 /* Called only as a tasklet (software IRQ), by ieee80211_rx */
 static inline int
-ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device* ieee, struct sk_buff 
*skb,
+ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device *ieee, struct sk_buff 
*skb,
 int keyidx, struct ieee80211_crypt_data *crypt)
 {
struct ieee80211_hdr_4addr *hdr;
@@ -841,7 +841,7 @@ static inline void ieee80211_extract_country_ie(
struct ieee80211_device *ieee,
struct ieee80211_info_element *info_element,
struct ieee80211_network *network,
-   u8 * addr2
+   u8 *addr2
 )
 {
if (IS_DOT11D_ENABLE(ieee)) {
@@ -1187,7 +1187,7 @@ inline int ieee80211_network_init(
 
 static inline int is_same_network(struct ieee80211_network *src,
  struct ieee80211_network *dst,
- struct ieee80211_device * ieee)
+ struct ieee80211_device *ieee)
 {
/* A network is only a duplicate if the channel, BSSID, ESSID
 * and the capability field (in particular IBSS and BSS) all match.
-- 
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/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_rx.c

2012-11-28 Thread YAMANE Toshiaki
The following warnings fixed.
- ERROR: space required before the open parenthesis '('
- ERROR: that open brace { should be on the previous line
- ERROR: space required before the open brace '{'
- ERROR: else should follow close brace '}'
- ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c |  151 +++-
 1 file changed, 54 insertions(+), 97 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
index 64f3c02..fb4b406 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
@@ -174,7 +174,7 @@ static int ieee80211_frag_cache_invalidate(struct 
ieee80211_device *ieee,
struct ieee80211_hdr_4addrqos *hdr_4addrqos;
u8 tid;
 
-   if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS) && 
IEEE80211_QOS_HAS_SEQ(fc)) {
+   if (((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS) && 
IEEE80211_QOS_HAS_SEQ(fc)) {
hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)hdr;
tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QOS_TID;
tid = UP2AC(tid);
@@ -227,7 +227,7 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, 
struct sk_buff *skb,
ieee80211_rx_mgt(ieee, (struct ieee80211_hdr_4addr *)skb->data,
 rx_stats);
 
-   if((ieee->state == IEEE80211_LINKED) && (memcmp(hdr->addr3, 
ieee->current_network.bssid, ETH_ALEN))) {
+   if ((ieee->state == IEEE80211_LINKED) && (memcmp(hdr->addr3, 
ieee->current_network.bssid, ETH_ALEN))) {
dev_kfree_skb_any(skb);
return 0;
}
@@ -244,11 +244,9 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, 
struct sk_buff *skb,
 
 /* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */
 /* Ethernet-II snap header (RFC1042 for most EtherTypes) */
-static unsigned char rfc1042_header[] =
-{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
+static unsigned char rfc1042_header[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
 /* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */
-static unsigned char bridge_tunnel_header[] =
-{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
+static unsigned char bridge_tunnel_header[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 
0xf8 };
 /* No encapsulation header if EtherType < 0x600 (=length) */
 
 /* Called by ieee80211_rx_frame_decrypt */
@@ -381,12 +379,12 @@ static int is_duplicate_packet(struct ieee80211_device 
*ieee,
u8 tid;
 
//TO2DS and QoS
-   if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS) && 
IEEE80211_QOS_HAS_SEQ(fc)) {
+   if (((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS) && 
IEEE80211_QOS_HAS_SEQ(fc)) {
hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)header;
tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QOS_TID;
tid = UP2AC(tid);
tid++;
-   } else if(IEEE80211_QOS_HAS_SEQ(fc)) { //QoS
+   } else if (IEEE80211_QOS_HAS_SEQ(fc)) { //QoS
hdr_3addrqos = (struct ieee80211_hdr_3addrqos *)header;
tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QOS_TID;
tid = UP2AC(tid);
@@ -442,7 +440,7 @@ static int is_duplicate_packet(struct ieee80211_device 
*ieee,
 // }
if ((*last_seq == seq) &&
time_after(*last_time + IEEE_PACKET_RETRY_TIME, jiffies)) {
-   if (*last_frag == frag){
+   if (*last_frag == frag) {
//printk(KERN_WARNING "[1] go drop!\n");
goto drop;
 
@@ -506,17 +504,12 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, 
struct sk_buff *skb,
frag = WLAN_GET_SEQ_FRAG(sc);
 
 //YJ,add,080828,for keep alive
-   if((fc & IEEE80211_FCTL_TODS) != IEEE80211_FCTL_TODS)
-   {
-   if(!memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN))
-   {
+   if ((fc & IEEE80211_FCTL_TODS) != IEEE80211_FCTL_TODS) {
+   if (!memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) {
ieee->NumRxUnicast++;
}
-   }
-   else
-   {
-   if(!memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN))
-   {
+   } else {
+   if (!memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN)) {
ieee->NumRxUnicast++;
}
}
@@ -618,7 +611,7 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
type, stype, skb->len);
goto rx_dropped;
}
-   if(memcmp(bssid, ieee->current_network.bssid, ETH_ALE

[PATCH 3/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_rx.c

2012-11-28 Thread YAMANE Toshiaki
The following warnings fixed.
-- ERROR: space required after that ',' (ctx:VxV)
-- ERROR: spaces required around that '&&' (ctx:VxV)
-- ERROR: space prohibited before that '++' (ctx:WxO)
-- ERROR: spaces required around that '?' (ctx:VxV)
-- ERROR: spaces required around that ':' (ctx:VxV)
-- ERROR: spaces required around that '!=' (ctx:VxW)
-- ERROR: need consistent spacing around '-' (ctx:WxV)
-- ERROR: spaces required around that '=' (ctx:VxW)
-- ERROR: spaces required around that '||' (ctx:ExV)

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c |   64 ++--
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
index c932e31..64f3c02 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
@@ -65,7 +65,7 @@ static inline void ieee80211_monitor_rx(struct 
ieee80211_device *ieee,
 /* Called only as a tasklet (software IRQ) */
 static struct ieee80211_frag_entry *
 ieee80211_frag_cache_find(struct ieee80211_device *ieee, unsigned int seq,
- unsigned int frag, u8 tid,u8 *src, u8 *dst)
+ unsigned int frag, u8 tid, u8 *src, u8 *dst)
 {
struct ieee80211_frag_entry *entry;
int i;
@@ -107,16 +107,16 @@ ieee80211_frag_cache_get(struct ieee80211_device *ieee,
struct ieee80211_hdr_4addrqos *hdr_4addrqos;
u8 tid;
 
-   if (((fc & IEEE80211_FCTL_DSTODS) == 
IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) {
+   if (((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS) && 
IEEE80211_QOS_HAS_SEQ(fc)) {
hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)hdr;
tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QOS_TID;
tid = UP2AC(tid);
-   tid ++;
+   tid++;
} else if (IEEE80211_QOS_HAS_SEQ(fc)) {
hdr_3addrqos = (struct ieee80211_hdr_3addrqos *)hdr;
tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QOS_TID;
tid = UP2AC(tid);
-   tid ++;
+   tid++;
} else {
tid = 0;
}
@@ -129,7 +129,7 @@ ieee80211_frag_cache_get(struct ieee80211_device *ieee,
2 /* alignment */ +
8 /* WEP */ +
ETH_ALEN /* WDS */ +
-   (IEEE80211_QOS_HAS_SEQ(fc)?2:0) /* QOS 
Control */);
+   (IEEE80211_QOS_HAS_SEQ(fc) ? 2 : 0) /* QOS 
Control */);
if (skb == NULL)
return NULL;
 
@@ -150,7 +150,7 @@ ieee80211_frag_cache_get(struct ieee80211_device *ieee,
} else {
/* received a fragment of a frame for which the head fragment
 * should have already been received */
-   entry = ieee80211_frag_cache_find(ieee, seq, frag, 
tid,hdr->addr2,
+   entry = ieee80211_frag_cache_find(ieee, seq, frag, tid, 
hdr->addr2,
  hdr->addr1);
if (entry != NULL) {
entry->last_frag = frag;
@@ -174,21 +174,21 @@ static int ieee80211_frag_cache_invalidate(struct 
ieee80211_device *ieee,
struct ieee80211_hdr_4addrqos *hdr_4addrqos;
u8 tid;
 
-   if(((fc & IEEE80211_FCTL_DSTODS) == 
IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) {
+   if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS) && 
IEEE80211_QOS_HAS_SEQ(fc)) {
hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)hdr;
tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QOS_TID;
tid = UP2AC(tid);
-   tid ++;
+   tid++;
} else if (IEEE80211_QOS_HAS_SEQ(fc)) {
hdr_3addrqos = (struct ieee80211_hdr_3addrqos *)hdr;
tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QOS_TID;
tid = UP2AC(tid);
-   tid ++;
+   tid++;
} else {
tid = 0;
}
 
-   entry = ieee80211_frag_cache_find(ieee, seq, -1, tid,hdr->addr2,
+   entry = ieee80211_frag_cache_find(ieee, seq, -1, tid, hdr->addr2,
  hdr->addr1);
 
if (entry == NULL) {
@@ -227,7 +227,7 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, 
struct sk_buff *skb,
ieee80211_rx_mgt(ieee, (struct ieee80211_hdr_4addr *)skb->data,
 rx_stats);
 
-   if((ieee->state == 
IEEE80211_LINKED)&&(memcmp(hdr->addr3,ieee-&

[PATCH 2/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_rx.c

2012-11-28 Thread YAMANE Toshiaki
The following warnings fixed.
- WARNING: suspect code indent for conditional statements

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c |   56 ++--
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
index ef8bfab..c932e31 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
@@ -108,17 +108,17 @@ ieee80211_frag_cache_get(struct ieee80211_device *ieee,
u8 tid;
 
if (((fc & IEEE80211_FCTL_DSTODS) == 
IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) {
- hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)hdr;
- tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QOS_TID;
- tid = UP2AC(tid);
- tid ++;
+   hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)hdr;
+   tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QOS_TID;
+   tid = UP2AC(tid);
+   tid ++;
} else if (IEEE80211_QOS_HAS_SEQ(fc)) {
- hdr_3addrqos = (struct ieee80211_hdr_3addrqos *)hdr;
- tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QOS_TID;
- tid = UP2AC(tid);
- tid ++;
+   hdr_3addrqos = (struct ieee80211_hdr_3addrqos *)hdr;
+   tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QOS_TID;
+   tid = UP2AC(tid);
+   tid ++;
} else {
- tid = 0;
+   tid = 0;
}
 
if (frag == 0) {
@@ -175,17 +175,17 @@ static int ieee80211_frag_cache_invalidate(struct 
ieee80211_device *ieee,
u8 tid;
 
if(((fc & IEEE80211_FCTL_DSTODS) == 
IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) {
- hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)hdr;
- tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QOS_TID;
- tid = UP2AC(tid);
- tid ++;
+   hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)hdr;
+   tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QOS_TID;
+   tid = UP2AC(tid);
+   tid ++;
} else if (IEEE80211_QOS_HAS_SEQ(fc)) {
- hdr_3addrqos = (struct ieee80211_hdr_3addrqos *)hdr;
- tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QOS_TID;
- tid = UP2AC(tid);
- tid ++;
+   hdr_3addrqos = (struct ieee80211_hdr_3addrqos *)hdr;
+   tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QOS_TID;
+   tid = UP2AC(tid);
+   tid ++;
} else {
- tid = 0;
+   tid = 0;
}
 
entry = ieee80211_frag_cache_find(ieee, seq, -1, tid,hdr->addr2,
@@ -382,17 +382,17 @@ static int is_duplicate_packet(struct ieee80211_device 
*ieee,
 
//TO2DS and QoS
if(((fc & IEEE80211_FCTL_DSTODS) == 
IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) {
- hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)header;
- tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QOS_TID;
- tid = UP2AC(tid);
- tid ++;
+   hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)header;
+   tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QOS_TID;
+   tid = UP2AC(tid);
+   tid ++;
} else if(IEEE80211_QOS_HAS_SEQ(fc)) { //QoS
- hdr_3addrqos = (struct ieee80211_hdr_3addrqos *)header;
- tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QOS_TID;
- tid = UP2AC(tid);
- tid ++;
+   hdr_3addrqos = (struct ieee80211_hdr_3addrqos *)header;
+   tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QOS_TID;
+   tid = UP2AC(tid);
+   tid ++;
} else { // no QoS
- tid = 0;
+   tid = 0;
}
switch (ieee->iw_mode) {
case IW_MODE_ADHOC:
@@ -1309,7 +1309,7 @@ inline void update_network(struct ieee80211_network *dst,
   src->wmm_param[1].ac_aci_acm_aifsn|| \
   src->wmm_param[2].ac_aci_acm_aifsn|| \
   src->wmm_param[3].ac_aci_acm_aifsn) {
- memcpy(dst->wmm_param, src->wmm_param, WME_AC_PRAM_LEN);
+   memcpy(dst->wmm_param, src->wmm_param, WME_AC_PRAM_LEN);
}
dst->QoS_Enable = src->QoS_Enable;
 #else
-- 
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 1/8] staging/rtl8187se: Fix include file issue in ieee80211/ieee80211_rx.c

2012-11-28 Thread YAMANE Toshiaki
The following warning fixed.
- WARNING: Use #include  instead of 

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
index 3a72449..ef8bfab 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
@@ -39,7 +39,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include "ieee80211.h"
-- 
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 8/8] staging/rtl8187se: Use netdev_ printks in ieee80211/ieee80211_softmac_wx.c

2012-11-27 Thread YAMANE Toshiaki
The following warning fixed.
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then 
pr_info(...  to printk(KERN_INFO ...

Signed-off-by: YAMANE Toshiaki 
---
 .../rtl8187se/ieee80211/ieee80211_softmac_wx.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index c71fb63..d9add53 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
@@ -419,8 +419,8 @@ int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee,
else
ieee->raw_tx = 0;
 
-   printk(KERN_INFO"raw TX is %s\n",
- ieee->raw_tx ? "enabled" : "disabled");
+   netdev_info(ieee->dev, "raw TX is %s\n",
+   ieee->raw_tx ? "enabled" : "disabled");
 
if (ieee->iw_mode == IW_MODE_MONITOR) {
if (prev == 0 && ieee->raw_tx) {
-- 
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 7/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_softmac_wx.c

2012-11-27 Thread YAMANE Toshiaki
The following wanings fixed.
- WARNING: please, no spaces at the start of a line

Signed-off-by: YAMANE Toshiaki 
---
 .../rtl8187se/ieee80211/ieee80211_softmac_wx.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index 97faad9..c71fb63 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
@@ -174,7 +174,7 @@ out:
return ret;
 }
 
- int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct 
iw_request_info *a,
+int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct 
iw_request_info *a,
union iwreq_data *wrqu, char *b)
 {
int len, ret = 0;
@@ -395,7 +395,7 @@ out:
return ret;
 }
 
- int ieee80211_wx_get_mode(struct ieee80211_device *ieee, struct 
iw_request_info *a,
+int ieee80211_wx_get_mode(struct ieee80211_device *ieee, struct 
iw_request_info *a,
 union iwreq_data *wrqu, char *b)
 {
 
@@ -403,7 +403,7 @@ out:
return 0;
 }
 
- int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee,
+int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee,
   struct iw_request_info *info,
   union iwreq_data *wrqu, char *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 6/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_softmac_wx.c

2012-11-27 Thread YAMANE Toshiaki
The following errors fixed.
- ERROR: spaces required around that '=' (ctx:VxV)

Signed-off-by: YAMANE Toshiaki 
---
 .../rtl8187se/ieee80211/ieee80211_softmac_wx.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index 177ff58..97faad9 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
@@ -337,7 +337,7 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
  union iwreq_data *wrqu, char *extra)
 {
 
-   int ret=0, len;
+   int ret = 0, len;
short proto_started;
unsigned long flags;
 
@@ -348,12 +348,12 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
proto_started = ieee->proto_started;
 
if (wrqu->essid.length > IW_ESSID_MAX_SIZE) {
-   ret= -E2BIG;
+   ret = -E2BIG;
goto out;
}
 
if (ieee->iw_mode == IW_MODE_MONITOR) {
-   ret= -1;
+   ret = -1;
goto out;
}
 
@@ -528,7 +528,7 @@ int ieee80211_wx_get_power(struct ieee80211_device *ieee,
 struct iw_request_info *info,
 union iwreq_data *wrqu, char *extra)
 {
-   int ret =0;
+   int ret = 0;
 
down(&ieee->wx_sem);
 
-- 
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 5/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_softmac_wx.c

2012-11-27 Thread YAMANE Toshiaki
The following wanings fixed.
- WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: YAMANE Toshiaki 
---
 .../rtl8187se/ieee80211/ieee80211_softmac_wx.c |   12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index f06ed35..177ff58 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
@@ -218,11 +218,11 @@ int ieee80211_wx_set_rate(struct ieee80211_device *ieee,
u32 target_rate = wrqu->bitrate.value;
 
//added by lizhaoming for auto mode
-   if (target_rate == -1) {
+   if (target_rate == -1)
ieee->rate = 110;
-   } else {
+   else
ieee->rate = target_rate/10;
-   }
+
//FIXME: we might want to limit rate also in management protocols.
return 0;
 }
@@ -250,12 +250,10 @@ int ieee80211_wx_set_mode(struct ieee80211_device *ieee, 
struct iw_request_info
if (wrqu->mode == ieee->iw_mode)
goto out;
 
-   if (wrqu->mode == IW_MODE_MONITOR) {
-
+   if (wrqu->mode == IW_MODE_MONITOR)
ieee->dev->type = ARPHRD_IEEE80211;
-   } else {
+   else
ieee->dev->type = ARPHRD_ETHER;
-   }
 
if (!ieee->proto_started) {
ieee->iw_mode = wrqu->mode;
-- 
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/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_softmac_wx.c

2012-11-27 Thread YAMANE Toshiaki
The following errors fixed.
- ERROR: space prohibited after that ',' (ctx:WxW)

Signed-off-by: YAMANE Toshiaki 
---
 .../rtl8187se/ieee80211/ieee80211_softmac_wx.c |   15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index 63524ca..f06ed35 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
@@ -174,9 +174,10 @@ out:
return ret;
 }
 
- int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct 
iw_request_info *a,union iwreq_data *wrqu,char *b)
+ int ieee80211_wx_get_essid(struct ieee80211_device *ieee, struct 
iw_request_info *a,
+   union iwreq_data *wrqu, char *b)
 {
-   int len,ret = 0;
+   int len, ret = 0;
unsigned long flags;
 
if (ieee->iw_mode == IW_MODE_MONITOR)
@@ -199,7 +200,7 @@ out:
}
len = ieee->current_network.ssid_len;
wrqu->essid.length = len;
-   strncpy(b,ieee->current_network.ssid,len);
+   strncpy(b, ieee->current_network.ssid, len);
wrqu->essid.flags = 1;
 
 out:
@@ -338,7 +339,7 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
  union iwreq_data *wrqu, char *extra)
 {
 
-   int ret=0,len;
+   int ret=0, len;
short proto_started;
unsigned long flags;
 
@@ -454,9 +455,9 @@ int ieee80211_wx_get_name(struct ieee80211_device *ieee,
 
if ((ieee->state == IEEE80211_LINKED) ||
(ieee->state == IEEE80211_LINKED_SCANNING))
-   strlcat(wrqu->name,"  link", IFNAMSIZ);
+   strlcat(wrqu->name, "  link", IFNAMSIZ);
else if (ieee->state != IEEE80211_NOLINK)
-   strlcat(wrqu->name," .", IFNAMSIZ);
+   strlcat(wrqu->name, " .", IFNAMSIZ);
 
 
return 0;
@@ -508,7 +509,7 @@ int ieee80211_wx_set_power(struct ieee80211_device *ieee,
if (wrqu->power.flags & IW_POWER_TIMEOUT) {
 
ieee->ps_timeout = wrqu->power.value / 1000;
-   printk("Timeout %d\n",ieee->ps_timeout);
+   printk("Timeout %d\n", ieee->ps_timeout);
}
 
if (wrqu->power.flags & IW_POWER_PERIOD) {
-- 
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 3/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_softmac_wx.c

2012-11-27 Thread YAMANE Toshiaki
The following warnings fixed.
- WARNING: suspect code indent for conditional statements

Signed-off-by: YAMANE Toshiaki 
---
 .../rtl8187se/ieee80211/ieee80211_softmac_wx.c |9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index 0b82c600..63524ca 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
@@ -69,9 +69,8 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
 
if (ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == 
IW_MODE_MASTER)
if (ieee->state == IEEE80211_LINKED) {
-
-   ieee80211_stop_send_beacons(ieee);
-   ieee80211_start_send_beacons(ieee);
+   ieee80211_stop_send_beacons(ieee);
+   ieee80211_start_send_beacons(ieee);
}
}
 
@@ -219,9 +218,9 @@ int ieee80211_wx_set_rate(struct ieee80211_device *ieee,
 
//added by lizhaoming for auto mode
if (target_rate == -1) {
-   ieee->rate = 110;
+   ieee->rate = 110;
} else {
-   ieee->rate = target_rate/10;
+   ieee->rate = target_rate/10;
}
//FIXME: we might want to limit rate also in management protocols.
return 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 2/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_softmac_wx.c

2012-11-27 Thread YAMANE Toshiaki
The following errors fixed.
- ERROR: space required before the open brace '{'
- ERROR: space required before the open parenthesis '('
- ERROR: space prohibited before that close parenthesis ')'
- ERROR: space required after that close brace '}'

Signed-off-by: YAMANE Toshiaki 
---
 .../rtl8187se/ieee80211/ieee80211_softmac_wx.c |   73 ++--
 1 file changed, 35 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index f38519e..0b82c600 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
@@ -36,7 +36,7 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
 // printk("in %s\n",__func__);
down(&ieee->wx_sem);
 
-   if(ieee->iw_mode == IW_MODE_INFRA){
+   if (ieee->iw_mode == IW_MODE_INFRA) {
ret = -EOPNOTSUPP;
goto out;
}
@@ -57,18 +57,18 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
}
}
 
-   if (fwrq->e > 0 || fwrq->m > 14 || fwrq->m < 1 ){
+   if (fwrq->e > 0 || fwrq->m > 14 || fwrq->m < 1) {
ret = -EOPNOTSUPP;
goto out;
 
-   }else { /* Set the channel */
+   } else { /* Set the channel */
 
 
ieee->current_network.channel = fwrq->m;
ieee->set_chan(ieee->dev, ieee->current_network.channel);
 
-   if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == 
IW_MODE_MASTER)
-   if(ieee->state == IEEE80211_LINKED){
+   if (ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == 
IW_MODE_MASTER)
+   if (ieee->state == IEEE80211_LINKED) {
 
ieee80211_stop_send_beacons(ieee);
ieee80211_start_send_beacons(ieee);
@@ -143,12 +143,12 @@ int ieee80211_wx_set_wap(struct ieee80211_device *ieee,
 
down(&ieee->wx_sem);
/* use ifconfig hw ether */
-   if (ieee->iw_mode == IW_MODE_MASTER){
+   if (ieee->iw_mode == IW_MODE_MASTER) {
ret = -1;
goto out;
}
 
-   if (temp->sa_family != ARPHRD_ETHER){
+   if (temp->sa_family != ARPHRD_ETHER) {
ret = -EINVAL;
goto out;
}
@@ -218,7 +218,7 @@ int ieee80211_wx_set_rate(struct ieee80211_device *ieee,
u32 target_rate = wrqu->bitrate.value;
 
//added by lizhaoming for auto mode
-   if(target_rate == -1){
+   if (target_rate == -1) {
ieee->rate = 110;
} else {
ieee->rate = target_rate/10;
@@ -250,16 +250,16 @@ int ieee80211_wx_set_mode(struct ieee80211_device *ieee, 
struct iw_request_info
if (wrqu->mode == ieee->iw_mode)
goto out;
 
-   if (wrqu->mode == IW_MODE_MONITOR){
+   if (wrqu->mode == IW_MODE_MONITOR) {
 
ieee->dev->type = ARPHRD_IEEE80211;
-   }else{
+   } else {
ieee->dev->type = ARPHRD_ETHER;
}
 
-   if (!ieee->proto_started){
+   if (!ieee->proto_started) {
ieee->iw_mode = wrqu->mode;
-   }else{
+   } else {
ieee80211_stop_protocol(ieee);
ieee->iw_mode = wrqu->mode;
ieee80211_start_protocol(ieee);
@@ -296,7 +296,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
if (ieee->data_hard_resume)
ieee->data_hard_resume(ieee->dev);
 
-   if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER)
+   if (ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER)
ieee80211_start_send_beacons(ieee);
 
//YJ,add,080828, In prevent of lossing ping packet during scanning
@@ -314,7 +314,7 @@ int ieee80211_wx_set_scan(struct ieee80211_device *ieee, 
struct iw_request_info
 
down(&ieee->wx_sem);
 
-   if (ieee->iw_mode == IW_MODE_MONITOR || !(ieee->proto_started)){
+   if (ieee->iw_mode == IW_MODE_MONITOR || !(ieee->proto_started)) {
ret = -1;
goto out;
}
@@ -323,7 +323,7 @@ int ieee80211_wx_set_scan(struct ieee80211_device *ieee, 
struct iw_request_info
//ieee80211_sta_ps_send_null_frame(ieee, true);
//YJ,add,080828,end
 
-   if ( ieee->state == IEEE80211_LINKED){
+   if (ieee->state == IEEE80211_LINKED) {
queue_work(ieee->wq, &ieee->wx_sync_scan_wq);
/* intentionally forget to up sem */
return 0;
@@ -349,17 +349,17 @@ int ieee80211_wx_set_essid(struct ieee80211_devi

[PATCH 1/8] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_softmac_wx.c

2012-11-27 Thread YAMANE Toshiaki
The following errors fixed.
- ERROR: space prohibited after that '&' (ctx:WxW)

Signed-off-by: YAMANE Toshiaki 
---
 .../rtl8187se/ieee80211/ieee80211_softmac_wx.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index 1ef8fd6..f38519e 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
@@ -32,7 +32,7 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, 
struct iw_request_info
 union iwreq_data *wrqu, char *b)
 {
int ret;
-   struct iw_freq *fwrq = & wrqu->freq;
+   struct iw_freq *fwrq = &wrqu->freq;
 // printk("in %s\n",__func__);
down(&ieee->wx_sem);
 
@@ -86,7 +86,7 @@ int ieee80211_wx_get_freq(struct ieee80211_device *ieee,
 struct iw_request_info *a,
 union iwreq_data *wrqu, char *b)
 {
-   struct iw_freq *fwrq = & wrqu->freq;
+   struct iw_freq *fwrq = &wrqu->freq;
 
if (ieee->current_network.channel == 0)
return -1;
-- 
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 1/4] staging/rtl8187se: Remove the unnecessary initialization of a local variable in r8180_core.c

2012-11-22 Thread YAMANE Toshiaki
The following errors fixed.
- ERROR: do not initialise statics to 0 or NULL

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/r8180_core.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8187se/r8180_core.c 
b/drivers/staging/rtl8187se/r8180_core.c
index ea04eec..ea8dbb1 100644
--- a/drivers/staging/rtl8187se/r8180_core.c
+++ b/drivers/staging/rtl8187se/r8180_core.c
@@ -62,7 +62,7 @@ static struct pci_device_id rtl8180_pci_id_tbl[] 
__devinitdata = {
 };
 
 static char ifname[IFNAMSIZ] = "wlan%d";
-static int hwwep = 0;
+static int hwwep;
 
 MODULE_LICENSE("GPL");
 MODULE_DEVICE_TABLE(pci, rtl8180_pci_id_tbl);
@@ -201,7 +201,7 @@ static struct net_device_stats *rtl8180_stats(struct 
net_device *dev);
 void rtl8180_commit(struct net_device *dev);
 void rtl8180_start_tx_beacon(struct net_device *dev);
 
-static struct proc_dir_entry *rtl8180_proc = NULL;
+static struct proc_dir_entry *rtl8180_proc;
 
 static int proc_get_registers(char *page, char **start,
  off_t offset, int count,
@@ -3725,7 +3725,7 @@ void GPIOChangeRFWorkItemCallBack(struct work_struct 
*work)
char *argv[3];
static char *RadioPowerPath = "/etc/acpi/events/RadioPower.sh";
static char *envp[] = {"HOME=/", "TERM=linux", "PATH=/usr/bin:/bin", 
NULL};
-   static int readf_count = 0;
+   static int readf_count;
 
readf_count = (readf_count+1)%0x;
/* We should turn off LED before polling FF51[4]. */
-- 
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 2/4] staging/rtl8187se: Remove an unnecessary line continuation in r8180_core.c

2012-11-22 Thread YAMANE Toshiaki
The following warnings fixed.
- WARNING: Avoid unnecessary line continuations

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/r8180_core.c |   10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8187se/r8180_core.c 
b/drivers/staging/rtl8187se/r8180_core.c
index ea8dbb1..8c8b09d 100644
--- a/drivers/staging/rtl8187se/r8180_core.c
+++ b/drivers/staging/rtl8187se/r8180_core.c
@@ -713,8 +713,8 @@ void rtl8180_rtx_disable(struct net_device *dev)
struct r8180_priv *priv = ieee80211_priv(dev);
 
cmd = read_nic_byte(dev, CMD);
-   write_nic_byte(dev, CMD, cmd & ~\
-  ((1<pdev,
priv->rxbuffer->dma,
-   priv->rxbuffersize * \
-   sizeof(u8),
+   priv->rxbuffersize * sizeof(u8),
PCI_DMA_FROMDEVICE);
 
first = *(priv->rxringtail) & (1<<29) ? 1 : 0;
@@ -1490,8 +1489,7 @@ void rtl8180_rx(struct net_device *dev)
 
pci_dma_sync_single_for_device(priv->pdev,
priv->rxbuffer->dma,
-   priv->rxbuffersize * \
-   sizeof(u8),
+   priv->rxbuffersize * sizeof(u8),
PCI_DMA_FROMDEVICE);
 
 drop: /* this is used when we have not enough mem */
-- 
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 3/4] staging/rtl8187se: Fix spacing coding style in r8180_core.c

2012-11-22 Thread YAMANE Toshiaki
The following errors fixed.
-ERROR: "foo * bar" should be "foo *bar"
-ERROR: "(foo*)" should be "(foo *)"

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/r8180_core.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8187se/r8180_core.c 
b/drivers/staging/rtl8187se/r8180_core.c
index 8c8b09d..3119fe6 100644
--- a/drivers/staging/rtl8187se/r8180_core.c
+++ b/drivers/staging/rtl8187se/r8180_core.c
@@ -1699,7 +1699,7 @@ void rtl8180_prepare_beacon(struct net_device *dev)
  * descriptor in the ring buffer, copyes the frame in a TX buffer
  * and kicks the NIC to ensure it does the DMA transfer.
  */
-short rtl8180_tx(struct net_device *dev, u8* txbuf, int len, int priority,
+short rtl8180_tx(struct net_device *dev, u8 *txbuf, int len, int priority,
 short morefrag, short descfrag, int rate)
 {
struct r8180_priv *priv = ieee80211_priv(dev);
@@ -2211,7 +2211,7 @@ void rtl8180_watch_dog(struct net_device *dev);
 
 void watch_dog_adaptive(unsigned long data)
 {
-   struct r8180_priv* priv = ieee80211_priv((struct net_device *)data);
+   struct r8180_priv *priv = ieee80211_priv((struct net_device *)data);
 
if (!priv->up) {
DMESG("<watch_dog_adaptive():driver is not up!\n");
@@ -3462,7 +3462,7 @@ void rtl8180_tx_isr(struct net_device *dev, int pri, 
short error)
return ;
}
 
-   nicv = (u32 *)((nic - nicbegin) + (u8*)begin);
+   nicv = (u32 *)((nic - nicbegin) + (u8 *)begin);
if ((head <= tail && (nicv > tail || nicv < head)) ||
(head > tail && (nicv > tail && nicv < head))) {
DMESGW("nic has lost pointer");
-- 
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/4] staging/rtl8187se: Use dev_ or pr_ printks in r8180_core.c

2012-11-22 Thread YAMANE Toshiaki
The following warnings fixed. 
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ... 
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then 
pr_info(...  to printk(KERN_INFO ... 
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then 
pr_warn(...  to printk(KERN_WARNING ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/r8180_core.c |   23 +--
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8187se/r8180_core.c 
b/drivers/staging/rtl8187se/r8180_core.c
index 3119fe6..0aa2a78 100644
--- a/drivers/staging/rtl8187se/r8180_core.c
+++ b/drivers/staging/rtl8187se/r8180_core.c
@@ -27,6 +27,8 @@
Written by Mariusz Matuszek.
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #undef RX_DONT_PASS_UL
 #undef DUMMY_RX
 
@@ -116,8 +118,7 @@ static int rtl8180_resume(struct pci_dev *pdev)
 
err = pci_enable_device(pdev);
if (err) {
-   printk(KERN_ERR "%s: pci_enable_device failed on resume\n",
-   dev->name);
+   dev_err(&pdev->dev, "pci_enable_device failed on resume\n");
 
return err;
}
@@ -2154,7 +2155,8 @@ void rtl8180_wmm_param_update(struct work_struct *work)
write_nic_dword(dev, AC_VO_PARAM, 
u4bAcParam);
break;
default:
-   printk(KERN_WARNING 
"SetHwReg8185():invalid ACI: %d!\n", eACI);
+   pr_warn("SetHwReg8185():invalid ACI: 
%d!\n",
+   eACI);
break;
}
}
@@ -2193,7 +2195,8 @@ void rtl8180_wmm_param_update(struct work_struct *work)
write_nic_dword(dev, AC_VO_PARAM, u4bAcParam);
break;
default:
-   printk(KERN_WARNING "SetHwReg8185(): invalid 
ACI: %d !\n", eACI);
+   pr_warn("SetHwReg8185(): invalid ACI: %d !\n",
+   eACI);
break;
}
}
@@ -3339,27 +3342,27 @@ static int __init rtl8180_pci_module_init(void)
 
ret = ieee80211_crypto_init();
if (ret) {
-   printk(KERN_ERR "ieee80211_crypto_init() failed %d\n", ret);
+   pr_err("ieee80211_crypto_init() failed %d\n", ret);
return ret;
}
ret = ieee80211_crypto_tkip_init();
if (ret) {
-   printk(KERN_ERR "ieee80211_crypto_tkip_init() failed %d\n", 
ret);
+   pr_err("ieee80211_crypto_tkip_init() failed %d\n", ret);
return ret;
}
ret = ieee80211_crypto_ccmp_init();
if (ret) {
-   printk(KERN_ERR "ieee80211_crypto_ccmp_init() failed %d\n", 
ret);
+   pr_err("ieee80211_crypto_ccmp_init() failed %d\n", ret);
return ret;
}
ret = ieee80211_crypto_wep_init();
if (ret) {
-   printk(KERN_ERR "ieee80211_crypto_wep_init() failed %d\n", ret);
+   pr_err("ieee80211_crypto_wep_init() failed %d\n", ret);
return ret;
}
 
-   printk(KERN_INFO "\nLinux kernel driver for RTL8180 / RTL8185 based 
WLAN cards\n");
-   printk(KERN_INFO "Copyright (c) 2004-2005, Andrea Merello\n");
+   pr_info("\nLinux kernel driver for RTL8180 / RTL8185 based WLAN 
cards\n");
+   pr_info("Copyright (c) 2004-2005, Andrea Merello\n");
DMESG("Initializing module");
DMESG("Wireless extensions version %d", WIRELESS_EXT);
rtl8180_proc_module_init();
-- 
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 2/2] staging/rtl8187se: Fix spacing coding style in r8185b_init.c

2012-11-20 Thread YAMANE Toshiaki
The following errors and warnings fixed.
- ERROR: space prohibited after that open parenthesis '('
- ERROR: space prohibited before that close parenthesis ')'
- ERROR: space required before the open parenthesis '('
- WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/r8185b_init.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8187se/r8185b_init.c 
b/drivers/staging/rtl8187se/r8185b_init.c
index 28611c2..f1db9e4 100644
--- a/drivers/staging/rtl8187se/r8185b_init.c
+++ b/drivers/staging/rtl8187se/r8185b_init.c
@@ -1056,13 +1056,13 @@ void ActSetWirelessMode8185(struct net_device *dev, u8 
btWirelessMode)
ieee->mode = (WIRELESS_MODE)btWirelessMode;
 
/* 3. Change related setting. */
-   if( ieee->mode == WIRELESS_MODE_A ) {
+   if (ieee->mode == WIRELESS_MODE_A)
DMESG("WIRELESS_MODE_A\n");
-   } else if( ieee->mode == WIRELESS_MODE_B ) {
+   else if (ieee->mode == WIRELESS_MODE_B)
DMESG("WIRELESS_MODE_B\n");
-   } else if( ieee->mode == WIRELESS_MODE_G ) {
+   else if (ieee->mode == WIRELESS_MODE_G)
DMESG("WIRELESS_MODE_G\n");
-   }
+
ActUpdateChannelAccessSetting( dev, ieee->mode, 
&priv->ChannelAccessSetting);
 }
 
-- 
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 1/2] staging/rtl8187se: Use netdev_ printks in r8185b_init.c

2012-11-20 Thread YAMANE Toshiaki
The following warnings fixed.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then 
pr_info(...  to printk(KERN_INFO ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/r8185b_init.c |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8187se/r8185b_init.c 
b/drivers/staging/rtl8187se/r8185b_init.c
index 5c454fa..28611c2 100644
--- a/drivers/staging/rtl8187se/r8185b_init.c
+++ b/drivers/staging/rtl8187se/r8185b_init.c
@@ -223,9 +223,10 @@ static bool HwHSSIThreeWire(struct net_device *dev,
udelay(10);
}
if (TryCnt == TC_3W_POLL_MAX_TRY_CNT) {
-   printk(KERN_ERR "rtl8187se: HwThreeWire(): CmdReg:"
-  " %#X RE|WE bits are not clear!!\n", u1bTmp);
-   return false;
+   netdev_err(dev,
+  "HwThreeWire(): CmdReg: %#X RE|WE bits are not 
clear!!\n",
+  u1bTmp);
+   return false;
}
 
/* RTL8187S HSSI Read/Write Function */
@@ -419,7 +420,7 @@ void ZEBRA_Config_85BASIC_HardCode(struct net_device *dev)
 
if (u4bRF23 == 0x818 && u4bRF24 == 0x70C) {
d_cut = 1;
-   printk(KERN_INFO "rtl8187se: card type changed from C- to 
D-cut\n");
+   netdev_info(dev, "card type changed from C- to D-cut\n");
}
 
/* Page0 : reg0-reg15 */
-- 
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 16/16] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_crypt_wep.c

2012-11-20 Thread YAMANE Toshiaki
The following errors and warnings fixed.
- ERROR: code indent should use tabs where possible
- WARNING: please, no spaces at the start of a line

Signed-off-by: YAMANE Toshiaki 
---
 .../rtl8187se/ieee80211/ieee80211_crypt_wep.c  |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c
index bb9a078..bba7714 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c
@@ -217,7 +217,7 @@ static int prism2_wep_decrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
memmove(skb->data + 4, skb->data, hdr_len);
skb_pull(skb, 4);
skb_trim(skb, skb->len - 4);
-return 0;
+   return 0;
 }
 
 
@@ -289,5 +289,5 @@ void ieee80211_crypto_wep_exit(void)
 void ieee80211_wep_null(void)
 {
 // printk(">%s()\n", __func__);
-return;
+   return;
 }
-- 
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 15/16] staging/rtl8187se: Use pr_ printks in ieee80211/ieee80211_crypt_wep.c

2012-11-20 Thread YAMANE Toshiaki
The following warnings fixed.
- WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then 
pr_debug(...  to printk(KERN_DEBUG ...

and add pr_fmt.

Signed-off-by: YAMANE Toshiaki 
---
 .../rtl8187se/ieee80211/ieee80211_crypt_wep.c  |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c
index 7254085..bb9a078 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c
@@ -9,6 +9,8 @@
  * more details.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 //#include 
 #include 
 #include 
@@ -50,15 +52,13 @@ static void *prism2_wep_init(int keyidx)
priv->key_idx = keyidx;
priv->tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
if (IS_ERR(priv->tx_tfm)) {
-   printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate "
-  "crypto API arc4\n");
+   pr_debug("could not allocate crypto API arc4\n");
priv->tx_tfm = NULL;
goto fail;
}
priv->rx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
if (IS_ERR(priv->rx_tfm)) {
-   printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate "
-  "crypto API arc4\n");
+   pr_debug("could not allocate crypto API arc4\n");
priv->rx_tfm = NULL;
goto fail;
}
-- 
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 14/16] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_crypt_wep.c

2012-11-20 Thread YAMANE Toshiaki
The following errors fixed.
-ERROR: "foo * bar" should be "foo *bar"

Signed-off-by: YAMANE Toshiaki 
---
 .../rtl8187se/ieee80211/ieee80211_crypt_wep.c  |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c
index c0effee..7254085 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c
@@ -40,7 +40,7 @@ struct prism2_wep_data {
 };
 
 
-static void * prism2_wep_init(int keyidx)
+static void *prism2_wep_init(int keyidx)
 {
struct prism2_wep_data *priv;
 
@@ -248,7 +248,7 @@ static int prism2_wep_get_key(void *key, int len, u8 *seq, 
void *priv)
 }
 
 
-static char * prism2_wep_print_stats(char *p, void *priv)
+static char *prism2_wep_print_stats(char *p, void *priv)
 {
struct prism2_wep_data *wep = priv;
p += sprintf(p, "key[%d] alg=WEP len=%d\n",
-- 
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 13/16] staging/rtl8187se: Fix include file issue in ieee80211/ieee80211_crypt_wep.c

2012-11-20 Thread YAMANE Toshiaki
The following warning fixed.
- WARNING: Use #include  instead of 

Signed-off-by: YAMANE Toshiaki 
---
 .../rtl8187se/ieee80211/ieee80211_crypt_wep.c  |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c
index 58f3eeb..c0effee 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c
@@ -15,7 +15,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include "ieee80211.h"
 
-- 
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 12/16] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_crypt_ccmp.c

2012-11-20 Thread YAMANE Toshiaki
The following error and warning fixed.
- ERROR: code indent should use tabs where possible
- WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: YAMANE Toshiaki 
---
 .../rtl8187se/ieee80211/ieee80211_crypt_ccmp.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c
index 40217b7..f5949e8 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c
@@ -129,7 +129,7 @@ static void ccmp_init_blocks(struct crypto_tfm *tfm,
/*
qc_included = ((WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) &&
   (WLAN_FC_GET_STYPE(fc) & 0x08));
-*/
+   */
// fixed by David :2006.9.6
qc_included = ((WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) &&
   (WLAN_FC_GET_STYPE(fc) & 0x80));
@@ -340,9 +340,9 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
}
 
if (memcmp(mic, a, CCMP_MIC_LEN) != 0) {
-   if (net_ratelimit()) {
+   if (net_ratelimit())
pr_debug("decrypt failed: STA=%pM\n", hdr->addr2);
-   }
+
key->dot11RSNAStatsCCMPDecryptErrors++;
return -5;
}
-- 
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 11/16] staging/rtl8187se: Use pr_ printks in ieee80211/ieee80211_crypt_ccmp.c

2012-11-20 Thread YAMANE Toshiaki
The following warnings fixed.
- WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then 
pr_debug(...  to printk(KERN_DEBUG ...

and add pr_fmt.

Signed-off-by: YAMANE Toshiaki 
---
 .../rtl8187se/ieee80211/ieee80211_crypt_ccmp.c |   26 +---
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c
index 5465b09..40217b7 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c
@@ -9,6 +9,8 @@
  * more details.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 //#include 
 #include 
 #include 
@@ -75,8 +77,7 @@ static void *ieee80211_ccmp_init(int key_idx)
 
priv->tfm = (void *)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
if (IS_ERR(priv->tfm)) {
-   printk(KERN_DEBUG "ieee80211_crypt_ccmp: could not allocate "
-  "crypto API aes\n");
+   pr_debug("could not allocate crypto API aes\n");
priv->tfm = NULL;
goto fail;
}
@@ -282,23 +283,22 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, 
int hdr_len, void *priv)
keyidx = pos[3];
if (!(keyidx & (1 << 5))) {
if (net_ratelimit()) {
-   printk(KERN_DEBUG "CCMP: received packet without ExtIV"
-  " flag from %pM\n", hdr->addr2);
+   pr_debug("received packet without ExtIV flag from 
%pM\n",
+hdr->addr2);
}
key->dot11RSNAStatsCCMPFormatErrors++;
return -2;
}
keyidx >>= 6;
if (key->key_idx != keyidx) {
-   printk(KERN_DEBUG "CCMP: RX tkey->key_idx=%d frame "
-  "keyidx=%d priv=%p\n", key->key_idx, keyidx, priv);
+   pr_debug("RX tkey->key_idx=%d frame keyidx=%d priv=%p\n",
+key->key_idx, keyidx, priv);
return -6;
}
if (!key->key_set) {
if (net_ratelimit()) {
-   printk(KERN_DEBUG "CCMP: received packet from %pM"
-  " with keyid=%d that does not have a configured"
-  " key\n", hdr->addr2, keyidx);
+   pr_debug("received packet from %pM with keyid=%d that 
does not have a configured key\n",
+hdr->addr2, keyidx);
}
return -3;
}
@@ -313,9 +313,8 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
 
if (memcmp(pn, key->rx_pn, CCMP_PN_LEN) <= 0) {
if (net_ratelimit()) {
-   printk(KERN_DEBUG "CCMP: replay detected: STA=%pM"
-  " previous PN %pm received PN %pm\n",
-  hdr->addr2, key->rx_pn, pn);
+   pr_debug("replay detected: STA=%pM previous PN %pm 
received PN %pm\n",
+hdr->addr2, key->rx_pn, pn);
}
key->dot11RSNAStatsCCMPReplays++;
return -4;
@@ -342,8 +341,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
 
if (memcmp(mic, a, CCMP_MIC_LEN) != 0) {
if (net_ratelimit()) {
-   printk(KERN_DEBUG "CCMP: decrypt failed: STA="
-  "%pM\n", hdr->addr2);
+   pr_debug("decrypt failed: STA=%pM\n", hdr->addr2);
}
key->dot11RSNAStatsCCMPDecryptErrors++;
return -5;
-- 
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 10/16] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_crypt_ccmp.c

2012-11-20 Thread YAMANE Toshiaki
The following errors fixed.
-ERROR: "foo * bar" should be "foo *bar"

Signed-off-by: YAMANE Toshiaki 
---
 .../rtl8187se/ieee80211/ieee80211_crypt_ccmp.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c
index f959675..5465b09 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c
@@ -64,7 +64,7 @@ void ieee80211_ccmp_aes_encrypt(struct crypto_tfm *tfm,
crypto_cipher_encrypt_one((void *)tfm, ct, pt);
 }
 
-static void * ieee80211_ccmp_init(int key_idx)
+static void *ieee80211_ccmp_init(int key_idx)
 {
struct ieee80211_ccmp_data *priv;
 
@@ -415,7 +415,7 @@ static int ieee80211_ccmp_get_key(void *key, int len, u8 
*seq, void *priv)
 }
 
 
-static char * ieee80211_ccmp_print_stats(char *p, void *priv)
+static char *ieee80211_ccmp_print_stats(char *p, void *priv)
 {
struct ieee80211_ccmp_data *ccmp = priv;
p += sprintf(p, "key[%d] alg=CCMP key_set=%d "
-- 
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 09/16] staging/rtl8187se: Fix include file issue in ieee80211/ieee80211_crypt_ccmp.c

2012-11-20 Thread YAMANE Toshiaki
The following warnings fixed.
- WARNING: Use #include  instead of 

Signed-off-by: YAMANE Toshiaki 
---
 .../rtl8187se/ieee80211/ieee80211_crypt_ccmp.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c
index 62f..f959675 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c
@@ -18,7 +18,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include "ieee80211.h"
-- 
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 08/16] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_module.c

2012-11-20 Thread YAMANE Toshiaki
The following errors and warnings fixed.
- ERROR: space required after that ',' (ctx:VxV)
- ERROR: code indent should use tabs where possible
- WARNING: please, no space before tabs
- WARNING: please, no spaces at the start of a line
- WARNING: suspect code indent for conditional statements (8, 10)

Signed-off-by: YAMANE Toshiaki 
---
 .../staging/rtl8187se/ieee80211/ieee80211_module.c |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c
index 66b4833..4358c4b 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c
@@ -99,7 +99,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
 {
struct ieee80211_device *ieee;
struct net_device *dev;
-   int i,err;
+   int i, err;
 
IEEE80211_DEBUG_INFO("Initializing...\n");
 
@@ -139,11 +139,11 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
spin_lock_init(&ieee->wpax_suitlist_lock);
 
ieee->wpax_type_set = 0;
-   ieee->wpa_enabled = 0;
-   ieee->tkip_countermeasures = 0;
-   ieee->drop_unencrypted = 0;
-   ieee->privacy_invoked = 0;
-   ieee->ieee802_1x = 1;
+   ieee->wpa_enabled = 0;
+   ieee->tkip_countermeasures = 0;
+   ieee->drop_unencrypted = 0;
+   ieee->privacy_invoked = 0;
+   ieee->ieee802_1x = 1;
ieee->raw_tx = 0;
 
ieee80211_softmac_init(ieee);
@@ -152,9 +152,9 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
INIT_LIST_HEAD(&ieee->ibss_mac_hash[i]);
 
for (i = 0; i < 17; i++) {
- ieee->last_rxseq_num[i] = -1;
- ieee->last_rxfrag_num[i] = -1;
- ieee->last_packet_time[i] = 0;
+   ieee->last_rxseq_num[i] = -1;
+   ieee->last_rxfrag_num[i] = -1;
+   ieee->last_packet_time[i] = 0;
}
 //These function were added to load crypte module autoly
ieee80211_tkip_null();
-- 
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 07/16] staging/rtl8187se: Use netdev_ printks in ieee80211/ieee80211_module.c

2012-11-20 Thread YAMANE Toshiaki
The following warning fixed.
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then 
pr_warn(...  to printk(KERN_WARNING ...

Signed-off-by: YAMANE Toshiaki 
---
 .../staging/rtl8187se/ieee80211/ieee80211_module.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c
index 0ed4c93..66b4833 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c
@@ -69,8 +69,7 @@ static inline int ieee80211_networks_allocate(struct 
ieee80211_device *ieee)
MAX_NETWORK_COUNT, sizeof(struct ieee80211_network),
GFP_KERNEL);
if (!ieee->networks) {
-   printk(KERN_WARNING "%s: Out of memory allocating beacons\n",
-  ieee->dev->name);
+   netdev_warn(ieee->dev,  "Out of memory allocating beacons\n");
return -ENOMEM;
}
 
-- 
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 06/16] staging/rtl8187se: Fix include file issue in ieee80211/ieee80211_module.c

2012-11-20 Thread YAMANE Toshiaki
The following warning fixed.
- WARNING: Use #include  instead of 

Signed-off-by: YAMANE Toshiaki 
---
 .../staging/rtl8187se/ieee80211/ieee80211_module.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c
index 9422573..0ed4c93 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_module.c
@@ -48,7 +48,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
-- 
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 04/16] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_crypt.c

2012-11-20 Thread YAMANE Toshiaki
The following errors fixed.
-ERROR: "foo * bar" should be "foo *bar"

Signed-off-by: YAMANE Toshiaki 
---
 .../staging/rtl8187se/ieee80211/ieee80211_crypt.c  |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c
index 623245c..694eae3 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c
@@ -154,7 +154,7 @@ int ieee80211_unregister_crypto_ops(struct 
ieee80211_crypto_ops *ops)
 }
 
 
-struct ieee80211_crypto_ops * ieee80211_get_crypto_ops(const char *name)
+struct ieee80211_crypto_ops *ieee80211_get_crypto_ops(const char *name)
 {
unsigned long flags;
struct list_head *ptr;
@@ -181,7 +181,7 @@ struct ieee80211_crypto_ops * 
ieee80211_get_crypto_ops(const char *name)
 }
 
 
-static void * ieee80211_crypt_null_init(int keyidx) { return (void *) 1; }
+static void *ieee80211_crypt_null_init(int keyidx) { return (void *) 1; }
 static void ieee80211_crypt_null_deinit(void *priv) {}
 
 static struct ieee80211_crypto_ops ieee80211_crypt_null = {
-- 
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 05/16] staging/rtl8187se: Fix spacing coding style in ieee80211/ieee80211_crypt.h

2012-11-20 Thread YAMANE Toshiaki
The following error fixed.
-ERROR: "foo * bar" should be "foo *bar"

Signed-off-by: YAMANE Toshiaki 
---
 .../staging/rtl8187se/ieee80211/ieee80211_crypt.h  |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.h 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.h
index b58a3bc..0b4ea43 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.h
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.h
@@ -77,7 +77,7 @@ struct ieee80211_crypt_data {
 
 int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops);
 int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops);
-struct ieee80211_crypto_ops * ieee80211_get_crypto_ops(const char *name);
+struct ieee80211_crypto_ops *ieee80211_get_crypto_ops(const char *name);
 void ieee80211_crypt_deinit_entries(struct ieee80211_device *, int);
 void ieee80211_crypt_deinit_handler(unsigned long);
 void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee,
-- 
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 03/16] staging/rtl8187se: Use pr_ printks in ieee80211/ieee80211_crypt.c

2012-11-20 Thread YAMANE Toshiaki
The following warnings fixed.
- WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then 
pr_debug(...  to printk(KERN_DEBUG ...

and add pr_fmt.

Signed-off-by: YAMANE Toshiaki 
---
 .../staging/rtl8187se/ieee80211/ieee80211_crypt.c  |   16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c
index 934b915..623245c 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c
@@ -11,6 +11,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 //#include 
 #include 
 #include 
@@ -66,8 +68,7 @@ void ieee80211_crypt_deinit_handler(unsigned long data)
spin_lock_irqsave(&ieee->lock, flags);
ieee80211_crypt_deinit_entries(ieee, 0);
if (!list_empty(&ieee->crypt_deinit_list)) {
-   printk(KERN_DEBUG "%s: entries remaining in delayed crypt "
-  "deletion list\n", ieee->dev->name);
+   pr_debug("entries remaining in delayed crypt deletion list\n");
ieee->crypt_deinit_timer.expires = jiffies + HZ;
add_timer(&ieee->crypt_deinit_timer);
}
@@ -118,8 +119,7 @@ int ieee80211_register_crypto_ops(struct 
ieee80211_crypto_ops *ops)
list_add(&alg->list, &hcrypt->algs);
spin_unlock_irqrestore(&hcrypt->lock, flags);
 
-   printk(KERN_DEBUG "ieee80211_crypt: registered algorithm '%s'\n",
-  ops->name);
+   pr_debug("registered algorithm '%s'\n", ops->name);
 
return 0;
 }
@@ -146,8 +146,7 @@ int ieee80211_unregister_crypto_ops(struct 
ieee80211_crypto_ops *ops)
spin_unlock_irqrestore(&hcrypt->lock, flags);
 
if (del_alg) {
-   printk(KERN_DEBUG "ieee80211_crypt: unregistered algorithm "
-  "'%s'\n", ops->name);
+   pr_debug("unregistered algorithm '%s'\n", ops->name);
kfree(del_alg);
}
 
@@ -234,9 +233,8 @@ void ieee80211_crypto_deinit(void)
alg = list_entry(ptr, struct ieee80211_crypto_alg, list);
if (alg) {
list_del(ptr);
-   printk(KERN_DEBUG
-  "ieee80211_crypt: unregistered algorithm '%s' 
(deinit)\n",
-  alg->ops->name);
+   pr_debug("unregistered algorithm '%s' (deinit)\n",
+alg->ops->name);
kfree(alg);
}
}
-- 
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 02/16] staging/rtl8187se: Fix include file issue in ieee80211/ieee80211_crypt.c

2012-11-20 Thread YAMANE Toshiaki
The following warnings fixed.
- WARNING: Use #include  instead of 
- WARNING: Use #include  instead of 

Signed-off-by: YAMANE Toshiaki 
---
 .../staging/rtl8187se/ieee80211/ieee80211_crypt.c  |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c
index b3882ae..934b915 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c
@@ -15,8 +15,8 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
+#include 
 
 #include "ieee80211.h"
 
-- 
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 01/16] staging/rtl8187se: Fix spacing coding style in r8180_dm.h

2012-11-20 Thread YAMANE Toshiaki
The following errors fixed.
-ERROR: "foo * bar" should be "foo *bar"

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/rtl8187se/r8180_dm.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8187se/r8180_dm.h 
b/drivers/staging/rtl8187se/r8180_dm.h
index b775825..732c06a 100644
--- a/drivers/staging/rtl8187se/r8180_dm.h
+++ b/drivers/staging/rtl8187se/r8180_dm.h
@@ -13,10 +13,10 @@ bool CheckDig(struct net_device *dev);
 bool CheckHighPower(struct net_device *dev);
 void rtl8180_hw_dig_wq(struct work_struct *work);
 void rtl8180_tx_pw_wq(struct work_struct *work);
-void rtl8180_rate_adapter(struct work_struct * work);
+void rtl8180_rate_adapter(struct work_struct *work);
 void TxPwrTracking87SE(struct net_device *dev);
 bool CheckTxPwrTracking(struct net_device *dev);
-void rtl8180_rate_adapter(struct work_struct * work);
+void rtl8180_rate_adapter(struct work_struct *work);
 void timer_rate_adaptive(unsigned long data);
 
 
-- 
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 v2] staging/serqt_usb2: Refactor qt_status_change_check() in serqt_usb2.c

2012-11-16 Thread YAMANE Toshiaki
Modify qt_status_change_check() and delete qt_status_change().

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/serqt_usb2/serqt_usb2.c |   53 +--
 1 file changed, 22 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c 
b/drivers/staging/serqt_usb2/serqt_usb2.c
index f68a855..13722b2 100644
--- a/drivers/staging/serqt_usb2/serqt_usb2.c
+++ b/drivers/staging/serqt_usb2/serqt_usb2.c
@@ -291,33 +291,6 @@ static void qt_interrupt_callback(struct urb *urb)
/* FIXME */
 }
 
-static int qt_status_change(unsigned int limit,
-   unsigned char *data,
-   int i,
-   struct quatech_port *qt_port,
-   struct usb_serial_port *port)
-{
-   void (*fn)(struct quatech_port *, unsigned char);
-
-   if (0x00 == data[i + 2]) {
-   dev_dbg(&port->dev, "Line status status.\n");
-   fn = ProcessLineStatus;
-   } else {
-   dev_dbg(&port->dev, "Modem status status.\n");
-   fn = ProcessModemStatus;
-   }
-
-   if (i > limit) {
-   dev_dbg(&port->dev,
-   "Illegal escape seuences in received data\n");
-   return 0;
-   }
-
-   (*fn)(qt_port, data[i + 3]);
-
-   return 1;
-}
-
 static void qt_status_change_check(struct tty_struct *tty,
   struct urb *urb,
   struct quatech_port *qt_port,
@@ -334,11 +307,29 @@ static void qt_status_change_check(struct tty_struct *tty,
flag = 0;
switch (data[i + 2]) {
case 0x00:
+   if (i > (RxCount - 4)) {
+   dev_dbg(&port->dev,
+   "Illegal escape sequences in 
received data\n");
+   break;
+   }
+
+   i += 3;
+   ProcessLineStatus(qt_port, data[i]);
+
+   flag = 1;
+   break;
+
case 0x01:
-   flag = qt_status_change((RxCount - 4), data, i,
-   qt_port, port);
-   if (flag == 1)
-   i += 3;
+   if (i > (RxCount - 4)) {
+   dev_dbg(&port->dev,
+   "Illegal escape sequences in 
received data\n");
+   break;
+   }
+
+   i += 3;
+   ProcessModemStatus(qt_port, data[i]);
+
+   flag = 1;
break;
 
case 0xff:
-- 
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/serqt_usb2: Refactor qt_status_change_check() in serqt_usb2.c

2012-11-16 Thread YAMANE Toshiaki
Modify qt_status_change_check() and delete qt_status_change().

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/serqt_usb2/serqt_usb2.c |   53 +--
 1 file changed, 22 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c 
b/drivers/staging/serqt_usb2/serqt_usb2.c
index f68a855..1b3e995 100644
--- a/drivers/staging/serqt_usb2/serqt_usb2.c
+++ b/drivers/staging/serqt_usb2/serqt_usb2.c
@@ -291,33 +291,6 @@ static void qt_interrupt_callback(struct urb *urb)
/* FIXME */
 }
 
-static int qt_status_change(unsigned int limit,
-   unsigned char *data,
-   int i,
-   struct quatech_port *qt_port,
-   struct usb_serial_port *port)
-{
-   void (*fn)(struct quatech_port *, unsigned char);
-
-   if (0x00 == data[i + 2]) {
-   dev_dbg(&port->dev, "Line status status.\n");
-   fn = ProcessLineStatus;
-   } else {
-   dev_dbg(&port->dev, "Modem status status.\n");
-   fn = ProcessModemStatus;
-   }
-
-   if (i > limit) {
-   dev_dbg(&port->dev,
-   "Illegal escape seuences in received data\n");
-   return 0;
-   }
-
-   (*fn)(qt_port, data[i + 3]);
-
-   return 1;
-}
-
 static void qt_status_change_check(struct tty_struct *tty,
   struct urb *urb,
   struct quatech_port *qt_port,
@@ -334,11 +307,29 @@ static void qt_status_change_check(struct tty_struct *tty,
flag = 0;
switch (data[i + 2]) {
case 0x00:
+   if (i > (RxCount - 4)) {
+   dev_dbg(&port->dev,
+   "Illegal escape seuences in 
received data\n");
+   break;
+   }
+
+   ProcessLineStatus(qt_port, data[i + 3]);
+
+   i += 3;
+   flag = 1;
+   break;
+
case 0x01:
-   flag = qt_status_change((RxCount - 4), data, i,
-   qt_port, port);
-   if (flag == 1)
-   i += 3;
+   if (i > (RxCount - 4)) {
+   dev_dbg(&port->dev,
+   "Illegal escape seuences in 
received data\n");
+   break;
+   }
+
+   ProcessModemStatus(qt_port, data[i + 3]);
+
+   i += 3;
+   flag = 1;
break;
 
case 0xff:
-- 
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 2/4] staging/serqt_usb2: refactor qt_read_bulk_callback() in serqt_usb2.c

2012-11-15 Thread YAMANE Toshiaki
On Fri, Nov 16, 2012 at 5:43 AM, Dan Carpenter  wrote:
>
> Btw:
>> + dev_dbg(&port->dev, "Line status status.\n");
>  ^^^
> These kind of debug statements which just tell which function is
> being called can be deleted.  The function tracer already provides
> that information.

I did not know that. Thanks!

>> + fn = ProcessLineStatus;
>> + } else {
>> + dev_dbg(&port->dev, "Modem status status.\n");
>> +     fn = ProcessModemStatus;
>
> regards,
> dan carpenter
>



-- 

Regards,

YAMANE Toshiaki
--
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/serqt_usb2: refactor qt_read_bulk_callback() in serqt_usb2.c

2012-11-15 Thread YAMANE Toshiaki
On Fri, Nov 16, 2012 at 5:18 AM, Dan Carpenter  wrote:
> On Fri, Nov 16, 2012 at 05:01:55AM +0900, YAMANE Toshiaki wrote:
>> On Wed, Nov 14, 2012 at 9:41 PM, Dan Carpenter  
>> wrote:
>> >
>> > Why can't we test whether i == (RxCount - 3) earlier and handle
>> > the errors there?  That way we wouldn't need to pass the limit
>> > variable.
>> >
>> > In fact, this whole function is sort of nasty.  We start by doing
>> > a switch (data[i + 2]) { then we combine the 0x00 and 0x01 and call
>> > this function which separates them out and sets a function pointer
>> > and then calls the function point?  Get rid of this whole function.
>> >
>> > You shouldn't need to use function pointers to do this; that's too
>> > many levels of abstraction.
>>
>> I feel it so diffcult to consider the fixing this patch more.
>>
>> There are some reasons why I have become such a description.
>> - The purpose of this patch is the resolution of the
>>   line over 80 characters issue
>> - I Wrote the code to be aware of the following:
>> -- Do not change the procedure
>> -- The shallow nest
>> -- To avoid the redundancy
>>
>> If I do not use a function pointer, which take the form below.
>>
>> if (0x00 == data[i + 2])
>> dev_dbg(&port->dev, "Line status status.\n");
>> else
>> dev_dbg(&port->dev, "Modem status status.\n");
>>
>> if (i > limit) {
>> dev_dbg(&port->dev,
>> "Illegal escape seuences in received data\n");
>> return 0;
>> }
>>
>> if (0x00 == data[i + 2])
>> ProcessLineStatus(qt_port, data[i + 3]);
>> else
>> ProcessModemStatus(qt_port, data[i + 3]);
>>
>>   return 1;
>>
>> I also feel it may be...
>>
>> And I am against to move the dev_dbg procedure call to
>> qt_status_change_check procedure because the nesting will be so deep.
>
> In the end, the new version is more confusing than the original
> code.  Checkpatch.pl is not a king which must be obeyed.  The only
> thing which matters is how easy it is for a human to understand the
> code.

Yes. I understand it.
I wil condider the improvement this.

>> >>   if (urb->status) {
>> >>   qt_port->ReadBulkStopped = 1;
>> >> - dev_dbg(&urb->dev->dev, "%s - nonzero write bulk status 
>> >> received: %d\n",
>> >> + dev_dbg(&urb->dev->dev,
>> >> + "%s - nonzero write bulk status received: %d\n",
>> >>   __func__, urb->status);
>> >
>> > Don't mix in these unrelated 80 character limit changes.
>>
>> I think the purpose of refactoring is the resolution of the line over 80
>> characters issue. I think that the separation of the patch should stop taking
>> because they are already applied in the linux-next tree.
>>
>
> Yes, once it is merged into linux-next then it is too late to send a
> version 2 patch.
>
> I'm explaining that as a reviewer it is confusing for me to figure
> out when you do unrelated things in the same patch and mix
> everything up.

I understand it.
Thanks for your comments.


-- 

Regards,

YAMANE Toshiaki
--
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/serqt_usb2: refactor qt_read_bulk_callback() in serqt_usb2.c

2012-11-15 Thread YAMANE Toshiaki
On Wed, Nov 14, 2012 at 9:41 PM, Dan Carpenter  wrote:
>
> Why can't we test whether i == (RxCount - 3) earlier and handle
> the errors there?  That way we wouldn't need to pass the limit
> variable.
>
> In fact, this whole function is sort of nasty.  We start by doing
> a switch (data[i + 2]) { then we combine the 0x00 and 0x01 and call
> this function which separates them out and sets a function pointer
> and then calls the function point?  Get rid of this whole function.
>
> You shouldn't need to use function pointers to do this; that's too
> many levels of abstraction.

I feel it so diffcult to consider the fixing this patch more.

There are some reasons why I have become such a description.
- The purpose of this patch is the resolution of the
  line over 80 characters issue
- I Wrote the code to be aware of the following:
-- Do not change the procedure
-- The shallow nest
-- To avoid the redundancy

If I do not use a function pointer, which take the form below.

if (0x00 == data[i + 2])
dev_dbg(&port->dev, "Line status status.\n");
else
dev_dbg(&port->dev, "Modem status status.\n");

if (i > limit) {
dev_dbg(&port->dev,
"Illegal escape seuences in received data\n");
return 0;
}

if (0x00 == data[i + 2])
ProcessLineStatus(qt_port, data[i + 3]);
else
ProcessModemStatus(qt_port, data[i + 3]);

return 1;

I also feel it may be...

And I am against to move the dev_dbg procedure call to
qt_status_change_check procedure because the nesting will be so deep.

>>   if (urb->status) {
>>   qt_port->ReadBulkStopped = 1;
>> - dev_dbg(&urb->dev->dev, "%s - nonzero write bulk status 
>> received: %d\n",
>> + dev_dbg(&urb->dev->dev,
>> + "%s - nonzero write bulk status received: %d\n",
>>   __func__, urb->status);
>
> Don't mix in these unrelated 80 character limit changes.

I think the purpose of refactoring is the resolution of the line over 80
characters issue. I think that the separation of the patch should stop taking
because they are already applied in the linux-next tree.

Thanks.


YAMANE Toshiaki
yamaneto...@gmail.com
--
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/serqt_usb2: refactor qt_read_bulk_callback() in serqt_usb2.c

2012-11-14 Thread YAMANE Toshiaki
On Wed, Nov 14, 2012 at 9:41 PM, Dan Carpenter  wrote:
> On Sat, Nov 10, 2012 at 06:33:56AM +0900, YAMANE Toshiaki wrote:
>> Modified to eliminate the deep nesting and redundant description.
>>
>> Signed-off-by: YAMANE Toshiaki 
>> ---
>>  drivers/staging/serqt_usb2/serqt_usb2.c |  147 
>> +--
>>  1 file changed, 80 insertions(+), 67 deletions(-)
>>
>> diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c 
>> b/drivers/staging/serqt_usb2/serqt_usb2.c
>> index 9bc8923..0395bdf 100644
>> --- a/drivers/staging/serqt_usb2/serqt_usb2.c
>> +++ b/drivers/staging/serqt_usb2/serqt_usb2.c
>> @@ -291,22 +291,89 @@ static void qt_interrupt_callback(struct urb *urb)
>>   /* FIXME */
>>  }
>>
>> +static int qt_status_change(unsigned int limit,
>> + unsigned char *data,
>> + int i,
>> + struct quatech_port *qt_port,
>> + struct usb_serial_port *port)
>> +{
>> + void (*fn)(struct quatech_port *, unsigned char);
>> +
>> + if (0x00 == data[i + 2]) {
>> + dev_dbg(&port->dev, "Line status status.\n");
>> + fn = ProcessLineStatus;
>> + } else {
>> + dev_dbg(&port->dev, "Modem status status.\n");
>> + fn = ProcessModemStatus;
>> + }
>> +
>> + if (i > limit) {
>
> Why can't we test whether i == (RxCount - 3) earlier and handle
> the errors there?  That way we wouldn't need to pass the limit
> variable.
>
> In fact, this whole function is sort of nasty.  We start by doing
> a switch (data[i + 2]) { then we combine the 0x00 and 0x01 and call
> this function which separates them out and sets a function pointer
> and then calls the function point?  Get rid of this whole function.
>
> You shouldn't need to use function pointers to do this; that's too
> many levels of abstraction.
>
>> + dev_dbg(&port->dev,
>> + "Illegal escape seuences in received data\n");
>> + return 0;
>> + }
>> +
>> + (*fn)(qt_port, data[i + 3]);
>> +
>> + return 1;
>> +}
>> +
>
> [snip]
>
>>   if (urb->status) {
>>   qt_port->ReadBulkStopped = 1;
>> -     dev_dbg(&urb->dev->dev, "%s - nonzero write bulk status 
>> received: %d\n",
>> + dev_dbg(&urb->dev->dev,
>> + "%s - nonzero write bulk status received: %d\n",
>>   __func__, urb->status);
>
> Don't mix in these unrelated 80 character limit changes.

Dan-san,

Thanks for your follow-ups.
I will try to resend this patch.



-- 

Regards,

YAMANE Toshiaki
--
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 16/16] staging/omapdrm: Fix spacing coding style in omap_plane.c

2012-11-14 Thread YAMANE Toshiaki
The following errors and warnings fixed.
- ERROR: code indent should use tabs where possible
- WARNING: please, no spaces at the start of a line

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/omapdrm/omap_plane.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/omapdrm/omap_plane.c 
b/drivers/staging/omapdrm/omap_plane.c
index 25d78ca..2a8e5ba 100644
--- a/drivers/staging/omapdrm/omap_plane.c
+++ b/drivers/staging/omapdrm/omap_plane.c
@@ -436,8 +436,8 @@ void omap_plane_install_properties(struct drm_plane *plane,
drm_object_attach_property(obj, prop, 0);
}
 
-prop = priv->zorder_prop;
-if (!prop) {
+   prop = priv->zorder_prop;
+   if (!prop) {
prop = drm_property_create_range(dev, 0, "zorder", 0, 3);
if (prop == NULL)
return;
-- 
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 15/16] staging/omapdrm: Fix spacing coding style in omap_plane.c

2012-11-14 Thread YAMANE Toshiaki
The following warning fixed.
- WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/omapdrm/omap_plane.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/omapdrm/omap_plane.c 
b/drivers/staging/omapdrm/omap_plane.c
index 1b3a9fe..25d78ca 100644
--- a/drivers/staging/omapdrm/omap_plane.c
+++ b/drivers/staging/omapdrm/omap_plane.c
@@ -551,8 +551,8 @@ struct drm_plane *omap_plane_init(struct drm_device *dev,
return plane;
 
 fail:
-   if (plane) {
+   if (plane)
omap_plane_destroy(plane);
-   }
+
return NULL;
 }
-- 
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 14/16] staging/omapdrm: Fix spacing coding style in omap_gem_helper.c

2012-11-14 Thread YAMANE Toshiaki
The following warning fixed.
- WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/omapdrm/omap_gem_helpers.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/omapdrm/omap_gem_helpers.c 
b/drivers/staging/omapdrm/omap_gem_helpers.c
index 1b54110..ffb8cce 100644
--- a/drivers/staging/omapdrm/omap_gem_helpers.c
+++ b/drivers/staging/omapdrm/omap_gem_helpers.c
@@ -80,9 +80,9 @@ struct page **_drm_gem_get_pages(struct drm_gem_object *obj, 
gfp_t gfpmask)
return pages;
 
 fail:
-   while (i--) {
+   while (i--)
page_cache_release(pages[i]);
-   }
+
drm_free_large(pages);
return ERR_CAST(p);
 }
-- 
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 13/16] staging/omapdrm: Fix spacing coding style in omap_gem_helper.c

2012-11-14 Thread YAMANE Toshiaki
The following error fixed.
- ERROR: "foo ** bar" should be "foo **bar"

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/omapdrm/omap_gem_helpers.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/omapdrm/omap_gem_helpers.c 
b/drivers/staging/omapdrm/omap_gem_helpers.c
index f895363..1b54110 100644
--- a/drivers/staging/omapdrm/omap_gem_helpers.c
+++ b/drivers/staging/omapdrm/omap_gem_helpers.c
@@ -32,7 +32,7 @@
  * @obj: obj in question
  * @gfpmask: gfp mask of requested pages
  */
-struct page ** _drm_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask)
+struct page **_drm_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask)
 {
struct inode *inode;
struct address_space *mapping;
-- 
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 12/16] staging/omapdrm: Fix spacing coding style in omap_gem_dmabuf.c

2012-11-14 Thread YAMANE Toshiaki
The following errors fixed.
- ERROR: "foo * bar" should be "foo *bar"

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/omapdrm/omap_gem_dmabuf.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/omapdrm/omap_gem_dmabuf.c 
b/drivers/staging/omapdrm/omap_gem_dmabuf.c
index c6f3ef6..9a30206 100644
--- a/drivers/staging/omapdrm/omap_gem_dmabuf.c
+++ b/drivers/staging/omapdrm/omap_gem_dmabuf.c
@@ -191,13 +191,13 @@ struct dma_buf_ops omap_dmabuf_ops = {
.mmap = omap_gem_dmabuf_mmap,
 };
 
-struct dma_buf * omap_gem_prime_export(struct drm_device *dev,
+struct dma_buf *omap_gem_prime_export(struct drm_device *dev,
struct drm_gem_object *obj, int flags)
 {
return dma_buf_export(obj, &omap_dmabuf_ops, obj->size, 0600);
 }
 
-struct drm_gem_object * omap_gem_prime_import(struct drm_device *dev,
+struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev,
struct dma_buf *buffer)
 {
struct drm_gem_object *obj;
-- 
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 11/16] staging/omapdrm: Fix spacing coding style in omap_gem.c

2012-11-14 Thread YAMANE Toshiaki
The following errors fixed.
- ERROR: space prohibited after that '!' (ctx:BxW)

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/omapdrm/omap_gem.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/omapdrm/omap_gem.c 
b/drivers/staging/omapdrm/omap_gem.c
index e615871..c38992b 100644
--- a/drivers/staging/omapdrm/omap_gem.c
+++ b/drivers/staging/omapdrm/omap_gem.c
@@ -952,7 +952,7 @@ int omap_gem_put_pages(struct drm_gem_object *obj)
 void *omap_gem_vaddr(struct drm_gem_object *obj)
 {
struct omap_gem_object *omap_obj = to_omap_bo(obj);
-   WARN_ON(! mutex_is_locked(&obj->dev->struct_mutex));
+   WARN_ON(!mutex_is_locked(&obj->dev->struct_mutex));
if (!omap_obj->vaddr) {
struct page **pages;
int ret = get_pages(obj, &pages);
@@ -971,7 +971,7 @@ void omap_gem_describe(struct drm_gem_object *obj, struct 
seq_file *m)
struct omap_gem_object *omap_obj = to_omap_bo(obj);
uint64_t off = 0;
 
-   WARN_ON(! mutex_is_locked(&dev->struct_mutex));
+   WARN_ON(!mutex_is_locked(&dev->struct_mutex));
 
if (obj->map_list.map)
off = (uint64_t)obj->map_list.hash.key;
-- 
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 10/16] staging/omapdrm: Fix spacing coding style in omap_gem.c

2012-11-14 Thread YAMANE Toshiaki
The following warnings fixed.
- WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/omapdrm/omap_gem.c |   38 ++--
 1 file changed, 15 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/omapdrm/omap_gem.c 
b/drivers/staging/omapdrm/omap_gem.c
index 94c04a5..e615871 100644
--- a/drivers/staging/omapdrm/omap_gem.c
+++ b/drivers/staging/omapdrm/omap_gem.c
@@ -521,9 +521,8 @@ int omap_gem_fault(struct vm_area_struct *vma, struct 
vm_fault *vmf)
 
/* if a shmem backed object, make sure we have pages attached now */
ret = get_pages(obj, &pages);
-   if (ret) {
+   if (ret)
goto fail;
-   }
 
/* where should we do corresponding put_pages().. we are mapping
 * the original page, rather than thru a GART, so we can't rely
@@ -1146,9 +1145,8 @@ int omap_gem_op_sync(struct drm_gem_object *obj, enum 
omap_gem_op op)
struct omap_gem_sync_waiter *waiter =
kzalloc(sizeof(*waiter), GFP_KERNEL);
 
-   if (!waiter) {
+   if (!waiter)
return -ENOMEM;
-   }
 
waiter->omap_obj = omap_obj;
waiter->op = op;
@@ -1177,9 +1175,8 @@ int omap_gem_op_sync(struct drm_gem_object *obj, enum 
omap_gem_op op)
}
spin_unlock(&sync_lock);
 
-   if (waiter) {
+   if (waiter)
kfree(waiter);
-   }
}
return ret;
 }
@@ -1201,9 +1198,8 @@ int omap_gem_op_async(struct drm_gem_object *obj, enum 
omap_gem_op op,
struct omap_gem_sync_waiter *waiter =
kzalloc(sizeof(*waiter), GFP_ATOMIC);
 
-   if (!waiter) {
+   if (!waiter)
return -ENOMEM;
-   }
 
waiter->omap_obj = omap_obj;
waiter->op = op;
@@ -1285,9 +1281,8 @@ void omap_gem_free_object(struct drm_gem_object *obj)
 
list_del(&omap_obj->mm_list);
 
-   if (obj->map_list.map) {
+   if (obj->map_list.map)
drm_gem_free_mmap_offset(obj);
-   }
 
/* this means the object is still pinned.. which really should
 * not happen.  I think..
@@ -1296,9 +1291,9 @@ void omap_gem_free_object(struct drm_gem_object *obj)
 
/* don't free externally allocated backing memory */
if (!(omap_obj->flags & OMAP_BO_EXT_MEM)) {
-   if (omap_obj->pages) {
+   if (omap_obj->pages)
omap_gem_detach_pages(obj);
-   }
+
if (!is_shmem(obj)) {
dma_free_writecombine(dev->dev, obj->size,
omap_obj->vaddr, omap_obj->paddr);
@@ -1308,9 +1303,8 @@ void omap_gem_free_object(struct drm_gem_object *obj)
}
 
/* don't free externally allocated syncobj */
-   if (!(omap_obj->flags & OMAP_BO_EXT_SYNC)) {
+   if (!(omap_obj->flags & OMAP_BO_EXT_SYNC))
kfree(omap_obj->sync);
-   }
 
drm_gem_object_release(obj);
 
@@ -1395,9 +1389,9 @@ struct drm_gem_object *omap_gem_new(struct drm_device 
*dev,
 */
omap_obj->vaddr =  dma_alloc_writecombine(dev->dev, size,
&omap_obj->paddr, GFP_KERNEL);
-   if (omap_obj->vaddr) {
+   if (omap_obj->vaddr)
flags |= OMAP_BO_DMA;
-   }
+
}
 
omap_obj->flags = flags;
@@ -1407,22 +1401,20 @@ struct drm_gem_object *omap_gem_new(struct drm_device 
*dev,
omap_obj->height = gsize.tiled.height;
}
 
-   if (flags & (OMAP_BO_DMA|OMAP_BO_EXT_MEM)) {
+   if (flags & (OMAP_BO_DMA|OMAP_BO_EXT_MEM))
ret = drm_gem_private_object_init(dev, obj, size);
-   } else {
+   else
ret = drm_gem_object_init(dev, obj, size);
-   }
 
-   if (ret) {
+   if (ret)
goto fail;
-   }
 
return obj;
 
 fail:
-   if (obj) {
+   if (obj)
omap_gem_free_object(obj);
-   }
+
return NULL;
 }
 
-- 
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 09/16] staging/omapdrm: Fix spacing coding style in omap_gem.c

2012-11-14 Thread YAMANE Toshiaki
The following error fixed.
- ERROR: "foo ** bar" should be "foo **bar"

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/omapdrm/omap_gem.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/omapdrm/omap_gem.c 
b/drivers/staging/omapdrm/omap_gem.c
index 8a9b1ce..94c04a5 100644
--- a/drivers/staging/omapdrm/omap_gem.c
+++ b/drivers/staging/omapdrm/omap_gem.c
@@ -25,7 +25,7 @@
 #include "omap_dmm_tiler.h"
 
 /* remove these once drm core helpers are merged */
-struct page ** _drm_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask);
+struct page **_drm_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask);
 void _drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages,
bool dirty, bool accessed);
 int _drm_gem_create_mmap_offset_size(struct drm_gem_object *obj, size_t size);
-- 
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 08/16] staging/omapdrm: Fix spacing coding style in omap_fb.c

2012-11-14 Thread YAMANE Toshiaki
The following warnings fixed.
- WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/omapdrm/omap_fb.c |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/omapdrm/omap_fb.c 
b/drivers/staging/omapdrm/omap_fb.c
index 75d2ff1..09028e9 100644
--- a/drivers/staging/omapdrm/omap_fb.c
+++ b/drivers/staging/omapdrm/omap_fb.c
@@ -307,17 +307,16 @@ struct drm_connector *omap_framebuffer_get_next_connector(
struct list_head *connector_list = &dev->mode_config.connector_list;
struct drm_connector *connector = from;
 
-   if (!from) {
+   if (!from)
return list_first_entry(connector_list, typeof(*from), head);
-   }
 
list_for_each_entry_from(connector, connector_list, head) {
if (connector != from) {
struct drm_encoder *encoder = connector->encoder;
struct drm_crtc *crtc = encoder ? encoder->crtc : NULL;
-   if (crtc && crtc->fb == fb) {
+   if (crtc && crtc->fb == fb)
return connector;
-   }
+
}
}
 
@@ -466,8 +465,8 @@ struct drm_framebuffer *omap_framebuffer_init(struct 
drm_device *dev,
return fb;
 
 fail:
-   if (fb) {
+   if (fb)
omap_framebuffer_destroy(fb);
-   }
+
return ERR_PTR(ret);
 }
-- 
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 07/16] staging/omapdrm: Fix spacing coding style in omap_encoder.c

2012-11-14 Thread YAMANE Toshiaki
The following warnings fixed.
- WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/omapdrm/omap_encoder.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/omapdrm/omap_encoder.c 
b/drivers/staging/omapdrm/omap_encoder.c
index 31c735d..5341d5e 100644
--- a/drivers/staging/omapdrm/omap_encoder.c
+++ b/drivers/staging/omapdrm/omap_encoder.c
@@ -72,9 +72,9 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,
 
for (i = 0; i < priv->num_connectors; i++) {
struct drm_connector *connector = priv->connectors[i];
-   if (connector->encoder == encoder) {
+   if (connector->encoder == encoder)
omap_connector_mode_set(connector, mode);
-   }
+
}
 }
 
@@ -163,9 +163,8 @@ struct drm_encoder *omap_encoder_init(struct drm_device 
*dev,
return encoder;
 
 fail:
-   if (encoder) {
+   if (encoder)
omap_encoder_destroy(encoder);
-   }
 
return NULL;
 }
-- 
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 06/16] staging/omapdrm: Fix spacing coding style in omap_drv.h

2012-11-14 Thread YAMANE Toshiaki
The following warnings fixed.
- WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/omapdrm/omap_drv.h |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/omapdrm/omap_drv.h 
b/drivers/staging/omapdrm/omap_drv.h
index 8f41098..1d4aea5 100644
--- a/drivers/staging/omapdrm/omap_drv.h
+++ b/drivers/staging/omapdrm/omap_drv.h
@@ -218,17 +218,17 @@ static inline int objects_lookup(struct drm_device *dev,
 
for (i = 0; i < n; i++) {
bos[i] = drm_gem_object_lookup(dev, filp, handles[i]);
-   if (!bos[i]) {
+   if (!bos[i])
goto fail;
-   }
+
}
 
return 0;
 
 fail:
-   while (--i > 0) {
+   while (--i > 0)
drm_gem_object_unreference_unlocked(bos[i]);
-   }
+
return -ENOENT;
 }
 
-- 
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 05/16] staging/omapdrm: Fix spacing coding style in omap_drv.h

2012-11-14 Thread YAMANE Toshiaki
The following errors fixed.
- ERROR: "foo * bar" should be "foo *bar"

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/omapdrm/omap_drv.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/omapdrm/omap_drv.h 
b/drivers/staging/omapdrm/omap_drv.h
index 8f7c447..8f41098 100644
--- a/drivers/staging/omapdrm/omap_drv.h
+++ b/drivers/staging/omapdrm/omap_drv.h
@@ -191,9 +191,9 @@ size_t omap_gem_mmap_size(struct drm_gem_object *obj);
 int omap_gem_tiled_size(struct drm_gem_object *obj, uint16_t *w, uint16_t *h);
 int omap_gem_tiled_stride(struct drm_gem_object *obj, uint32_t orient);
 
-struct dma_buf * omap_gem_prime_export(struct drm_device *dev,
+struct dma_buf *omap_gem_prime_export(struct drm_device *dev,
struct drm_gem_object *obj, int flags);
-struct drm_gem_object * omap_gem_prime_import(struct drm_device *dev,
+struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev,
struct dma_buf *buffer);
 
 static inline int align_pitch(int pitch, int width, int bpp)
-- 
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 04/16] staging/omapdrm: Fix spacing coding style in omap_drv.c

2012-11-14 Thread YAMANE Toshiaki
The following warnings fixed.
- WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/omapdrm/omap_drv.c |   36 ++--
 1 file changed, 14 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/omapdrm/omap_drv.c 
b/drivers/staging/omapdrm/omap_drv.c
index 6ae2f76..d4823fd 100644
--- a/drivers/staging/omapdrm/omap_drv.c
+++ b/drivers/staging/omapdrm/omap_drv.c
@@ -51,9 +51,8 @@ static void omap_fb_output_poll_changed(struct drm_device 
*dev)
 {
struct omap_drm_private *priv = dev->dev_private;
DBG("dev=%p", dev);
-   if (priv->fbdev) {
+   if (priv->fbdev)
drm_fb_helper_hotplug_event(priv->fbdev);
-   }
 }
 
 static const struct drm_mode_config_funcs omap_mode_config_funcs = {
@@ -85,9 +84,9 @@ static int omap_drm_notifier(struct notifier_block *nb,
case OMAP_DSS_HOTPLUG_DISCONNECT: {
struct drm_device *dev = drm_device;
DBG("hotplug event: evt=%d, dev=%p", evt, dev);
-   if (dev) {
+   if (dev)
drm_sysfs_hotplug_event(dev);
-   }
+
return NOTIFY_OK;
}
default:  /* don't care about other events for now */
@@ -211,9 +210,9 @@ static int create_crtc(struct drm_device *dev, struct 
omap_overlay *ovl,
struct drm_encoder *encoder =
omap_connector_attached_encoder(
priv->connectors[*j]);
-   if (encoder) {
+   if (encoder)
mgr = omap_encoder_get_manager(encoder);
-   }
+
}
(*j)++;
}
@@ -232,9 +231,9 @@ static int create_crtc(struct drm_device *dev, struct 
omap_overlay *ovl,
struct drm_encoder *encoder =
omap_connector_attached_encoder(
priv->connectors[idx]);
-   if (encoder) {
+   if (encoder)
mgr = omap_encoder_get_manager(encoder);
-   }
+
}
(*j)++;
}
@@ -353,9 +352,8 @@ static int omap_modeset_init(struct drm_device *dev)
 */
int max_overlays = min(omap_dss_get_num_overlays(), num_crtc);
 
-   for (i = 0; i < omap_dss_get_num_overlay_managers(); i++) {
+   for (i = 0; i < omap_dss_get_num_overlay_managers(); i++)
create_encoder(dev, omap_dss_get_overlay_manager(i));
-   }
 
for_each_dss_dev(dssdev) {
create_connector(dev, dssdev);
@@ -468,15 +466,13 @@ static int ioctl_gem_cpu_prep(struct drm_device *dev, 
void *data,
VERB("%p:%p: handle=%d, op=%x", dev, file_priv, args->handle, args->op);
 
obj = drm_gem_object_lookup(dev, file_priv, args->handle);
-   if (!obj) {
+   if (!obj)
return -ENOENT;
-   }
 
ret = omap_gem_op_sync(obj, args->op);
 
-   if (!ret) {
+   if (!ret)
ret = omap_gem_op_start(obj, args->op);
-   }
 
drm_gem_object_unreference_unlocked(obj);
 
@@ -493,16 +489,14 @@ static int ioctl_gem_cpu_fini(struct drm_device *dev, 
void *data,
VERB("%p:%p: handle=%d", dev, file_priv, args->handle);
 
obj = drm_gem_object_lookup(dev, file_priv, args->handle);
-   if (!obj) {
+   if (!obj)
return -ENOENT;
-   }
 
/* XXX flushy, flushy */
ret = 0;
 
-   if (!ret) {
+   if (!ret)
ret = omap_gem_op_finish(obj, args->op);
-   }
 
drm_gem_object_unreference_unlocked(obj);
 
@@ -519,9 +513,8 @@ static int ioctl_gem_info(struct drm_device *dev, void 
*data,
DBG("%p:%p: handle=%d", dev, file_priv, args->handle);
 
obj = drm_gem_object_lookup(dev, file_priv, args->handle);
-   if (!obj) {
+   if (!obj)
return -ENOENT;
-   }
 
args->size = omap_gem_mmap_size(obj);
args->offset = omap_gem_mmap_offset(obj);
@@ -595,9 +588,8 @@ static int dev_load(struct drm_device *dev, unsigned long 
flags)
drm_kms_helper_poll_init(dev);
 
ret = drm_vblank_init(dev, priv->num_crtcs);
-   if (ret) {
+   if (ret)
dev_warn(dev->dev, "could not init vblank\n");
-   }
 
return 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 03/16] staging/omapdrm: Fix spacing coding style in omap_crtc.c

2012-11-14 Thread YAMANE Toshiaki
The following warning fixed.
- WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/omapdrm/omap_crtc.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/omapdrm/omap_crtc.c 
b/drivers/staging/omapdrm/omap_crtc.c
index cbda7e0..d87bd84 100644
--- a/drivers/staging/omapdrm/omap_crtc.c
+++ b/drivers/staging/omapdrm/omap_crtc.c
@@ -263,8 +263,8 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
return crtc;
 
 fail:
-   if (crtc) {
+   if (crtc)
omap_crtc_destroy(crtc);
-   }
+
return NULL;
 }
-- 
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 02/16] staging/omapdrm: remove the unnecessary initialization of a local variable in omap_crtc.c

2012-11-14 Thread YAMANE Toshiaki
The following error fixed.
- ERROR: do not initialise statics to 0 or NULL

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/omapdrm/omap_crtc.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/omapdrm/omap_crtc.c 
b/drivers/staging/omapdrm/omap_crtc.c
index 5249223..cbda7e0 100644
--- a/drivers/staging/omapdrm/omap_crtc.c
+++ b/drivers/staging/omapdrm/omap_crtc.c
@@ -114,7 +114,7 @@ static void omap_crtc_load_lut(struct drm_crtc *crtc)
 
 static void vblank_cb(void *arg)
 {
-   static uint32_t sequence = 0;
+   static uint32_t sequence;
struct drm_crtc *crtc = arg;
struct drm_device *dev = crtc->dev;
struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
-- 
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 01/16] staging/omapdrm: Fix spacing coding style in omap_connector.c

2012-11-14 Thread YAMANE Toshiaki
The following warnings fixed.
- WARNING: braces {} are not necessary for any arm of this statement
- WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/omapdrm/omap_connector.c |8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/omapdrm/omap_connector.c 
b/drivers/staging/omapdrm/omap_connector.c
index 38be186..91edb3f 100644
--- a/drivers/staging/omapdrm/omap_connector.c
+++ b/drivers/staging/omapdrm/omap_connector.c
@@ -146,11 +146,10 @@ enum drm_connector_status omap_connector_detect(
enum drm_connector_status ret;
 
if (dssdrv->detect) {
-   if (dssdrv->detect(dssdev)) {
+   if (dssdrv->detect(dssdev))
ret = connector_status_connected;
-   } else {
+   else
ret = connector_status_disconnected;
-   }
} else {
ret = connector_status_unknown;
}
@@ -383,9 +382,8 @@ struct drm_connector *omap_connector_init(struct drm_device 
*dev,
return connector;
 
 fail:
-   if (connector) {
+   if (connector)
omap_connector_destroy(connector);
-   }
 
return NULL;
 }
-- 
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 3/4] staging/serqt_usb2: refactor qt_open() in serqt_usb2.c

2012-11-09 Thread YAMANE Toshiaki
Modified to eliminate the deep nesting.

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/serqt_usb2/serqt_usb2.c |   51 ---
 1 file changed, 27 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c 
b/drivers/staging/serqt_usb2/serqt_usb2.c
index 0395bdf..4c475ed 100644
--- a/drivers/staging/serqt_usb2/serqt_usb2.c
+++ b/drivers/staging/serqt_usb2/serqt_usb2.c
@@ -840,6 +840,31 @@ static void qt_release(struct usb_serial *serial)
 
 }
 
+static void qt_submit_urb_from_open(struct usb_serial *serial,
+   struct usb_serial_port *port)
+{
+   int result;
+   struct usb_serial_port *port0 = serial->port[0];
+
+   /* set up interrupt urb */
+   usb_fill_int_urb(port0->interrupt_in_urb,
+serial->dev,
+usb_rcvintpipe(serial->dev,
+   port0->interrupt_in_endpointAddress),
+port0->interrupt_in_buffer,
+port0->interrupt_in_urb->transfer_buffer_length,
+qt_interrupt_callback, serial,
+port0->interrupt_in_urb->interval);
+
+   result = usb_submit_urb(port0->interrupt_in_urb,
+   GFP_KERNEL);
+   if (result) {
+   dev_err(&port->dev,
+   "%s - Error %d submitting interrupt urb\n",
+   __func__, result);
+   }
+}
+
 static int qt_open(struct tty_struct *tty,
   struct usb_serial_port *port)
 {
@@ -900,30 +925,8 @@ static int qt_open(struct tty_struct *tty,
 
/*  Check to see if we've set up our endpoint info yet */
if (port0->open_ports == 1) {
-   if (serial->port[0]->interrupt_in_buffer == NULL) {
-   /* set up interrupt urb */
-   usb_fill_int_urb(serial->port[0]->interrupt_in_urb,
-serial->dev,
-usb_rcvintpipe(serial->dev,
-   
serial->port[0]->interrupt_in_endpointAddress),
-serial->port[0]->interrupt_in_buffer,
-serial->port[0]->
-
interrupt_in_urb->transfer_buffer_length,
-qt_interrupt_callback, serial,
-serial->port[0]->
-interrupt_in_urb->interval);
-
-   result =
-   usb_submit_urb(serial->port[0]->interrupt_in_urb,
-  GFP_KERNEL);
-   if (result) {
-   dev_err(&port->dev,
-   "%s - Error %d submitting "
-   "interrupt urb\n", __func__, result);
-   }
-
-   }
-
+   if (serial->port[0]->interrupt_in_buffer == NULL)
+   qt_submit_urb_from_open(serial, port);
}
 
dev_dbg(&port->dev, "port number is %d\n", port->number);
-- 
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 2/4] staging/serqt_usb2: refactor qt_read_bulk_callback() in serqt_usb2.c

2012-11-09 Thread YAMANE Toshiaki
Modified to eliminate the deep nesting and redundant description.

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/serqt_usb2/serqt_usb2.c |  147 +--
 1 file changed, 80 insertions(+), 67 deletions(-)

diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c 
b/drivers/staging/serqt_usb2/serqt_usb2.c
index 9bc8923..0395bdf 100644
--- a/drivers/staging/serqt_usb2/serqt_usb2.c
+++ b/drivers/staging/serqt_usb2/serqt_usb2.c
@@ -291,22 +291,89 @@ static void qt_interrupt_callback(struct urb *urb)
/* FIXME */
 }
 
+static int qt_status_change(unsigned int limit,
+   unsigned char *data,
+   int i,
+   struct quatech_port *qt_port,
+   struct usb_serial_port *port)
+{
+   void (*fn)(struct quatech_port *, unsigned char);
+
+   if (0x00 == data[i + 2]) {
+   dev_dbg(&port->dev, "Line status status.\n");
+   fn = ProcessLineStatus;
+   } else {
+   dev_dbg(&port->dev, "Modem status status.\n");
+   fn = ProcessModemStatus;
+   }
+
+   if (i > limit) {
+   dev_dbg(&port->dev,
+   "Illegal escape seuences in received data\n");
+   return 0;
+   }
+
+   (*fn)(qt_port, data[i + 3]);
+
+   return 1;
+}
+
+static void qt_status_change_check(struct tty_struct *tty,
+  struct urb *urb,
+  struct quatech_port *qt_port,
+  struct usb_serial_port *port)
+{
+   int flag, i;
+   unsigned char *data = urb->transfer_buffer;
+   unsigned int RxCount = urb->actual_length;
+
+   for (i = 0; i < RxCount; ++i) {
+   /* Look ahead code here */
+   if ((i <= (RxCount - 3)) && (data[i] == 0x1b)
+   && (data[i + 1] == 0x1b)) {
+   flag = 0;
+   switch (data[i + 2]) {
+   case 0x00:
+   case 0x01:
+   flag = qt_status_change((RxCount - 4), data, i,
+   qt_port, port);
+   if (flag == 1)
+   i += 3;
+   break;
+
+   case 0xff:
+   dev_dbg(&port->dev, "No status sequence.\n");
+
+   ProcessRxChar(tty, port, data[i]);
+   ProcessRxChar(tty, port, data[i + 1]);
+
+   i += 2;
+   break;
+   }
+   if (flag == 1)
+   continue;
+   }
+
+   if (tty && urb->actual_length)
+   tty_insert_flip_char(tty, data[i], TTY_NORMAL);
+
+   }
+   tty_flip_buffer_push(tty);
+}
+
 static void qt_read_bulk_callback(struct urb *urb)
 {
 
struct usb_serial_port *port = urb->context;
struct usb_serial *serial = get_usb_serial(port, __func__);
struct quatech_port *qt_port = qt_get_port_private(port);
-   unsigned char *data;
struct tty_struct *tty;
-   unsigned int index;
-   unsigned int RxCount;
-   int i, result;
-   int flag, flag_data;
+   int result;
 
if (urb->status) {
qt_port->ReadBulkStopped = 1;
-   dev_dbg(&urb->dev->dev, "%s - nonzero write bulk status 
received: %d\n",
+   dev_dbg(&urb->dev->dev,
+   "%s - nonzero write bulk status received: %d\n",
__func__, urb->status);
return;
}
@@ -315,13 +382,6 @@ static void qt_read_bulk_callback(struct urb *urb)
if (!tty)
return;
 
-   data = urb->transfer_buffer;
-
-   RxCount = urb->actual_length;
-
-   /* index = MINOR(port->tty->device) - serial->minor; */
-   index = tty->index - serial->minor;
-
dev_dbg(&port->dev,
"%s - port->RxHolding = %d\n", __func__, qt_port->RxHolding);
 
@@ -354,62 +414,14 @@ static void qt_read_bulk_callback(struct urb *urb)
if (urb->status) {
qt_port->ReadBulkStopped = 1;
 
-   dev_dbg(&port->dev, "%s - nonzero read bulk status received: 
%d\n",
+   dev_dbg(&port->dev,
+   "%s - nonzero read bulk status received: %d\n",
__func__, urb->status);
goto exit;
}
 
-   if (RxCount) {
-   flag_data = 0;
-   for (i = 0; i < RxCount; ++i) {
-

[PATCH 1/4] staging/serqt_usb2: fixed line over issue in serqt_usb2.c

2012-11-09 Thread YAMANE Toshiaki
Fixed a description of the procedure call dev_dbg().

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/serqt_usb2/serqt_usb2.c |   59 +--
 1 file changed, 40 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c 
b/drivers/staging/serqt_usb2/serqt_usb2.c
index 099bc69..9bc8923 100644
--- a/drivers/staging/serqt_usb2/serqt_usb2.c
+++ b/drivers/staging/serqt_usb2/serqt_usb2.c
@@ -272,7 +272,8 @@ static void qt_write_bulk_callback(struct urb *urb)
status = urb->status;
 
if (status) {
-   dev_dbg(&urb->dev->dev, "nonzero write bulk status 
received:%d\n", status);
+   dev_dbg(&urb->dev->dev,
+   "nonzero write bulk status received:%d\n", status);
return;
}
 
@@ -321,7 +322,8 @@ static void qt_read_bulk_callback(struct urb *urb)
/* index = MINOR(port->tty->device) - serial->minor; */
index = tty->index - serial->minor;
 
-   dev_dbg(&port->dev, "%s - port->RxHolding = %d\n", __func__, 
qt_port->RxHolding);
+   dev_dbg(&port->dev,
+   "%s - port->RxHolding = %d\n", __func__, qt_port->RxHolding);
 
if (port_paranoia_check(port, __func__) != 0) {
qt_port->ReadBulkStopped = 1;
@@ -333,7 +335,8 @@ static void qt_read_bulk_callback(struct urb *urb)
 
if (qt_port->closePending == 1) {
/* Were closing , stop reading */
-   dev_dbg(&port->dev, "%s - (qt_port->closepending == 1\n", 
__func__);
+   dev_dbg(&port->dev,
+   "%s - (qt_port->closepending == 1\n", __func__);
qt_port->ReadBulkStopped = 1;
goto exit;
}
@@ -912,10 +915,14 @@ static int qt_open(struct tty_struct *tty,
 
dev_dbg(&port->dev, "port number is %d\n", port->number);
dev_dbg(&port->dev, "serial number is %d\n", port->serial->minor);
-   dev_dbg(&port->dev, "Bulkin endpoint is %d\n", 
port->bulk_in_endpointAddress);
-   dev_dbg(&port->dev, "BulkOut endpoint is %d\n", 
port->bulk_out_endpointAddress);
-   dev_dbg(&port->dev, "Interrupt endpoint is %d\n", 
port->interrupt_in_endpointAddress);
-   dev_dbg(&port->dev, "port's number in the device is %d\n", 
quatech_port->port_num);
+   dev_dbg(&port->dev,
+   "Bulkin endpoint is %d\n", port->bulk_in_endpointAddress);
+   dev_dbg(&port->dev,
+   "BulkOut endpoint is %d\n", port->bulk_out_endpointAddress);
+   dev_dbg(&port->dev, "Interrupt endpoint is %d\n",
+   port->interrupt_in_endpointAddress);
+   dev_dbg(&port->dev, "port's number in the device is %d\n",
+   quatech_port->port_num);
quatech_port->read_urb = port->read_urb;
 
/* set up our bulk in urb */
@@ -928,7 +935,8 @@ static int qt_open(struct tty_struct *tty,
  quatech_port->read_urb->transfer_buffer_length,
  qt_read_bulk_callback, quatech_port);
 
-   dev_dbg(&port->dev, "qt_open: bulkin endpoint is %d\n", 
port->bulk_in_endpointAddress);
+   dev_dbg(&port->dev, "qt_open: bulkin endpoint is %d\n",
+   port->bulk_in_endpointAddress);
quatech_port->read_urb_busy = true;
result = usb_submit_urb(quatech_port->read_urb, GFP_KERNEL);
if (result) {
@@ -1021,15 +1029,18 @@ static void qt_close(struct usb_serial_port *port)
/* Close uart channel */
status = qt_close_channel(serial, index);
if (status < 0)
-   dev_dbg(&port->dev, "%s - port %d qt_close_channel failed.\n", 
__func__, port->number);
+   dev_dbg(&port->dev,
+   "%s - port %d qt_close_channel failed.\n",
+   __func__, port->number);
 
port0->open_ports--;
 
-   dev_dbg(&port->dev, "qt_num_open_ports in close%d:in port%d\n", 
port0->open_ports, port->number);
+   dev_dbg(&port->dev, "qt_num_open_ports in close%d:in port%d\n",
+   port0->open_ports, port->number);
 
if (port0->open_ports == 0) {
if (serial->port[0]->interrupt_in_urb) {
-   dev_dbg(&port->dev, "%s", "Shutdown 
interrupt_in_urb\n");
+   dev_dbg(&port->dev, "Shutdown interrupt_in_urb\n");
usb_kill_urb(serial->port[0]->interrupt_in_urb);
}
 

[PATCH] staging/vme: Use dev_ or pr_ printks in devices/vme_user.c

2012-11-08 Thread YAMANE Toshiaki
fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then 
pr_info(...  to printk(KERN_INFO ...
- WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then 
pr_debug(...  to printk(KERN_DEBUG ...
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then 
pr_warn(...  to printk(KERN_WARNING ...

and add pr_fmt.

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/vme/devices/vme_user.c |   73 +++-
 1 file changed, 34 insertions(+), 39 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_user.c 
b/drivers/staging/vme/devices/vme_user.c
index c3f94f3..e3731eb 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -15,6 +15,8 @@
  * option) any later version.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include 
 #include 
 #include 
@@ -170,7 +172,7 @@ static int vme_user_open(struct inode *inode, struct file 
*file)
mutex_lock(&image[minor].mutex);
/* Allow device to be opened if a resource is needed and allocated. */
if (minor < CONTROL_MINOR && image[minor].resource == NULL) {
-   printk(KERN_ERR "No resources allocated for device\n");
+   pr_err("No resources allocated for device\n");
err = -EINVAL;
goto err_res;
}
@@ -225,13 +227,13 @@ static ssize_t resource_to_user(int minor, char __user 
*buf, size_t count,
(unsigned long)copied);
if (retval != 0) {
copied = (copied - retval);
-   printk(KERN_INFO "User copy failed\n");
+   pr_info("User copy failed\n");
return -EINVAL;
}
 
} else {
/* XXX Need to write this */
-   printk(KERN_INFO "Currently don't support large transfers\n");
+   pr_info("Currently don't support large transfers\n");
/* Map in pages from userspace */
 
/* Call vme_master_read to do the transfer */
@@ -265,7 +267,7 @@ static ssize_t resource_from_user(unsigned int minor, const 
char __user *buf,
image[minor].kern_buf, copied, *ppos);
} else {
/* XXX Need to write this */
-   printk(KERN_INFO "Currently don't support large transfers\n");
+   pr_info("Currently don't support large transfers\n");
/* Map in pages from userspace */
 
/* Call vme_master_write to do the transfer */
@@ -286,7 +288,7 @@ static ssize_t buffer_to_user(unsigned int minor, char 
__user *buf,
retval = __copy_to_user(buf, image_ptr, (unsigned long)count);
if (retval != 0) {
retval = (count - retval);
-   printk(KERN_WARNING "Partial copy to userspace\n");
+   pr_warn("Partial copy to userspace\n");
} else
retval = count;
 
@@ -305,7 +307,7 @@ static ssize_t buffer_from_user(unsigned int minor, const 
char __user *buf,
retval = __copy_from_user(image_ptr, buf, (unsigned long)count);
if (retval != 0) {
retval = (count - retval);
-   printk(KERN_WARNING "Partial copy to userspace\n");
+   pr_warn("Partial copy to userspace\n");
} else
retval = count;
 
@@ -476,7 +478,7 @@ static int vme_user_ioctl(struct inode *inode, struct file 
*file,
copied = copy_from_user(&irq_req, argp,
sizeof(struct vme_irq_id));
if (copied != 0) {
-   printk(KERN_WARNING "Partial copy from 
userspace\n");
+   pr_warn("Partial copy from userspace\n");
return -EFAULT;
}
 
@@ -503,8 +505,7 @@ static int vme_user_ioctl(struct inode *inode, struct file 
*file,
copied = copy_to_user(argp, &master,
sizeof(struct vme_master));
if (copied != 0) {
-   printk(KERN_WARNING "Partial copy to "
-   "userspace\n");
+   pr_warn("Partial copy to userspace\n");
return -EFAULT;
}
 
@@ -515,8 +516,7 @@ static int vme_user_ioctl(struct inode *inode, struct file 
*file,
 
copied = copy_from_user(&master, argp, sizeof(master));
   

[PATCH] staging/media: Use pr_ printks in lirc/lirc_serial.c

2012-11-08 Thread YAMANE Toshiaki
fixed below checkpatch warnings.
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then 
pr_warn(...  to printk(KERN_WARNING ...
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then 
pr_info(...  to printk(KERN_INFO ...

and add pr_fmt.

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/lirc/lirc_serial.c |   70 +-
 1 file changed, 29 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_serial.c 
b/drivers/staging/media/lirc/lirc_serial.c
index 97ef670..89e2820 100644
--- a/drivers/staging/media/lirc/lirc_serial.c
+++ b/drivers/staging/media/lirc/lirc_serial.c
@@ -48,6 +48,8 @@
  * Steve Davies   July 2001
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include 
 #include 
 #include 
@@ -667,8 +669,7 @@ static irqreturn_t irq_handler(int i, void *blah)
counter++;
status = sinp(UART_MSR);
if (counter > RS_ISR_PASS_LIMIT) {
-   printk(KERN_WARNING LIRC_DRIVER_NAME ": AI: "
-  "We're caught!\n");
+   pr_warn("AI: We're caught!\n");
break;
}
if ((status & hardware[type].signal_pin_change)
@@ -703,11 +704,10 @@ static irqreturn_t irq_handler(int i, void *blah)
dcd = (status & hardware[type].signal_pin) ? 1 : 0;
 
if (dcd == last_dcd) {
-   printk(KERN_WARNING LIRC_DRIVER_NAME
-   ": ignoring spike: %d %d %lx %lx %lx %lx\n",
-   dcd, sense,
-   tv.tv_sec, lasttv.tv_sec,
-   tv.tv_usec, lasttv.tv_usec);
+   pr_warn("ignoring spike: %d %d %lx %lx %lx 
%lx\n",
+   dcd, sense,
+   tv.tv_sec, lasttv.tv_sec,
+   tv.tv_usec, lasttv.tv_usec);
continue;
}
 
@@ -715,25 +715,20 @@ static irqreturn_t irq_handler(int i, void *blah)
if (tv.tv_sec < lasttv.tv_sec ||
(tv.tv_sec == lasttv.tv_sec &&
 tv.tv_usec < lasttv.tv_usec)) {
-   printk(KERN_WARNING LIRC_DRIVER_NAME
-  ": AI: your clock just jumped "
-  "backwards\n");
-   printk(KERN_WARNING LIRC_DRIVER_NAME
-  ": %d %d %lx %lx %lx %lx\n",
-  dcd, sense,
-  tv.tv_sec, lasttv.tv_sec,
-  tv.tv_usec, lasttv.tv_usec);
+   pr_warn("AI: your clock just jumped 
backwards\n");
+   pr_warn("%d %d %lx %lx %lx %lx\n",
+   dcd, sense,
+   tv.tv_sec, lasttv.tv_sec,
+   tv.tv_usec, lasttv.tv_usec);
data = PULSE_MASK;
} else if (deltv > 15) {
data = PULSE_MASK; /* really long time */
if (!(dcd^sense)) {
/* sanity check */
-   printk(KERN_WARNING LIRC_DRIVER_NAME
-  ": AI: "
-  "%d %d %lx %lx %lx %lx\n",
-  dcd, sense,
-  tv.tv_sec, lasttv.tv_sec,
-  tv.tv_usec, lasttv.tv_usec);
+   pr_warn("AI: %d %d %lx %lx %lx 
%lx\n",
+   dcd, sense,
+   tv.tv_sec, lasttv.tv_sec,
+   tv.tv_usec, lasttv.tv_usec);
/*
 * detecting pulse while this
 * MUST be a space!
@@ -776,8 +771,7 @@ static int hardware_init_port(void)
soutp(UART_IER, scratch);
if (scratch2 != 0 || scratch3 != 0x0f) {
/* we fail, there's nothing here */
-   printk(KERN_ERR LIRC_DRIVER_NAME ": port existence test "
- 

[PATCH] staging/media: Use dev_ or pr_ printks in lirc/lirc_imon.c

2012-11-08 Thread YAMANE Toshiaki
fixed below checkpatch warnings.
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then 
pr_info(...  to printk(KERN_INFO ...
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...

and add pr_fmt.

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/lirc/lirc_imon.c |   28 +---
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_imon.c 
b/drivers/staging/media/lirc/lirc_imon.c
index 2944fde..343c622 100644
--- a/drivers/staging/media/lirc/lirc_imon.c
+++ b/drivers/staging/media/lirc/lirc_imon.c
@@ -20,6 +20,8 @@
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include 
 #include 
 #include 
@@ -205,12 +207,12 @@ static void deregister_from_lirc(struct imon_context 
*context)
 
retval = lirc_unregister_driver(minor);
if (retval)
-   printk(KERN_ERR KBUILD_MODNAME
-  ": %s: unable to deregister from lirc(%d)",
-  __func__, retval);
+   dev_err(&context->usbdev->dev,
+   ": %s: unable to deregister from lirc(%d)",
+   __func__, retval);
else
-   printk(KERN_INFO MOD_NAME ": Deregistered iMON driver "
-  "(minor:%d)\n", minor);
+   dev_info(&context->usbdev->dev,
+"Deregistered iMON driver (minor:%d)\n", minor);
 
 }
 
@@ -231,8 +233,7 @@ static int display_open(struct inode *inode, struct file 
*file)
subminor = iminor(inode);
interface = usb_find_interface(&imon_driver, subminor);
if (!interface) {
-   printk(KERN_ERR KBUILD_MODNAME
-  ": %s: could not find interface for minor %d\n",
+   pr_err("%s: could not find interface for minor %d\n",
   __func__, subminor);
retval = -ENODEV;
goto exit;
@@ -282,8 +283,7 @@ static int display_close(struct inode *inode, struct file 
*file)
context = file->private_data;
 
if (!context) {
-   printk(KERN_ERR KBUILD_MODNAME
-  "%s: no context for device\n", __func__);
+   pr_err("%s: no context for device\n", __func__);
return -ENODEV;
}
 
@@ -391,8 +391,7 @@ static ssize_t vfd_write(struct file *file, const char 
__user *buf,
 
context = file->private_data;
if (!context) {
-   printk(KERN_ERR KBUILD_MODNAME
-  "%s: no context for device\n", __func__);
+   pr_err("%s: no context for device\n", __func__);
return -ENODEV;
}
 
@@ -521,8 +520,7 @@ static void ir_close(void *data)
 
context = (struct imon_context *)data;
if (!context) {
-   printk(KERN_ERR KBUILD_MODNAME
-  "%s: no context for device\n", __func__);
+   pr_err("%s: no context for device\n", __func__);
return;
}
 
@@ -1009,8 +1007,8 @@ static void imon_disconnect(struct usb_interface 
*interface)
 
mutex_unlock(&driver_lock);
 
-   printk(KERN_INFO "%s: iMON device (intf%d) disconnected\n",
-  __func__, ifnum);
+   dev_info(&interface->dev, "%s: iMON device (intf%d) disconnected\n",
+__func__, ifnum);
 }
 
 static int imon_suspend(struct usb_interface *intf, pm_message_t message)
-- 
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/media: Use pr_ printks in lirc/lirc_parallel.c

2012-11-08 Thread YAMANE Toshiaki
fixed below checkpatch warnings.
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then 
pr_warn(...  to printk(KERN_WARNING ...
- WARNING: Prefer netdev_notice(netdev, ... then dev_notice(dev, ... then 
pr_notice(...  to printk(KERN_NOTICE ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then 
pr_info(...  to printk(KERN_INFO ...

and add pr_fmt.

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/lirc/lirc_parallel.c |   49 +++-
 1 file changed, 19 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_parallel.c 
b/drivers/staging/media/lirc/lirc_parallel.c
index dd2bca7..139920c 100644
--- a/drivers/staging/media/lirc/lirc_parallel.c
+++ b/drivers/staging/media/lirc/lirc_parallel.c
@@ -22,6 +22,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 /*** Includes ***/
 
 #include 
@@ -115,8 +117,7 @@ static void out(int offset, int value)
parport_write_control(pport, value);
break;
case LIRC_LP_STATUS:
-   printk(KERN_INFO "%s: attempt to write to status register\n",
-  LIRC_DRIVER_NAME);
+   pr_info("attempt to write to status register\n");
break;
}
 }
@@ -166,27 +167,23 @@ static unsigned int init_lirc_timer(void)
if (default_timer == 0) {
/* autodetect timer */
newtimer = (100*count)/timeelapsed;
-   printk(KERN_INFO "%s: %u Hz timer detected\n",
-  LIRC_DRIVER_NAME, newtimer);
+   pr_info("%u Hz timer detected\n", newtimer);
return newtimer;
}  else {
newtimer = (100*count)/timeelapsed;
if (abs(newtimer - default_timer) > default_timer/10) {
/* bad timer */
-   printk(KERN_NOTICE "%s: bad timer: %u Hz\n",
-  LIRC_DRIVER_NAME, newtimer);
-   printk(KERN_NOTICE "%s: using default timer: "
-  "%u Hz\n",
-  LIRC_DRIVER_NAME, default_timer);
+   pr_notice("bad timer: %u Hz\n", newtimer);
+   pr_notice("using default timer: %u Hz\n",
+ default_timer);
return default_timer;
} else {
-   printk(KERN_INFO "%s: %u Hz timer detected\n",
-  LIRC_DRIVER_NAME, newtimer);
+   pr_info("%u Hz timer detected\n", newtimer);
return newtimer; /* use detected value */
}
}
} else {
-   printk(KERN_NOTICE "%s: no timer detected\n", LIRC_DRIVER_NAME);
+   pr_notice("no timer detected\n");
return 0;
}
 }
@@ -194,13 +191,10 @@ static unsigned int init_lirc_timer(void)
 static int lirc_claim(void)
 {
if (parport_claim(ppdevice) != 0) {
-   printk(KERN_WARNING "%s: could not claim port\n",
-  LIRC_DRIVER_NAME);
-   printk(KERN_WARNING "%s: waiting for port becoming available"
-  "\n", LIRC_DRIVER_NAME);
+   pr_warn("could not claim port\n");
+   pr_warn("waiting for port becoming available\n");
if (parport_claim_or_block(ppdevice) < 0) {
-   printk(KERN_NOTICE "%s: could not claim port, giving"
-  " up\n", LIRC_DRIVER_NAME);
+   pr_notice("could not claim port, giving up\n");
return 0;
}
}
@@ -219,7 +213,7 @@ static void rbuf_write(int signal)
if (nwptr == rptr) {
/* no new signals will be accepted */
lost_irqs++;
-   printk(KERN_NOTICE "%s: buffer overrun\n", LIRC_DRIVER_NAME);
+   pr_notice("buffer overrun\n");
return;
}
rbuf[wptr] = signal;
@@ -290,7 +284,7 @@ static void irq_handler(void *blah)
if (signal > timeout
|| (check_pselecd && (in(1) & LP_PSELECD))) {
signal = 0;
-   printk(KERN_NOTICE "%s: timeout\n", LIRC_DRIVER_NAME);
+   pr_notice("timeout\n");
break;
}
} while (lirc_get_signal())

[PATCH] staging/media: Use pr_ printks in lirc/lirc_bt829.c

2012-11-08 Thread YAMANE Toshiaki
fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then 
pr_info(...  to printk(KERN_INFO ...

and add pr_fmt.

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/lirc/lirc_bt829.c |   15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_bt829.c 
b/drivers/staging/media/lirc/lirc_bt829.c
index 951007a..4a3b1f5 100644
--- a/drivers/staging/media/lirc/lirc_bt829.c
+++ b/drivers/staging/media/lirc/lirc_bt829.c
@@ -18,6 +18,8 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include 
 #include 
 #include 
@@ -72,20 +74,19 @@ static struct pci_dev *do_pci_probe(void)
my_dev = pci_get_device(PCI_VENDOR_ID_ATI,
PCI_DEVICE_ID_ATI_264VT, NULL);
if (my_dev) {
-   printk(KERN_ERR DRIVER_NAME ": Using device: %s\n",
-  pci_name(my_dev));
+   pr_err("Using device: %s\n", pci_name(my_dev));
pci_addr_phys = 0;
if (my_dev->resource[0].flags & IORESOURCE_MEM) {
pci_addr_phys = my_dev->resource[0].start;
-   printk(KERN_INFO DRIVER_NAME ": memory at 0x%08X\n",
+   pr_info("memory at 0x%08X\n",
(unsigned int)pci_addr_phys);
}
if (pci_addr_phys == 0) {
-   printk(KERN_ERR DRIVER_NAME ": no memory resource ?\n");
+   pr_err("no memory resource ?\n");
return NULL;
}
} else {
-   printk(KERN_ERR DRIVER_NAME ": pci_probe failed\n");
+   pr_err("pci_probe failed\n");
return NULL;
}
return my_dev;
@@ -140,7 +141,7 @@ int init_module(void)
 
atir_minor = lirc_register_driver(&atir_driver);
if (atir_minor < 0) {
-   printk(KERN_ERR DRIVER_NAME ": failed to register driver!\n");
+   pr_err("failed to register driver!\n");
return atir_minor;
}
dprintk("driver is registered on minor %d\n", atir_minor);
@@ -159,7 +160,7 @@ static int atir_init_start(void)
 {
pci_addr_lin = ioremap(pci_addr_phys + DATA_PCI_OFF, 0x400);
if (pci_addr_lin == 0) {
-   printk(KERN_INFO DRIVER_NAME ": pci mem must be mapped\n");
+   pr_info("pci mem must be mapped\n");
return 0;
}
return 1;
-- 
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/media: Use dev_ printks in lirc/igorplugusb.c

2012-11-08 Thread YAMANE Toshiaki
fixed below checkpatch warnings.
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then 
pr_warn(...  to printk(KERN_WARNING ...
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/lirc/lirc_igorplugusb.c |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_igorplugusb.c 
b/drivers/staging/media/lirc/lirc_igorplugusb.c
index 939a801..2faa391 100644
--- a/drivers/staging/media/lirc/lirc_igorplugusb.c
+++ b/drivers/staging/media/lirc/lirc_igorplugusb.c
@@ -223,8 +223,8 @@ static int unregister_from_lirc(struct igorplug *ir)
int devnum;
 
if (!ir) {
-   printk(KERN_ERR "%s: called with NULL device struct!\n",
-  __func__);
+   dev_err(&ir->usbdev->dev,
+   "%s: called with NULL device struct!\n", __func__);
return -EINVAL;
}
 
@@ -232,8 +232,8 @@ static int unregister_from_lirc(struct igorplug *ir)
d = ir->d;
 
if (!d) {
-   printk(KERN_ERR "%s: called with NULL lirc driver struct!\n",
-  __func__);
+   dev_err(&ir->usbdev->dev,
+   "%s: called with NULL lirc driver struct!\n", __func__);
return -EINVAL;
}
 
@@ -347,8 +347,8 @@ static int igorplugusb_remote_poll(void *data, struct 
lirc_buffer *buf)
if (ir->buf_in[2] == 0)
send_fragment(ir, buf, DEVICE_HEADERLEN, ret);
else {
-   printk(KERN_WARNING DRIVER_NAME
-  "[%d]: Device buffer overrun.\n", ir->devnum);
+   dev_warn(&ir->usbdev->dev,
+"[%d]: Device buffer overrun.\n", ir->devnum);
/* HHHNNN H = header
  <---[2]---> N = newer
   <-ret> O = older */
-- 
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/media: Use pr_ printks in lirc/lirc_sir.c

2012-11-08 Thread YAMANE Toshiaki
fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then 
pr_info(...  to printk(KERN_INFO ...

and add pr_fmt.

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/lirc/lirc_sir.c |   36 +
 1 file changed, 14 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_sir.c 
b/drivers/staging/media/lirc/lirc_sir.c
index 4afc3b4..9a88f05 100644
--- a/drivers/staging/media/lirc/lirc_sir.c
+++ b/drivers/staging/media/lirc/lirc_sir.c
@@ -33,6 +33,8 @@
  *   parts cut'n'pasted from sa1100_ir.c (C) 2000 Russell King
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include 
 #include 
 #include 
@@ -495,7 +497,7 @@ static int init_chrdev(void)
driver.dev = &lirc_sir_dev->dev;
driver.minor = lirc_register_driver(&driver);
if (driver.minor < 0) {
-   printk(KERN_ERR LIRC_DRIVER_NAME ": init_chrdev() failed.\n");
+   pr_err("init_chrdev() failed.\n");
return -EIO;
}
return 0;
@@ -604,7 +606,7 @@ static irqreturn_t sir_interrupt(int irq, void *dev_id)
}
 
if (status & UTSR0_TFS)
-   printk(KERN_ERR "transmit fifo not full, shouldn't happen\n");
+   pr_err("transmit fifo not full, shouldn't happen\n");
 
/* We must clear certain bits. */
status &= (UTSR0_RID | UTSR0_RBB | UTSR0_REB);
@@ -787,7 +789,7 @@ static int init_hardware(void)
 #ifdef LIRC_ON_SA1100
 #ifdef CONFIG_SA1100_BITSY
if (machine_is_bitsy()) {
-   printk(KERN_INFO "Power on IR module\n");
+   pr_info("Power on IR module\n");
set_bitsy_egpio(EGPIO_BITSY_IR_ON);
}
 #endif
@@ -885,8 +887,7 @@ static int init_hardware(void)
udelay(1500);
 
/* read previous control byte */
-   printk(KERN_INFO LIRC_DRIVER_NAME
-  ": 0x%02x\n", sinp(UART_RX));
+   pr_info("0x%02x\n", sinp(UART_RX));
 
/* Set DLAB 1. */
soutp(UART_LCR, sinp(UART_LCR) | UART_LCR_DLAB);
@@ -964,8 +965,7 @@ static int init_port(void)
/* get I/O port access and IRQ line */
 #ifndef LIRC_ON_SA1100
if (request_region(io, 8, LIRC_DRIVER_NAME) == NULL) {
-   printk(KERN_ERR LIRC_DRIVER_NAME
-  ": i/o port 0x%.4x already in use.\n", io);
+   pr_err("i/o port 0x%.4x already in use.\n", io);
return -EBUSY;
}
 #endif
@@ -975,15 +975,11 @@ static int init_port(void)
 #   ifndef LIRC_ON_SA1100
release_region(io, 8);
 #   endif
-   printk(KERN_ERR LIRC_DRIVER_NAME
-   ": IRQ %d already in use.\n",
-   irq);
+   pr_err("IRQ %d already in use.\n", irq);
return retval;
}
 #ifndef LIRC_ON_SA1100
-   printk(KERN_INFO LIRC_DRIVER_NAME
-   ": I/O port 0x%.4x, IRQ %d.\n",
-   io, irq);
+   pr_info("I/O port 0x%.4x, IRQ %d.\n", io, irq);
 #endif
 
init_timer(&timerlist);
@@ -1213,8 +1209,7 @@ static int init_lirc_sir(void)
if (retval < 0)
return retval;
init_hardware();
-   printk(KERN_INFO LIRC_DRIVER_NAME
-   ": Installed.\n");
+   pr_info("Installed.\n");
return 0;
 }
 
@@ -1243,23 +1238,20 @@ static int __init lirc_sir_init(void)
 
retval = platform_driver_register(&lirc_sir_driver);
if (retval) {
-   printk(KERN_ERR LIRC_DRIVER_NAME ": Platform driver register "
-  "failed!\n");
+   pr_err("Platform driver register failed!\n");
return -ENODEV;
}
 
lirc_sir_dev = platform_device_alloc("lirc_dev", 0);
if (!lirc_sir_dev) {
-   printk(KERN_ERR LIRC_DRIVER_NAME ": Platform device alloc "
-  "failed!\n");
+   pr_err("Platform device alloc failed!\n");
retval = -ENOMEM;
goto pdev_alloc_fail;
}
 
retval = platform_device_add(lirc_sir_dev);
if (retval) {
-   printk(KERN_ERR LIRC_DRIVER_NAME ": Platform device add "
-  "failed!\n");
+   pr_err("Platform device add failed!\n");
retval = -ENODEV;
goto pdev_add_fail;
}
@@ -1292,7 +1284,7 @@ static void __exit lirc_sir_exit(void)
drop_port();
platform_device_unregister(lirc_sir_dev);
platform_driver_

[PATCH] staging/media: Use dev_ or pr_ printks in lirc/lirc_sasem.c

2012-11-08 Thread YAMANE Toshiaki
fixed below checkpatch warnings.
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then 
pr_info(...  to printk(KERN_INFO ...
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then 
pr_warn(...  to printk(KERN_WARNING ...
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...

and add pr_fmt.

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/lirc/lirc_sasem.c |   65 ---
 1 file changed, 33 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_sasem.c 
b/drivers/staging/media/lirc/lirc_sasem.c
index f4e4d90..9be4d3f 100644
--- a/drivers/staging/media/lirc/lirc_sasem.c
+++ b/drivers/staging/media/lirc/lirc_sasem.c
@@ -34,6 +34,8 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include 
 #include 
 #include 
@@ -171,7 +173,7 @@ static void delete_context(struct sasem_context *context)
kfree(context);
 
if (debug)
-   printk(KERN_INFO "%s: context deleted\n", __func__);
+   pr_info("%s: context deleted\n", __func__);
 }
 
 static void deregister_from_lirc(struct sasem_context *context)
@@ -181,11 +183,10 @@ static void deregister_from_lirc(struct sasem_context 
*context)
 
retval = lirc_unregister_driver(minor);
if (retval)
-   printk(KERN_ERR "%s: unable to deregister from lirc (%d)\n",
-   __func__, retval);
+   pr_err("%s: unable to deregister from lirc (%d)\n",
+  __func__, retval);
else
-   printk(KERN_INFO "Deregistered Sasem driver (minor:%d)\n",
-  minor);
+   pr_info("Deregistered Sasem driver (minor:%d)\n", minor);
 
 }
 
@@ -206,8 +207,7 @@ static int vfd_open(struct inode *inode, struct file *file)
subminor = iminor(inode);
interface = usb_find_interface(&sasem_driver, subminor);
if (!interface) {
-   printk(KERN_ERR KBUILD_MODNAME
-  ": %s: could not find interface for minor %d\n",
+   pr_err("%s: could not find interface for minor %d\n",
   __func__, subminor);
retval = -ENODEV;
goto exit;
@@ -252,8 +252,7 @@ static long vfd_ioctl(struct file *file, unsigned cmd, 
unsigned long arg)
context = (struct sasem_context *) file->private_data;
 
if (!context) {
-   printk(KERN_ERR KBUILD_MODNAME
-  ": %s: no context for device\n", __func__);
+   pr_err("%s: no context for device\n", __func__);
return -ENODEV;
}
 
@@ -266,7 +265,7 @@ static long vfd_ioctl(struct file *file, unsigned cmd, 
unsigned long arg)
context->vfd_contrast = (unsigned int)arg;
break;
default:
-   printk(KERN_INFO "Unknown IOCTL command\n");
+   pr_info("Unknown IOCTL command\n");
mutex_unlock(&context->ctx_lock);
return -ENOIOCTLCMD;  /* not supported */
}
@@ -287,8 +286,7 @@ static int vfd_close(struct inode *inode, struct file *file)
context = (struct sasem_context *) file->private_data;
 
if (!context) {
-   printk(KERN_ERR KBUILD_MODNAME
-  ": %s: no context for device\n", __func__);
+   pr_err("%s: no context for device\n", __func__);
return -ENODEV;
}
 
@@ -299,7 +297,7 @@ static int vfd_close(struct inode *inode, struct file *file)
retval = -EIO;
} else {
context->vfd_isopen = 0;
-   printk(KERN_INFO "VFD port closed\n");
+   dev_info(&context->dev->dev, "VFD port closed\n");
if (!context->dev_present && !context->ir_isopen) {
 
/* Device disconnected before close and IR port is
@@ -373,16 +371,14 @@ static ssize_t vfd_write(struct file *file, const char 
*buf,
 
context = (struct sasem_context *) file->private_data;
if (!context) {
-   printk(KERN_ERR KBUILD_MODNAME
-  ": %s: no context for device\n", __func__);
+   pr_err("%s: no context for device\n", __func__);
return -ENODEV;
}
 
mutex_lock(&context->ctx_lock);
 
if (!context->dev_present) {
-   printk(KERN_ERR KBUILD_MODNAME
-  ": %s: no Sasem device present\n", __func__);
+   pr_err("%s: no Sasem device present\n", __func__);
retval = -ENODEV;
go

[PATCH] Staging/media: Use dev_ printks in solo6x10/p2m.c

2012-11-07 Thread YAMANE Toshiaki
fixed below checkpatch warning.
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then 
pr_warn(...  to printk(KERN_WARNING ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/solo6x10/p2m.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/solo6x10/p2m.c 
b/drivers/staging/media/solo6x10/p2m.c
index 56210f0..58ab61b 100644
--- a/drivers/staging/media/solo6x10/p2m.c
+++ b/drivers/staging/media/solo6x10/p2m.c
@@ -231,15 +231,15 @@ static void run_p2m_test(struct solo_dev *solo_dev)
u32 size = SOLO_JPEG_EXT_ADDR(solo_dev) + SOLO_JPEG_EXT_SIZE(solo_dev);
int i, d;
 
-   printk(KERN_WARNING "%s: Testing %u bytes of external ram\n",
-  SOLO6X10_NAME, size);
+   dev_warn(&solo_dev->pdev->dev, "Testing %u bytes of external ram\n",
+size);
 
for (i = 0; i < size; i += TEST_CHUNK_SIZE)
for (d = 0; d < 4; d++)
errs += p2m_test(solo_dev, d, i, TEST_CHUNK_SIZE);
 
-   printk(KERN_WARNING "%s: Found %llu errors during p2m test\n",
-  SOLO6X10_NAME, errs);
+   dev_warn(&solo_dev->pdev->dev, "Found %llu errors during p2m test\n",
+errs);
 
return;
 }
-- 
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/media: Use dev_ printks in cxd2099/cxd2099.c

2012-11-07 Thread YAMANE Toshiaki
fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then 
pr_info(...  to printk(KERN_INFO ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/cxd2099/cxd2099.c |   29 +++--
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/media/cxd2099/cxd2099.c 
b/drivers/staging/media/cxd2099/cxd2099.c
index 0ff1972..822c487 100644
--- a/drivers/staging/media/cxd2099/cxd2099.c
+++ b/drivers/staging/media/cxd2099/cxd2099.c
@@ -66,8 +66,9 @@ static int i2c_write_reg(struct i2c_adapter *adapter, u8 adr,
struct i2c_msg msg = {.addr = adr, .flags = 0, .buf = m, .len = 2};
 
if (i2c_transfer(adapter, &msg, 1) != 1) {
-   printk(KERN_ERR "Failed to write to I2C register %02x@%02x!\n",
-  reg, adr);
+   dev_err(&adapter->dev,
+   "Failed to write to I2C register %02x@%02x!\n",
+   reg, adr);
return -1;
}
return 0;
@@ -79,7 +80,7 @@ static int i2c_write(struct i2c_adapter *adapter, u8 adr,
struct i2c_msg msg = {.addr = adr, .flags = 0, .buf = data, .len = len};
 
if (i2c_transfer(adapter, &msg, 1) != 1) {
-   printk(KERN_ERR "Failed to write to I2C!\n");
+   dev_err(&adapter->dev, "Failed to write to I2C!\n");
return -1;
}
return 0;
@@ -94,7 +95,7 @@ static int i2c_read_reg(struct i2c_adapter *adapter, u8 adr,
   .buf = val, .len = 1} };
 
if (i2c_transfer(adapter, msgs, 2) != 2) {
-   printk(KERN_ERR "error in i2c_read_reg\n");
+   dev_err(&adapter->dev, "error in i2c_read_reg\n");
return -1;
}
return 0;
@@ -109,7 +110,7 @@ static int i2c_read(struct i2c_adapter *adapter, u8 adr,
 .buf = data, .len = n} };
 
if (i2c_transfer(adapter, msgs, 2) != 2) {
-   printk(KERN_ERR "error in i2c_read\n");
+   dev_err(&adapter->dev, "error in i2c_read\n");
return -1;
}
return 0;
@@ -277,7 +278,7 @@ static void cam_mode(struct cxd *ci, int mode)
 #ifdef BUFFER_MODE
if (!ci->en.read_data)
return;
-   printk(KERN_INFO "enable cam buffer mode\n");
+   dev_info(&ci->i2c->dev, "enable cam buffer mode\n");
/* write_reg(ci, 0x0d, 0x00); */
/* write_reg(ci, 0x0e, 0x01); */
write_regm(ci, 0x08, 0x40, 0x40);
@@ -524,7 +525,7 @@ static int slot_reset(struct dvb_ca_en50221 *ca, int slot)
msleep(10);
 #if 0
read_reg(ci, 0x06, &val);
-   printk(KERN_INFO "%d:%02x\n", i, val);
+   dev_info(&ci->i2c->dev, "%d:%02x\n", i, val);
if (!(val&0x10))
break;
 #else
@@ -542,7 +543,7 @@ static int slot_shutdown(struct dvb_ca_en50221 *ca, int 
slot)
 {
struct cxd *ci = ca->data;
 
-   printk(KERN_INFO "slot_shutdown\n");
+   dev_info(&ci->i2c->dev, "slot_shutdown\n");
mutex_lock(&ci->lock);
write_regm(ci, 0x09, 0x08, 0x08);
write_regm(ci, 0x20, 0x80, 0x80); /* Reset CAM Mode */
@@ -578,10 +579,10 @@ static int campoll(struct cxd *ci)
 
if (istat&0x40) {
ci->dr = 1;
-   printk(KERN_INFO "DR\n");
+   dev_info(&ci->i2c->dev, "DR\n");
}
if (istat&0x20)
-   printk(KERN_INFO "WC\n");
+   dev_info(&ci->i2c->dev, "WC\n");
 
if (istat&2) {
u8 slotstat;
@@ -597,7 +598,7 @@ static int campoll(struct cxd *ci)
if (ci->slot_stat) {
ci->slot_stat = 0;
write_regm(ci, 0x03, 0x00, 0x08);
-   printk(KERN_INFO "NO CAM\n");
+   dev_info(&ci->i2c->dev, "NO CAM\n");
ci->ready = 0;
}
}
@@ -634,7 +635,7 @@ static int read_data(struct dvb_ca_en50221 *ca, int slot, 
u8 *ebuf, int ecount)
campoll(ci);
mutex_unlock(&ci->lock);
 
-   printk(KERN_INFO "read_data\n");
+   dev_info(&ci->i2c->dev, "read_data\n");
if (!ci->dr)
return 0;
 
@@ -687,7 +688,7

[PATCH] Staging/media: Use dev_ printks in cxd2099/cxd2099.h

2012-11-07 Thread YAMANE Toshiaki
fixed below checkpatch warning.
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then 
pr_warn(...  to printk(KERN_WARNING ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/cxd2099/cxd2099.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/cxd2099/cxd2099.h 
b/drivers/staging/media/cxd2099/cxd2099.h
index 19c588a..0eb607c 100644
--- a/drivers/staging/media/cxd2099/cxd2099.h
+++ b/drivers/staging/media/cxd2099/cxd2099.h
@@ -43,7 +43,7 @@ struct dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg,
 static inline struct dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg,
void *priv, struct i2c_adapter *i2c)
 {
-   printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
+   dev_warn(&i2c->dev, "%s: driver disabled by Kconfig\n", __func__);
return NULL;
 }
 #endif
-- 
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 2/2] Staging/media: Use dev_ printks in go7007/s2250-board.c

2012-11-06 Thread YAMANE Toshiaki
fixed below checkpatch warning.
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then 
pr_info(...  to printk(KERN_INFO ...
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/go7007/s2250-board.c |   27 ---
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/media/go7007/s2250-board.c 
b/drivers/staging/media/go7007/s2250-board.c
index 6f94c17..d1cfefe 100644
--- a/drivers/staging/media/go7007/s2250-board.c
+++ b/drivers/staging/media/go7007/s2250-board.c
@@ -173,7 +173,7 @@ static int write_reg(struct i2c_client *client, u8 reg, u8 
value)
 
usb = go->hpi_context;
if (mutex_lock_interruptible(&usb->i2c_lock) != 0) {
-   printk(KERN_INFO "i2c lock failed\n");
+   dev_info(&client->dev, "i2c lock failed\n");
kfree(buf);
return -EINTR;
}
@@ -212,7 +212,7 @@ static int write_reg_fp(struct i2c_client *client, u16 
addr, u16 val)
 
usb = go->hpi_context;
if (mutex_lock_interruptible(&usb->i2c_lock) != 0) {
-   printk(KERN_INFO "i2c lock failed\n");
+   dev_info(&client->dev, "i2c lock failed\n");
kfree(buf);
return -EINTR;
}
@@ -230,13 +230,13 @@ static int write_reg_fp(struct i2c_client *client, u16 
addr, u16 val)
val_read = (buf[2] << 8) + buf[3];
kfree(buf);
if (val_read != val) {
-   printk(KERN_INFO "invalid fp write %x %x\n",
-  val_read, val);
+   dev_info(&client->dev, "invalid fp write %x %x\n",
+val_read, val);
return -EFAULT;
}
if (subaddr != addr) {
-   printk(KERN_INFO "invalid fp write addr %x %x\n",
-  subaddr, addr);
+   dev_info(&client->dev, "invalid fp write addr %x %x\n",
+subaddr, addr);
return -EFAULT;
}
} else {
@@ -274,7 +274,7 @@ static int read_reg_fp(struct i2c_client *client, u16 addr, 
u16 *val)
memset(buf, 0xcd, 6);
usb = go->hpi_context;
if (mutex_lock_interruptible(&usb->i2c_lock) != 0) {
-   printk(KERN_INFO "i2c lock failed\n");
+   dev_info(&client->dev, "i2c lock failed\n");
kfree(buf);
return -EINTR;
}
@@ -298,7 +298,7 @@ static int write_regs(struct i2c_client *client, u8 *regs)
 
for (i = 0; !((regs[i] == 0x00) && (regs[i+1] == 0x00)); i += 2) {
if (write_reg(client, regs[i], regs[i+1]) < 0) {
-   printk(KERN_INFO "s2250: failed\n");
+   dev_info(&client->dev, "failed\n");
return -1;
}
}
@@ -311,7 +311,7 @@ static int write_regs_fp(struct i2c_client *client, u16 
*regs)
 
for (i = 0; !((regs[i] == 0x00) && (regs[i+1] == 0x00)); i += 2) {
if (write_reg_fp(client, regs[i], regs[i+1]) < 0) {
-   printk(KERN_INFO "s2250: failed fp\n");
+   dev_info(&client->dev, "failed fp\n");
return -1;
}
}
@@ -605,23 +605,20 @@ static int s2250_probe(struct i2c_client *client,
 
/* initialize the audio */
if (write_regs(audio, aud_regs) < 0) {
-   printk(KERN_ERR
-  "s2250: error initializing audio\n");
+   dev_err(&client->dev, "error initializing audio\n");
i2c_unregister_device(audio);
kfree(state);
return 0;
}
 
if (write_regs(client, vid_regs) < 0) {
-   printk(KERN_ERR
-  "s2250: error initializing decoder\n");
+   dev_err(&client->dev, "error initializing decoder\n");
i2c_unregister_device(audio);
kfree(state);
return 0;
}
if (write_regs_fp(client, vid_regs_fp) < 0) {
-   printk(KERN_ERR
-  "s2250: error initializing decoder\n");
+   dev_err(&client->dev, "error initializing decoder\n");
i2c_unregister_device(audio);
kfree(state);
return 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/media: Use dev_ printks in go7007/wis-tw2804.c

2012-11-06 Thread YAMANE Toshiaki
fixed below checkpatch warning.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...
- WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then 
pr_debug(...  to printk(KERN_DEBUG ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/go7007/wis-tw2804.c |   24 +---
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/media/go7007/wis-tw2804.c 
b/drivers/staging/media/go7007/wis-tw2804.c
index 9134f03..69b9063 100644
--- a/drivers/staging/media/go7007/wis-tw2804.c
+++ b/drivers/staging/media/go7007/wis-tw2804.c
@@ -128,30 +128,32 @@ static int wis_tw2804_command(struct i2c_client *client,
int *input = arg;
 
if (*input < 0 || *input > 3) {
-   printk(KERN_ERR "wis-tw2804: channel %d is not "
-   "between 0 and 3!\n", *input);
+   dev_err(&client->dev,
+   "channel %d is not between 0 and 3!\n", *input);
return 0;
}
dec->channel = *input;
-   printk(KERN_DEBUG "wis-tw2804: initializing TW2804 "
-   "channel %d\n", dec->channel);
+   dev_dbg(&client->dev, "initializing TW2804 channel %d\n",
+   dec->channel);
if (dec->channel == 0 &&
write_regs(client, global_registers, 0) < 0) {
-   printk(KERN_ERR "wis-tw2804: error initializing "
-   "TW2804 global registers\n");
+   dev_err(&client->dev,
+   "error initializing TW2804 global registers\n");
return 0;
}
if (write_regs(client, channel_registers, dec->channel) < 0) {
-   printk(KERN_ERR "wis-tw2804: error initializing "
-   "TW2804 channel %d\n", dec->channel);
+   dev_err(&client->dev,
+   "error initializing TW2804 channel %d\n",
+   dec->channel);
return 0;
}
return 0;
}
 
if (dec->channel < 0) {
-   printk(KERN_DEBUG "wis-tw2804: ignoring command %08x until "
-   "channel number is set\n", cmd);
+   dev_dbg(&client->dev,
+   "ignoring command %08x until channel number is set\n",
+   cmd);
return 0;
}
 
@@ -311,7 +313,7 @@ static int wis_tw2804_probe(struct i2c_client *client,
dec->hue = 128;
i2c_set_clientdata(client, dec);
 
-   printk(KERN_DEBUG "wis-tw2804: creating TW2804 at address %d on %s\n",
+   dev_dbg(&client->dev, "creating TW2804 at address %d on %s\n",
client->addr, adapter->name);
 
return 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 1/2] Staging/media: fixed spacing coding style in go7007/wis-uda1342.c

2012-11-06 Thread YAMANE Toshiaki
fixed below checkpatch error.
- ERROR: that open brace { should be on the previous line

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/go7007/s2250-board.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/media/go7007/s2250-board.c 
b/drivers/staging/media/go7007/s2250-board.c
index 014d384..6f94c17 100644
--- a/drivers/staging/media/go7007/s2250-board.c
+++ b/drivers/staging/media/go7007/s2250-board.c
@@ -103,8 +103,7 @@ static u16 vid_regs_fp[] = {
 };
 
 /* PAL specific values */
-static u16 vid_regs_fp_pal[] =
-{
+static u16 vid_regs_fp_pal[] = {
0x120, 0x017,
0x121, 0xd22,
0x122, 0x122,
-- 
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/media: Use dev_ printks in go7007/wis-uda1342.c

2012-11-06 Thread YAMANE Toshiaki
fixed below checkpatch warning.
- WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then 
pr_debug(...  to printk(KERN_DEBUG ...
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/go7007/wis-uda1342.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/go7007/wis-uda1342.c 
b/drivers/staging/media/go7007/wis-uda1342.c
index 0127be2..48e1407 100644
--- a/drivers/staging/media/go7007/wis-uda1342.c
+++ b/drivers/staging/media/go7007/wis-uda1342.c
@@ -47,8 +47,8 @@ static int wis_uda1342_command(struct i2c_client *client,
write_reg(client, 0x00, 0x1241); /* select input 1 */
break;
default:
-   printk(KERN_ERR "wis-uda1342: input %d not supported\n",
-   *inp);
+   dev_err(&client->dev, "input %d not supported\n",
+   *inp);
break;
}
break;
@@ -67,8 +67,7 @@ static int wis_uda1342_probe(struct i2c_client *client,
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA))
return -ENODEV;
 
-   printk(KERN_DEBUG
-   "wis-uda1342: initializing UDA1342 at address %d on %s\n",
+   dev_dbg(&client->dev, "initializing UDA1342 at address %d on %s\n",
client->addr, adapter->name);
 
write_reg(client, 0x00, 0x8000); /* reset registers */
-- 
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/media: Use dev_ printks in go7007/go7007-v4l2.c

2012-11-06 Thread YAMANE Toshiaki
fixed below checkpatch warning.
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then 
pr_info(...  to printk(KERN_INFO ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/go7007/go7007-v4l2.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/go7007/go7007-v4l2.c 
b/drivers/staging/media/go7007/go7007-v4l2.c
index 980371b..d2d72d5 100644
--- a/drivers/staging/media/go7007/go7007-v4l2.c
+++ b/drivers/staging/media/go7007/go7007-v4l2.c
@@ -1811,8 +1811,8 @@ int go7007_v4l2_init(struct go7007 *go)
}
video_set_drvdata(go->video_dev, go);
++go->ref_count;
-   printk(KERN_INFO "%s: registered device %s [v4l2]\n",
-  go->video_dev->name, video_device_node_name(go->video_dev));
+   dev_info(go->dev, "registered device %s [v4l2]\n",
+video_device_node_name(go->video_dev));
 
return 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 2/2] Staging/media: Use dev_ printks in go7007/wis-tw9903.c

2012-11-06 Thread YAMANE Toshiaki
fixed below checkpatch warning.
- WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then 
pr_debug(...  to printk(KERN_DEBUG ...
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/go7007/wis-tw9903.c |9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/media/go7007/wis-tw9903.c 
b/drivers/staging/media/go7007/wis-tw9903.c
index 3821cd5..246ce17 100644
--- a/drivers/staging/media/go7007/wis-tw9903.c
+++ b/drivers/staging/media/go7007/wis-tw9903.c
@@ -127,8 +127,8 @@ static int wis_tw9903_command(struct i2c_client *client,
0x06, 0xc0, /* reset device */
0,  0,
};
-   printk(KERN_DEBUG "vscale is %04x, hscale is %04x\n",
-   vscale, hscale);
+   dev_dbg(&client->dev, "vscale is %04x, hscale is %04x\n",
+   vscale, hscale);
/*write_regs(client, regs);*/
break;
}
@@ -287,12 +287,11 @@ static int wis_tw9903_probe(struct i2c_client *client,
dec->hue = 0;
i2c_set_clientdata(client, dec);
 
-   printk(KERN_DEBUG
-   "wis-tw9903: initializing TW9903 at address %d on %s\n",
+   dev_dbg(&client->dev, "initializing TW9903 at address %d on %s\n",
client->addr, adapter->name);
 
if (write_regs(client, initial_registers) < 0) {
-   printk(KERN_ERR "wis-tw9903: error initializing TW9903\n");
+   dev_err(&client->dev, "error initializing TW9903\n");
kfree(dec);
return -ENODEV;
}
-- 
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 1/2] Staging/media: fixed spacing coding style in go7007/wis-tw9903.c

2012-11-06 Thread YAMANE Toshiaki
fixed below checkpatch error.
- ERROR: that open brace { should be on the previous line

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/go7007/wis-tw9903.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/media/go7007/wis-tw9903.c 
b/drivers/staging/media/go7007/wis-tw9903.c
index 9230f4a..3821cd5 100644
--- a/drivers/staging/media/go7007/wis-tw9903.c
+++ b/drivers/staging/media/go7007/wis-tw9903.c
@@ -31,8 +31,7 @@ struct wis_tw9903 {
int hue;
 };
 
-static u8 initial_registers[] =
-{
+static u8 initial_registers[] = {
0x02, 0x44, /* input 1, composite */
0x03, 0x92, /* correct digital format */
0x04, 0x00,
-- 
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 2/2] staging/media: Fix trailing statements should be on next line in go7007/go7007-fw.c

2012-11-05 Thread YAMANE Toshiaki
fixed below checkpatch error.
- ERROR: trailing statements should be on next line

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/go7007/go7007-fw.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/go7007/go7007-fw.c 
b/drivers/staging/media/go7007/go7007-fw.c
index f99c05b..cfce760 100644
--- a/drivers/staging/media/go7007/go7007-fw.c
+++ b/drivers/staging/media/go7007/go7007-fw.c
@@ -725,7 +725,8 @@ static int vti_bitlen(struct go7007 *go)
 {
unsigned int i, max_time_incr = go->sensor_framerate / go->fps_scale;
 
-   for (i = 31; (max_time_incr & ((1 << i) - 1)) == max_time_incr; --i);
+   for (i = 31; (max_time_incr & ((1 << i) - 1)) == max_time_incr; --i)
+   ;
return i + 1;
 }
 
-- 
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 1/2] staging/media: Use dev_ printks in go7007/go7007-fw.c

2012-11-05 Thread YAMANE Toshiaki
fixed below checkpatch warning.
- WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then 
pr_debug(...  to printk(KERN_DEBUG ...
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/go7007/go7007-fw.c |   42 ++
 1 file changed, 20 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/media/go7007/go7007-fw.c 
b/drivers/staging/media/go7007/go7007-fw.c
index c9a6409..f99c05b 100644
--- a/drivers/staging/media/go7007/go7007-fw.c
+++ b/drivers/staging/media/go7007/go7007-fw.c
@@ -382,8 +382,8 @@ static int gen_mjpeghdr_to_package(struct go7007 *go, 
__le16 *code, int space)
 
buf = kzalloc(4096, GFP_KERNEL);
if (buf == NULL) {
-   printk(KERN_ERR "go7007: unable to allocate 4096 bytes for "
-   "firmware construction\n");
+   dev_err(go->dev,
+   "unable to allocate 4096 bytes for firmware 
construction\n");
return -1;
}
 
@@ -652,8 +652,8 @@ static int gen_mpeg1hdr_to_package(struct go7007 *go,
 
buf = kzalloc(5120, GFP_KERNEL);
if (buf == NULL) {
-   printk(KERN_ERR "go7007: unable to allocate 5120 bytes for "
-   "firmware construction\n");
+   dev_err(go->dev,
+   "unable to allocate 5120 bytes for firmware 
construction\n");
return -1;
}
framelen[0] = mpeg1_frame_header(go, buf, 0, 1, PFRAME);
@@ -839,8 +839,8 @@ static int gen_mpeg4hdr_to_package(struct go7007 *go,
 
buf = kzalloc(5120, GFP_KERNEL);
if (buf == NULL) {
-   printk(KERN_ERR "go7007: unable to allocate 5120 bytes for "
-   "firmware construction\n");
+   dev_err(go->dev,
+   "unable to allocate 5120 bytes for firmware 
construction\n");
return -1;
}
framelen[0] = mpeg4_frame_header(go, buf, 0, PFRAME);
@@ -1545,9 +1545,8 @@ static int do_special(struct go7007 *go, u16 type, __le16 
*code, int space,
case SPECIAL_MODET:
return modet_to_package(go, code, space);
}
-   printk(KERN_ERR
-   "go7007: firmware file contains unsupported feature %04x\n",
-   type);
+   dev_err(go->dev,
+   "firmware file contains unsupported feature %04x\n", type);
return -1;
 }
 
@@ -1577,15 +1576,16 @@ int go7007_construct_fw_image(struct go7007 *go, u8 
**fw, int *fwlen)
return -1;
}
if (request_firmware(&fw_entry, go->board_info->firmware, go->dev)) {
-   printk(KERN_ERR
-   "go7007: unable to load firmware from file \"%s\"\n",
+   dev_err(go->dev,
+   "unable to load firmware from file \"%s\"\n",
go->board_info->firmware);
return -1;
}
code = kzalloc(codespace * 2, GFP_KERNEL);
if (code == NULL) {
-   printk(KERN_ERR "go7007: unable to allocate %d bytes for "
-   "firmware construction\n", codespace * 2);
+   dev_err(go->dev,
+   "unable to allocate %d bytes for firmware 
construction\n",
+   codespace * 2);
goto fw_failed;
}
src = (__le16 *)fw_entry->data;
@@ -1594,9 +1594,9 @@ int go7007_construct_fw_image(struct go7007 *go, u8 **fw, 
int *fwlen)
chunk_flags = __le16_to_cpu(src[0]);
chunk_len = __le16_to_cpu(src[1]);
if (chunk_len + 2 > srclen) {
-   printk(KERN_ERR "go7007: firmware file \"%s\" "
-   "appears to be corrupted\n",
-   go->board_info->firmware);
+   dev_err(go->dev,
+   "firmware file \"%s\" appears to be 
corrupted\n",
+   go->board_info->firmware);
goto fw_failed;
}
if (chunk_flags & mode_flag) {
@@ -1604,17 +1604,15 @@ int go7007_construct_fw_image(struct go7007 *go, u8 
**fw, int *fwlen)
ret = do_special(go, __le16_to_cpu(src[2]),
&code[i], codespace - i, framelen);
if (ret < 0) {
-   printk(KERN_ERR "go7007: insufficient "
-  

[PATCH 2/2] staging/media: Use dev_ or pr_ printks in go7007/wis-saa7113.c

2012-11-05 Thread YAMANE Toshiaki
fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...
- WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then 
pr_debug(...  to printk(KERN_DEBUG ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/go7007/wis-saa7113.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/go7007/wis-saa7113.c 
b/drivers/staging/media/go7007/wis-saa7113.c
index 7f155cb..d7ce95f 100644
--- a/drivers/staging/media/go7007/wis-saa7113.c
+++ b/drivers/staging/media/go7007/wis-saa7113.c
@@ -281,12 +281,12 @@ static int wis_saa7113_probe(struct i2c_client *client,
dec->hue = 0;
i2c_set_clientdata(client, dec);
 
-   printk(KERN_DEBUG
+   dev_dbg(&client->dev,
"wis-saa7113: initializing SAA7113 at address %d on %s\n",
client->addr, adapter->name);
 
if (write_regs(client, initial_registers) < 0) {
-   printk(KERN_ERR
+   dev_err(&client->dev,
"wis-saa7113: error initializing SAA7113\n");
kfree(dec);
return -ENODEV;
-- 
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 1/2] Staging/media: fixed spacing coding style in go7007/wis-saa7113.c

2012-11-05 Thread YAMANE Toshiaki
fixed below checkpatch error.
- ERROR: that open brace { should be on the previous line

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/go7007/wis-saa7113.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/media/go7007/wis-saa7113.c 
b/drivers/staging/media/go7007/wis-saa7113.c
index 05e0e10..7f155cb 100644
--- a/drivers/staging/media/go7007/wis-saa7113.c
+++ b/drivers/staging/media/go7007/wis-saa7113.c
@@ -32,8 +32,7 @@ struct wis_saa7113 {
int hue;
 };
 
-static u8 initial_registers[] =
-{
+static u8 initial_registers[] = {
0x01, 0x08,
0x02, 0xc0,
0x03, 0x33,
-- 
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 2/2] staging/media: Use dev_ or pr_ printks in go7007/wis-saa7115.c

2012-11-05 Thread YAMANE Toshiaki
fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...
- WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then 
pr_debug(...  to printk(KERN_DEBUG ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/go7007/wis-saa7115.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/go7007/wis-saa7115.c 
b/drivers/staging/media/go7007/wis-saa7115.c
index b31a82b..72d5ad9 100644
--- a/drivers/staging/media/go7007/wis-saa7115.c
+++ b/drivers/staging/media/go7007/wis-saa7115.c
@@ -414,12 +414,12 @@ static int wis_saa7115_probe(struct i2c_client *client,
dec->hue = 0;
i2c_set_clientdata(client, dec);
 
-   printk(KERN_DEBUG
+   dev_dbg(&client->dev,
"wis-saa7115: initializing SAA7115 at address %d on %s\n",
client->addr, adapter->name);
 
if (write_regs(client, initial_registers) < 0) {
-   printk(KERN_ERR
+   dev_err(&client->dev,
"wis-saa7115: error initializing SAA7115\n");
kfree(dec);
return -ENODEV;
-- 
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 1/2] Staging/media: fixed spacing coding style in go7007/wis-saa7115.c

2012-11-05 Thread YAMANE Toshiaki
fixed below checkpatch error.
- ERROR: that open brace { should be on the previous line

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/go7007/wis-saa7115.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/media/go7007/wis-saa7115.c 
b/drivers/staging/media/go7007/wis-saa7115.c
index 46cff59..b31a82b 100644
--- a/drivers/staging/media/go7007/wis-saa7115.c
+++ b/drivers/staging/media/go7007/wis-saa7115.c
@@ -32,8 +32,7 @@ struct wis_saa7115 {
int hue;
 };
 
-static u8 initial_registers[] =
-{
+static u8 initial_registers[] = {
0x01, 0x08,
0x02, 0xc0,
0x03, 0x20,
-- 
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/media: Use dev_ or pr_ printks in go7007/go7007-i2c.c

2012-11-05 Thread YAMANE Toshiaki
fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...
- WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then 
pr_debug(...  to printk(KERN_DEBUG ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/go7007/go7007-i2c.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/media/go7007/go7007-i2c.c 
b/drivers/staging/media/go7007/go7007-i2c.c
index 6bc82aa..39456a3 100644
--- a/drivers/staging/media/go7007/go7007-i2c.c
+++ b/drivers/staging/media/go7007/go7007-i2c.c
@@ -60,10 +60,10 @@ static int go7007_i2c_xfer(struct go7007 *go, u16 addr, int 
read,
 
 #ifdef GO7007_I2C_DEBUG
if (read)
-   printk(KERN_DEBUG "go7007-i2c: reading 0x%02x on 0x%02x\n",
+   dev_dbg(go->dev, "go7007-i2c: reading 0x%02x on 0x%02x\n",
command, addr);
else
-   printk(KERN_DEBUG
+   dev_dbg(go->dev,
"go7007-i2c: writing 0x%02x to 0x%02x on 0x%02x\n",
*data, command, addr);
 #endif
@@ -85,7 +85,7 @@ static int go7007_i2c_xfer(struct go7007 *go, u16 addr, int 
read,
msleep(100);
}
if (i == 10) {
-   printk(KERN_ERR "go7007-i2c: I2C adapter is hung\n");
+   dev_err(go->dev, "go7007-i2c: I2C adapter is hung\n");
goto i2c_done;
}
 
@@ -119,7 +119,7 @@ static int go7007_i2c_xfer(struct go7007 *go, u16 addr, int 
read,
msleep(100);
}
if (i == 10) {
-   printk(KERN_ERR "go7007-i2c: I2C adapter is hung\n");
+   dev_err(go->dev, "go7007-i2c: I2C adapter is hung\n");
goto i2c_done;
}
 
@@ -216,7 +216,7 @@ int go7007_i2c_init(struct go7007 *go)
go->i2c_adapter.dev.parent = go->dev;
i2c_set_adapdata(&go->i2c_adapter, go);
if (i2c_add_adapter(&go->i2c_adapter) < 0) {
-   printk(KERN_ERR
+   dev_err(go->dev,
"go7007-i2c: error: i2c_add_adapter failed\n");
return -1;
}
-- 
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/media: Use dev_ printks in go7007/s2250-loader.c

2012-11-05 Thread YAMANE Toshiaki
fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then 
pr_info(...  to printk(KERN_INFO ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/go7007/s2250-loader.c |   35 ++-
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/media/go7007/s2250-loader.c 
b/drivers/staging/media/go7007/s2250-loader.c
index f1bd159..f57eb3b 100644
--- a/drivers/staging/media/go7007/s2250-loader.c
+++ b/drivers/staging/media/go7007/s2250-loader.c
@@ -55,16 +55,16 @@ static int s2250loader_probe(struct usb_interface 
*interface,
 
usbdev = usb_get_dev(interface_to_usbdev(interface));
if (!usbdev) {
-   printk(KERN_ERR "Enter s2250loader_probe failed\n");
+   dev_err(&interface->dev, "Enter s2250loader_probe failed\n");
return -1;
}
-   printk(KERN_INFO "Enter s2250loader_probe 2.6 kernel\n");
-   printk(KERN_INFO "vendor id 0x%x, device id 0x%x devnum:%d\n",
-  usbdev->descriptor.idVendor, usbdev->descriptor.idProduct,
-  usbdev->devnum);
+   dev_info(&interface->dev, "Enter s2250loader_probe 2.6 kernel\n");
+   dev_info(&interface->dev, "vendor id 0x%x, device id 0x%x devnum:%d\n",
+usbdev->descriptor.idVendor, usbdev->descriptor.idProduct,
+usbdev->devnum);
 
if (usbdev->descriptor.bNumConfigurations != 1) {
-   printk(KERN_ERR "can't handle multiple config\n");
+   dev_err(&interface->dev, "can't handle multiple config\n");
return -1;
}
mutex_lock(&s2250_dev_table_mutex);
@@ -75,31 +75,32 @@ static int s2250loader_probe(struct usb_interface 
*interface,
}
 
if (minor < 0 || minor >= MAX_DEVICES) {
-   printk(KERN_ERR "Invalid minor: %d\n", minor);
+   dev_err(&interface->dev, "Invalid minor: %d\n", minor);
goto failed;
}
 
/* Allocate dev data structure */
s = kmalloc(sizeof(device_extension_t), GFP_KERNEL);
if (s == NULL) {
-   printk(KERN_ERR "Out of memory\n");
+   dev_err(&interface->dev, "Out of memory\n");
goto failed;
}
s2250_dev_table[minor] = s;
 
-   printk(KERN_INFO "s2250loader_probe: Device %d on Bus %d Minor %d\n",
-   usbdev->devnum, usbdev->bus->busnum, minor);
+   dev_info(&interface->dev,
+"s2250loader_probe: Device %d on Bus %d Minor %d\n",
+usbdev->devnum, usbdev->bus->busnum, minor);
 
memset(s, 0, sizeof(device_extension_t));
s->usbdev = usbdev;
-   printk(KERN_INFO "loading 2250 loader\n");
+   dev_info(&interface->dev, "loading 2250 loader\n");
 
kref_init(&(s->kref));
 
mutex_unlock(&s2250_dev_table_mutex);
 
if (request_firmware(&fw, S2250_LOADER_FIRMWARE, &usbdev->dev)) {
-   printk(KERN_ERR
+   dev_err(&interface->dev,
"s2250: unable to load firmware from file \"%s\"\n",
S2250_LOADER_FIRMWARE);
goto failed2;
@@ -107,12 +108,12 @@ static int s2250loader_probe(struct usb_interface 
*interface,
ret = usb_cypress_load_firmware(usbdev, fw, CYPRESS_FX2);
release_firmware(fw);
if (0 != ret) {
-   printk(KERN_ERR "loader download failed\n");
+   dev_err(&interface->dev, "loader download failed\n");
goto failed2;
}
 
if (request_firmware(&fw, S2250_FIRMWARE, &usbdev->dev)) {
-   printk(KERN_ERR
+   dev_err(&interface->dev,
"s2250: unable to load firmware from file \"%s\"\n",
S2250_FIRMWARE);
goto failed2;
@@ -120,7 +121,7 @@ static int s2250loader_probe(struct usb_interface 
*interface,
ret = usb_cypress_load_firmware(usbdev, fw, CYPRESS_FX2);
release_firmware(fw);
if (0 != ret) {
-   printk(KERN_ERR "firmware_s2250 download failed\n");
+   dev_err(&interface->dev, "firmware_s2250 download failed\n");
goto failed2;
}
 
@@ -133,14 +134,14 @@ failed2:
if (s)
kref_put(&(s->kref), s2250loader_delete);
 
-   printk(KERN_ERR "probe failed\n");
+   dev_err(&interface->dev, &quo

[PATCH] staging/media: Use dev_ printks in go7007/wis-sony-tuner.c

2012-11-04 Thread YAMANE Toshiaki
fixed below checkpatch warning.
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then 
pr_info(...  to printk(KERN_INFO ...
- WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then 
pr_debug(...  to printk(KERN_DEBUG ...
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  
to printk(KERN_ERR ...

Signed-off-by: YAMANE Toshiaki 
---
 drivers/staging/media/go7007/wis-sony-tuner.c |   86 -
 1 file changed, 42 insertions(+), 44 deletions(-)

diff --git a/drivers/staging/media/go7007/wis-sony-tuner.c 
b/drivers/staging/media/go7007/wis-sony-tuner.c
index 8f1b7d4..3e013b9 100644
--- a/drivers/staging/media/go7007/wis-sony-tuner.c
+++ b/drivers/staging/media/go7007/wis-sony-tuner.c
@@ -95,8 +95,8 @@ static int set_freq(struct i2c_client *client, int freq)
band_name = "UHF";
band_select = tun->UHF;
}
-   printk(KERN_DEBUG "wis-sony-tuner: tuning to frequency %d.%04d (%s)\n",
-   freq / 16, (freq % 16) * 625, band_name);
+   dev_dbg(&client->dev, "tuning to frequency %d.%04d (%s)\n",
+   freq / 16, (freq % 16) * 625, band_name);
n = freq + tun->IFPCoff;
 
buffer[0] = n >> 8;
@@ -288,16 +288,16 @@ static int mpx_setup(struct i2c_client *client)
u8 buf1[3], buf2[2];
struct i2c_msg msgs[2];
 
-   printk(KERN_DEBUG "wis-sony-tuner: MPX registers: %04x %04x "
-   "%04x %04x %04x %04x %04x %04x\n",
-   mpx_audio_modes[t->mpxmode].modus,
-   source,
-   mpx_audio_modes[t->mpxmode].acb,
-   mpx_audio_modes[t->mpxmode].fm_prescale,
-   mpx_audio_modes[t->mpxmode].nicam_prescale,
-   mpx_audio_modes[t->mpxmode].scart_prescale,
-   mpx_audio_modes[t->mpxmode].system,
-   mpx_audio_modes[t->mpxmode].volume);
+   dev_dbg(&client->dev,
+   "MPX registers: %04x %04x %04x %04x %04x %04x %04x 
%04x\n",
+   mpx_audio_modes[t->mpxmode].modus,
+   source,
+   mpx_audio_modes[t->mpxmode].acb,
+   mpx_audio_modes[t->mpxmode].fm_prescale,
+   mpx_audio_modes[t->mpxmode].nicam_prescale,
+   mpx_audio_modes[t->mpxmode].scart_prescale,
+   mpx_audio_modes[t->mpxmode].system,
+   mpx_audio_modes[t->mpxmode].volume);
buf1[0] = 0x11;
buf1[1] = 0x00;
buf1[2] = 0x7e;
@@ -310,14 +310,14 @@ static int mpx_setup(struct i2c_client *client)
msgs[1].len = 2;
msgs[1].buf = buf2;
i2c_transfer(client->adapter, msgs, 2);
-   printk(KERN_DEBUG "wis-sony-tuner: MPX system: %02x%02x\n",
-   buf2[0], buf2[1]);
+   dev_dbg(&client->dev, "MPX system: %02x%02x\n",
+   buf2[0], buf2[1]);
buf1[0] = 0x11;
buf1[1] = 0x02;
buf1[2] = 0x00;
i2c_transfer(client->adapter, msgs, 2);
-   printk(KERN_DEBUG "wis-sony-tuner: MPX status: %02x%02x\n",
-   buf2[0], buf2[1]);
+   dev_dbg(&client->dev, "MPX status: %02x%02x\n",
+   buf2[0], buf2[1]);
}
 #endif
return 0;
@@ -375,8 +375,7 @@ static int set_if(struct i2c_client *client)
t->mpxmode = force_mpx_mode;
else
t->mpxmode = default_mpx_mode;
-   printk(KERN_DEBUG "wis-sony-tuner: setting MPX to mode %d\n",
-   t->mpxmode);
+   dev_dbg(&client->dev, "setting MPX to mode %d\n", t->mpxmode);
mpx_setup(client);
 
return 0;
@@ -401,8 +400,8 @@ static int tuner_command(struct i2c_client *client, 
unsigned int cmd, void *arg)
 
if (t->type >= 0) {
if (t->type != *type)
-   printk(KERN_ERR "wis-sony-tuner: type already "
-   "set to %d, ignoring request for %d\n",
+   dev_err(&client->dev,
+   "type already set to %d, ignoring 
request for %d\n",
t->type, *type);
break;
}
@@ -414,28 +413,28 @@ static int tuner_command(struct i2c_client *client, 
unsi

  1   2   >