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

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

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

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

Thanks,

Chaitanya

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


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

2014-05-25 Thread Dan Carpenter
Since you're redoing this one anyway, please use a more specific subject
like:

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

regards,
dan carpenter

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


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

2014-05-25 Thread Greg KH
On Sun, May 25, 2014 at 11:59:08AM -0700, Chaitanya Hazarey wrote:
> Added a blank line after declarations in many places to fix the following 
> warning issued by checkpatch.pl:
> 
> WARNING: Missing a blank line after declarations
> 
> Lets see if this works now, this patch is prepared against Greg's staging 
> tree.

What branch of my staging.git tree are you using?  You should use the
staging-next branch, this patch still doesn't apply to there :(

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


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

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

WARNING: Missing a blank line after declarations

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

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

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

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

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

Thanks for looking into this,

Chaitanya

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


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

2014-05-25 Thread Greg KH
On Fri, May 23, 2014 at 10:25:28PM -0700, Chaitanya Hazarey wrote:
> Added a blank line after declarations in many places to fix the
> following warning issued by checkpatch.pl:
> 
> WARNING: Missing a blank line after declarations
> 
> Thanks Greg K-H and Dan for the patience. Hope it works this time, I did
> apply it against staging and it was ok. 


Hm, something is odd, it still doesn't apply properly:

$ p1 < ../s1
checking file drivers/staging/silicom/bpctl_mod.c
Hunk #40 FAILED at 4773.
Hunk #41 FAILED at 4821.
...
Hunk #89 FAILED at 7534.
3 out of 89 hunks FAILED

Can you refresh this against my tree again and resend?  I think we are
out of sync here still.

thanks,

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


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

2014-05-25 Thread Greg KH
On Fri, May 23, 2014 at 10:25:28PM -0700, Chaitanya Hazarey wrote:
 Added a blank line after declarations in many places to fix the
 following warning issued by checkpatch.pl:
 
 WARNING: Missing a blank line after declarations
 
 Thanks Greg K-H and Dan for the patience. Hope it works this time, I did
 apply it against staging and it was ok. 


Hm, something is odd, it still doesn't apply properly:

$ p1  ../s1
checking file drivers/staging/silicom/bpctl_mod.c
Hunk #40 FAILED at 4773.
Hunk #41 FAILED at 4821.
...
Hunk #89 FAILED at 7534.
3 out of 89 hunks FAILED

Can you refresh this against my tree again and resend?  I think we are
out of sync here still.

thanks,

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


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

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

Thanks for looking into this,

Chaitanya

On Sun, May 25, 2014 at 11:03 AM, Greg KH gre...@linuxfoundation.org wrote:
 On Fri, May 23, 2014 at 10:25:28PM -0700, Chaitanya Hazarey wrote:
 Added a blank line after declarations in many places to fix the
 following warning issued by checkpatch.pl:

 WARNING: Missing a blank line after declarations

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


 Hm, something is odd, it still doesn't apply properly:

 $ p1  ../s1
 checking file drivers/staging/silicom/bpctl_mod.c
 Hunk #40 FAILED at 4773.
 Hunk #41 FAILED at 4821.
 ...
 Hunk #89 FAILED at 7534.
 3 out of 89 hunks FAILED

 Can you refresh this against my tree again and resend?  I think we are
 out of sync here still.

 thanks,

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


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

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

WARNING: Missing a blank line after declarations

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

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

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

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

2014-05-25 Thread Greg KH
On Sun, May 25, 2014 at 11:59:08AM -0700, Chaitanya Hazarey wrote:
 Added a blank line after declarations in many places to fix the following 
 warning issued by checkpatch.pl:
 
 WARNING: Missing a blank line after declarations
 
 Lets see if this works now, this patch is prepared against Greg's staging 
 tree.

What branch of my staging.git tree are you using?  You should use the
staging-next branch, this patch still doesn't apply to there :(

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


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

2014-05-25 Thread Dan Carpenter
Since you're redoing this one anyway, please use a more specific subject
like:

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

regards,
dan carpenter

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


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

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

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

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

Thanks,

Chaitanya

On Sun, May 25, 2014 at 3:30 PM, Dan Carpenter dan.carpen...@oracle.com wrote:
 Since you're redoing this one anyway, please use a more specific subject
 like:

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

 regards,
 dan carpenter

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


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

2014-05-24 Thread Dan Carpenter
Yep.  That applies now.

regards,
dan carpenter

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


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

2014-05-24 Thread Dan Carpenter
Yep.  That applies now.

regards,
dan carpenter

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


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

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

WARNING: Missing a blank line after declarations

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

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

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

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

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

WARNING: Missing a blank line after declarations

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

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

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