Re: [PATCH] Staging: Silicom: bpctl_mod.c & bypass.c: Adding blank lines
On Sun, 2014-05-25 at 21:58 -0700, Chaitanya Hazarey wrote: > Added a blank line after declarations in many places to fix > the following warning issued by checkpatch.pl: Unrelated trivial note: > diff --git a/drivers/staging/silicom/bpctl_mod.c > b/drivers/staging/silicom/bpctl_mod.c > @@ -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) unnecessary and ugly double brace -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Staging: Silicom: bpctl_mod.c & bypass.c: Adding blank lines
Added a blank line after declarations in many places to fix the following warning issued by checkpatch.pl: WARNING: Missing a blank line after declarations Signed-off-by: Chaitanya Hazarey --- drivers/staging/silicom/bpctl_mod.c| 88 +++- drivers/staging/silicom/bypasslib/bypass.c |2 + 2 files changed, 88 insertions(+), 2 deletions(-) diff --git a/drivers/staging/silicom/bpctl_mod.c b/drivers/staging/silicom/bpctl_mod.c index e361cde..22bf4bf 100644 --- a/drivers/staging/silicom/bpctl_mod.c +++ b/drivers/staging/silicom/bpctl_mod.c @@ -752,6 +752,7 @@ static void write_reg(struct bpctl_dev *pbpctl_dev, unsigned char value, uint32_t ctrl_ext = 0, ctrl = 0; struct bpctl_dev *pbpctl_dev_c = NULL; unsigned long flags; + if (pbpctl_dev->bp_10g9) { pbpctl_dev_c = get_status_port_fn(pbpctl_dev); if (!pbpctl_dev_c) @@ -927,6 +928,7 @@ static int read_reg(struct bpctl_dev *pbpctl_dev, unsigned char addr) #ifdef BP_SYNC_FLAG unsigned long flags; + spin_lock_irqsave(_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)) & @@ -3386,6 +3401,7 @@ static int tap_flag_status(struct bpctl_dev *pbpctl_dev) static int
Re: [PATCH] Staging: Silicom: bpctl_mod.c & bypass.c: Adding blank lines
On its way. Chaitanya On Sun, May 25, 2014 at 5:51 PM, Greg KH wrote: > On Sun, May 25, 2014 at 05:36:58PM -0700, Chaitanya Hazarey wrote: >> Added a blank line after declarations in many places to fix the following >> warning issued by checkpatch.pl: > > Always wrap your lines at 72 columns, like git asks you to when you type > in the commit message. > >> WARNING: Missing a blank line after declarations >> >> The reason why it was not applying clean against Greg's tree was that >> bpctl_mod.c had changed in the functions which are a part of this patch. > > This doesn't belong as part of the changelog, right? Please resend and > put it below the --- line, if you want to. > > Can you redo this with the changelog fixed up please? > > thanks, > > greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Staging: Silicom: bpctl_mod.c & bypass.c: Adding blank lines
On Sun, May 25, 2014 at 05:36:58PM -0700, Chaitanya Hazarey wrote: > Added a blank line after declarations in many places to fix the following > warning issued by checkpatch.pl: Always wrap your lines at 72 columns, like git asks you to when you type in the commit message. > WARNING: Missing a blank line after declarations > > The reason why it was not applying clean against Greg's tree was that > bpctl_mod.c had changed in the functions which are a part of this patch. This doesn't belong as part of the changelog, right? Please resend and put it below the --- line, if you want to. Can you redo this with the changelog fixed up please? thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Staging: Silicom: bpctl_mod.c & bypass.c: Adding blank lines
Added a blank line after declarations in many places to fix the following warning issued by checkpatch.pl: WARNING: Missing a blank line after declarations The reason why it was not applying clean against Greg's tree was that bpctl_mod.c had changed in the functions which are a part of this patch. Signed-off-by: Chaitanya Hazarey --- drivers/staging/silicom/bpctl_mod.c| 88 +++- drivers/staging/silicom/bypasslib/bypass.c |2 + 2 files changed, 88 insertions(+), 2 deletions(-) diff --git a/drivers/staging/silicom/bpctl_mod.c b/drivers/staging/silicom/bpctl_mod.c index e361cde..22bf4bf 100644 --- a/drivers/staging/silicom/bpctl_mod.c +++ b/drivers/staging/silicom/bpctl_mod.c @@ -752,6 +752,7 @@ static void write_reg(struct bpctl_dev *pbpctl_dev, unsigned char value, uint32_t ctrl_ext = 0, ctrl = 0; struct bpctl_dev *pbpctl_dev_c = NULL; unsigned long flags; + if (pbpctl_dev->bp_10g9) { pbpctl_dev_c = get_status_port_fn(pbpctl_dev); if (!pbpctl_dev_c) @@ -927,6 +928,7 @@ static int read_reg(struct bpctl_dev *pbpctl_dev, unsigned char addr) #ifdef BP_SYNC_FLAG unsigned long flags; + spin_lock_irqsave(_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
[PATCH] Staging: Silicom: bpctl_mod.c bypass.c: Adding blank lines
Added a blank line after declarations in many places to fix the following warning issued by checkpatch.pl: WARNING: Missing a blank line after declarations The reason why it was not applying clean against Greg's tree was that bpctl_mod.c had changed in the functions which are a part of this patch. Signed-off-by: Chaitanya Hazarey c...@24.io --- drivers/staging/silicom/bpctl_mod.c| 88 +++- drivers/staging/silicom/bypasslib/bypass.c |2 + 2 files changed, 88 insertions(+), 2 deletions(-) diff --git a/drivers/staging/silicom/bpctl_mod.c b/drivers/staging/silicom/bpctl_mod.c index e361cde..22bf4bf 100644 --- a/drivers/staging/silicom/bpctl_mod.c +++ b/drivers/staging/silicom/bpctl_mod.c @@ -752,6 +752,7 @@ static void write_reg(struct bpctl_dev *pbpctl_dev, unsigned char value, uint32_t ctrl_ext = 0, ctrl = 0; struct bpctl_dev *pbpctl_dev_c = NULL; unsigned long flags; + if (pbpctl_dev-bp_10g9) { pbpctl_dev_c = get_status_port_fn(pbpctl_dev); if (!pbpctl_dev_c) @@ -927,6 +928,7 @@ static int read_reg(struct bpctl_dev *pbpctl_dev, unsigned char addr) #ifdef BP_SYNC_FLAG unsigned long flags; + spin_lock_irqsave(pbpctl_dev-bypass_wr_lock, flags); #else atomic_set(pbpctl_dev-wdt_busy, 1); @@ -1563,6 +1565,7 @@ int pulse_set_fn(struct bpctl_dev *pbpctl_dev, unsigned int counter) int zero_set_fn(struct bpctl_dev *pbpctl_dev) { uint32_t ctrl_ext = 0, ctrl_value = 0; + if (!pbpctl_dev) return -1; @@ -1588,6 +1591,7 @@ int zero_set_fn(struct bpctl_dev *pbpctl_dev) int pulse_get2_fn(struct bpctl_dev *pbpctl_dev) { uint32_t ctrl_ext = 0, ctrl_value = 0; + if (!pbpctl_dev) return -1; @@ -1603,6 +1607,7 @@ int pulse_get2_fn(struct bpctl_dev *pbpctl_dev) int pulse_get1_fn(struct bpctl_dev *pbpctl_dev) { uint32_t ctrl_ext = 0, ctrl_value = 0; + if (!pbpctl_dev) return -1; @@ -1666,6 +1671,7 @@ static struct bpctl_dev *lookup_port(struct bpctl_dev *dev) { struct bpctl_dev *p; int n; + for (n = 0, p = bpctl_dev_arr; n device_num p-pdev; n++) { if (p-bus == dev-bus p-slot == dev-slot @@ -1843,6 +1849,7 @@ static int bypass_off(struct bpctl_dev *pbpctl_dev) static int tap_off(struct bpctl_dev *pbpctl_dev) { int ret = BP_NOT_CAP; + if ((pbpctl_dev-bp_caps TAP_CAP) (pbpctl_dev-bp_ext_ver = PXG2TBPI_VER)) { write_data(pbpctl_dev, TAP_OFF); @@ -1856,6 +1863,7 @@ static int tap_off(struct bpctl_dev *pbpctl_dev) static int tap_on(struct bpctl_dev *pbpctl_dev) { int ret = BP_NOT_CAP; + if ((pbpctl_dev-bp_caps TAP_CAP) (pbpctl_dev-bp_ext_ver = PXG2TBPI_VER)) { write_data(pbpctl_dev, TAP_ON); @@ -1869,6 +1877,7 @@ static int tap_on(struct bpctl_dev *pbpctl_dev) static int disc_off(struct bpctl_dev *pbpctl_dev) { int ret = 0; + if ((pbpctl_dev-bp_caps DISC_CAP) (pbpctl_dev-bp_ext_ver = 0x8)) { write_data(pbpctl_dev, DISC_OFF); msec_delay_bp(LATCH_DELAY); @@ -1881,6 +1890,7 @@ static int disc_off(struct bpctl_dev *pbpctl_dev) static int disc_on(struct bpctl_dev *pbpctl_dev) { int ret = 0; + if ((pbpctl_dev-bp_caps DISC_CAP) (pbpctl_dev-bp_ext_ver = 0x8)) { write_data(pbpctl_dev, /*DISC_ON */ 0x85); msec_delay_bp(LATCH_DELAY); @@ -2270,6 +2280,7 @@ static int set_tx(struct bpctl_dev *pbpctl_dev, int tx_state) { int ret = 0, ctrl = 0; struct bpctl_dev *pbpctl_dev_m; + if ((is_bypass_fn(pbpctl_dev)) == 1) pbpctl_dev_m = pbpctl_dev; else @@ -2802,6 +2813,7 @@ int wdt_time_left(struct bpctl_dev *pbpctl_dev) static int wdt_timer(struct bpctl_dev *pbpctl_dev, int *time_left) { int ret = 0; + if (pbpctl_dev-bp_caps WD_CTL_CAP) { { if (pbpctl_dev-wdt_status == WDT_STATUS_UNKNOWN) @@ -3014,6 +3026,7 @@ static int tx_status(struct bpctl_dev *pbpctl_dev) { uint32_t ctrl = 0; struct bpctl_dev *pbpctl_dev_m; + if ((is_bypass_fn(pbpctl_dev)) == 1) pbpctl_dev_m = pbpctl_dev; else @@ -3195,6 +3208,7 @@ static int bypass_change_status(struct bpctl_dev *pbpctl_dev) static int bypass_status(struct bpctl_dev *pbpctl_dev) { u32 ctrl_ext = 0; + if (pbpctl_dev-bp_caps BP_CAP) { struct bpctl_dev *pbpctl_dev_b = NULL; @@ -3323,6 +3337,7 @@ static int dis_bypass_cap_status(struct bpctl_dev *pbpctl_dev) static int wdt_programmed(struct bpctl_dev *pbpctl_dev, int *timeout) { int ret = 0; + if (pbpctl_dev-bp_caps WD_CTL_CAP) { if (pbpctl_dev-bp_ext_ver = PXG2BPI_VER) { if ((read_reg(pbpctl_dev,
Re: [PATCH] Staging: Silicom: bpctl_mod.c bypass.c: Adding blank lines
On Sun, May 25, 2014 at 05:36:58PM -0700, Chaitanya Hazarey wrote: Added a blank line after declarations in many places to fix the following warning issued by checkpatch.pl: Always wrap your lines at 72 columns, like git asks you to when you type in the commit message. WARNING: Missing a blank line after declarations The reason why it was not applying clean against Greg's tree was that bpctl_mod.c had changed in the functions which are a part of this patch. This doesn't belong as part of the changelog, right? Please resend and put it below the --- line, if you want to. Can you redo this with the changelog fixed up please? thanks, greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Staging: Silicom: bpctl_mod.c bypass.c: Adding blank lines
Added a blank line after declarations in many places to fix the following warning issued by checkpatch.pl: WARNING: Missing a blank line after declarations Signed-off-by: Chaitanya Hazarey c...@24.io --- drivers/staging/silicom/bpctl_mod.c| 88 +++- drivers/staging/silicom/bypasslib/bypass.c |2 + 2 files changed, 88 insertions(+), 2 deletions(-) diff --git a/drivers/staging/silicom/bpctl_mod.c b/drivers/staging/silicom/bpctl_mod.c index e361cde..22bf4bf 100644 --- a/drivers/staging/silicom/bpctl_mod.c +++ b/drivers/staging/silicom/bpctl_mod.c @@ -752,6 +752,7 @@ static void write_reg(struct bpctl_dev *pbpctl_dev, unsigned char value, uint32_t ctrl_ext = 0, ctrl = 0; struct bpctl_dev *pbpctl_dev_c = NULL; unsigned long flags; + if (pbpctl_dev-bp_10g9) { pbpctl_dev_c = get_status_port_fn(pbpctl_dev); if (!pbpctl_dev_c) @@ -927,6 +928,7 @@ static int read_reg(struct bpctl_dev *pbpctl_dev, unsigned char addr) #ifdef BP_SYNC_FLAG unsigned long flags; + spin_lock_irqsave(pbpctl_dev-bypass_wr_lock, flags); #else atomic_set(pbpctl_dev-wdt_busy, 1); @@ -1563,6 +1565,7 @@ int pulse_set_fn(struct bpctl_dev *pbpctl_dev, unsigned int counter) int zero_set_fn(struct bpctl_dev *pbpctl_dev) { uint32_t ctrl_ext = 0, ctrl_value = 0; + if (!pbpctl_dev) return -1; @@ -1588,6 +1591,7 @@ int zero_set_fn(struct bpctl_dev *pbpctl_dev) int pulse_get2_fn(struct bpctl_dev *pbpctl_dev) { uint32_t ctrl_ext = 0, ctrl_value = 0; + if (!pbpctl_dev) return -1; @@ -1603,6 +1607,7 @@ int pulse_get2_fn(struct bpctl_dev *pbpctl_dev) int pulse_get1_fn(struct bpctl_dev *pbpctl_dev) { uint32_t ctrl_ext = 0, ctrl_value = 0; + if (!pbpctl_dev) return -1; @@ -1666,6 +1671,7 @@ static struct bpctl_dev *lookup_port(struct bpctl_dev *dev) { struct bpctl_dev *p; int n; + for (n = 0, p = bpctl_dev_arr; n device_num p-pdev; n++) { if (p-bus == dev-bus p-slot == dev-slot @@ -1843,6 +1849,7 @@ static int bypass_off(struct bpctl_dev *pbpctl_dev) static int tap_off(struct bpctl_dev *pbpctl_dev) { int ret = BP_NOT_CAP; + if ((pbpctl_dev-bp_caps TAP_CAP) (pbpctl_dev-bp_ext_ver = PXG2TBPI_VER)) { write_data(pbpctl_dev, TAP_OFF); @@ -1856,6 +1863,7 @@ static int tap_off(struct bpctl_dev *pbpctl_dev) static int tap_on(struct bpctl_dev *pbpctl_dev) { int ret = BP_NOT_CAP; + if ((pbpctl_dev-bp_caps TAP_CAP) (pbpctl_dev-bp_ext_ver = PXG2TBPI_VER)) { write_data(pbpctl_dev, TAP_ON); @@ -1869,6 +1877,7 @@ static int tap_on(struct bpctl_dev *pbpctl_dev) static int disc_off(struct bpctl_dev *pbpctl_dev) { int ret = 0; + if ((pbpctl_dev-bp_caps DISC_CAP) (pbpctl_dev-bp_ext_ver = 0x8)) { write_data(pbpctl_dev, DISC_OFF); msec_delay_bp(LATCH_DELAY); @@ -1881,6 +1890,7 @@ static int disc_off(struct bpctl_dev *pbpctl_dev) static int disc_on(struct bpctl_dev *pbpctl_dev) { int ret = 0; + if ((pbpctl_dev-bp_caps DISC_CAP) (pbpctl_dev-bp_ext_ver = 0x8)) { write_data(pbpctl_dev, /*DISC_ON */ 0x85); msec_delay_bp(LATCH_DELAY); @@ -2270,6 +2280,7 @@ static int set_tx(struct bpctl_dev *pbpctl_dev, int tx_state) { int ret = 0, ctrl = 0; struct bpctl_dev *pbpctl_dev_m; + if ((is_bypass_fn(pbpctl_dev)) == 1) pbpctl_dev_m = pbpctl_dev; else @@ -2802,6 +2813,7 @@ int wdt_time_left(struct bpctl_dev *pbpctl_dev) static int wdt_timer(struct bpctl_dev *pbpctl_dev, int *time_left) { int ret = 0; + if (pbpctl_dev-bp_caps WD_CTL_CAP) { { if (pbpctl_dev-wdt_status == WDT_STATUS_UNKNOWN) @@ -3014,6 +3026,7 @@ static int tx_status(struct bpctl_dev *pbpctl_dev) { uint32_t ctrl = 0; struct bpctl_dev *pbpctl_dev_m; + if ((is_bypass_fn(pbpctl_dev)) == 1) pbpctl_dev_m = pbpctl_dev; else @@ -3195,6 +3208,7 @@ static int bypass_change_status(struct bpctl_dev *pbpctl_dev) static int bypass_status(struct bpctl_dev *pbpctl_dev) { u32 ctrl_ext = 0; + if (pbpctl_dev-bp_caps BP_CAP) { struct bpctl_dev *pbpctl_dev_b = NULL; @@ -3323,6 +3337,7 @@ static int dis_bypass_cap_status(struct bpctl_dev *pbpctl_dev) static int wdt_programmed(struct bpctl_dev *pbpctl_dev, int *timeout) { int ret = 0; + if (pbpctl_dev-bp_caps WD_CTL_CAP) { if (pbpctl_dev-bp_ext_ver = PXG2BPI_VER) { if ((read_reg(pbpctl_dev, STATUS_REG_ADDR)) @@ -3386,6 +3401,7 @@ static int tap_flag_status(struct bpctl_dev *pbpctl_dev) static int tap_flag_status_clear(struct bpctl_dev *pbpctl_dev)
Re: [PATCH] Staging: Silicom: bpctl_mod.c bypass.c: Adding blank lines
On its way. Chaitanya On Sun, May 25, 2014 at 5:51 PM, Greg KH gre...@linuxfoundation.org wrote: On Sun, May 25, 2014 at 05:36:58PM -0700, Chaitanya Hazarey wrote: Added a blank line after declarations in many places to fix the following warning issued by checkpatch.pl: Always wrap your lines at 72 columns, like git asks you to when you type in the commit message. WARNING: Missing a blank line after declarations The reason why it was not applying clean against Greg's tree was that bpctl_mod.c had changed in the functions which are a part of this patch. This doesn't belong as part of the changelog, right? Please resend and put it below the --- line, if you want to. Can you redo this with the changelog fixed up please? thanks, greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Staging: Silicom: bpctl_mod.c bypass.c: Adding blank lines
On Sun, 2014-05-25 at 21:58 -0700, Chaitanya Hazarey wrote: Added a blank line after declarations in many places to fix the following warning issued by checkpatch.pl: Unrelated trivial note: diff --git a/drivers/staging/silicom/bpctl_mod.c b/drivers/staging/silicom/bpctl_mod.c @@ -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) unnecessary and ugly double brace -- 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/