Re: [PATCH] Staging: dgnc: fix line should not end with a paranthesis in dgnc_tty.c

2018-02-14 Thread Greg KH
On Thu, Feb 15, 2018 at 11:05:08AM +0530, Yash Omer wrote:
> This is a patch to the dgnc_tty.c file that fixes up a paranthesis  warning 
> found by the checkpatch.pl tool.

Please wrap your changelog text at 72 columns, and run it through a
spell checker if possible.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: comedi: fix camelcase issue in range.c

2018-02-14 Thread Greg KH
On Thu, Feb 15, 2018 at 01:36:43AM +0530, Yash Omer wrote:
> This is a patch to the range.c file that fixes up a camelcase warning found 
> bythe checkpatch.pl tool.
> 
> Signed-off-by: Yash Omer 
> ---
>  drivers/staging/comedi/range.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/comedi/range.c b/drivers/staging/comedi/range.c
> index 087bbde7bf12..ec128a6a70bb 100644
> --- a/drivers/staging/comedi/range.c
> +++ b/drivers/staging/comedi/range.c
> @@ -24,7 +24,7 @@ EXPORT_SYMBOL_GPL(range_unipolar5);
>  const struct comedi_lrange range_unipolar2_5 = { 1, {UNI_RANGE(2.5)} };
>  EXPORT_SYMBOL_GPL(range_unipolar2_5);
>  const struct comedi_lrange RANGE_0_20m_A = { 1, {RANGE_m_A(0, 20)} };
> -EXPORT_SYMBOL_GPL(range_0_20mA);
> +EXPORT_SYMBOL_GPL(range_0_20m_A);

That change really does not make that much sense, does it?  Checkpatch
is a hint, you don't want to change wyat "mA" means, right?

And did you test-build this change?  It should not work as-is :(

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: dgnc: fix line should not end with a paranthesis in dgnc_tty.c

2018-02-14 Thread Yash Omer
This is a patch to the dgnc_tty.c file that fixes up a paranthesis  warning 
found by the checkpatch.pl tool.

Signed-off-by: Yash Omer 
---
 drivers/staging/dgnc/dgnc_tty.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 9f9b9a5b4b27..ef6aedadeda3 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -883,8 +883,8 @@ static int dgnc_tty_open(struct tty_struct *tty, struct 
file *file)
 * touched safely, the close routine will signal the
 * ch_flags_wait to wake us back up.
 */
-   rc = wait_event_interruptible(
-   ch->ch_flags_wait,
+   rc = wait_event_interruptible
+   (ch->ch_flags_wait,
(((ch->ch_tun.un_flags |
ch->ch_pun.un_flags) & UN_CLOSING) == 0));
/* If ret is non-zero, user ctrl-c'ed us */
-- 
2.14.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: imx-media-vdic: fix inconsistent IS_ERR and PTR_ERR

2018-02-14 Thread Gustavo A. R. Silva

Hi all,

I was just wondering about the status of this patch.

Thanks
--
Gustavo

On 01/24/2018 06:14 PM, Steve Longerbeam wrote:

Acked-by: Steve Longerbeam 


On 01/23/2018 04:43 PM, Gustavo A. R. Silva wrote:

Fix inconsistent IS_ERR and PTR_ERR in vdic_get_ipu_resources.
The proper pointer to be passed as argument is ch.

This issue was detected with the help of Coccinelle.

Fixes: 0b2e9e7947e7 ("media: staging/imx: remove confusing 
IS_ERR_OR_NULL usage")

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/staging/media/imx/imx-media-vdic.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/imx/imx-media-vdic.c 
b/drivers/staging/media/imx/imx-media-vdic.c

index 433474d..ed35684 100644
--- a/drivers/staging/media/imx/imx-media-vdic.c
+++ b/drivers/staging/media/imx/imx-media-vdic.c
@@ -177,7 +177,7 @@ static int vdic_get_ipu_resources(struct vdic_priv 
*priv)

  priv->vdi_in_ch = ch;
  ch = ipu_idmac_get(priv->ipu, IPUV3_CHANNEL_MEM_VDI_NEXT);
-    if (IS_ERR(priv->vdi_in_ch_n)) {
+    if (IS_ERR(ch)) {
  err_chan = IPUV3_CHANNEL_MEM_VDI_NEXT;
  ret = PTR_ERR(ch);
  goto out_err_chan;




___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: comedi: fix camelcase issue in range.c

2018-02-14 Thread Yash Omer
This is a patch to the range.c file that fixes up a camelcase warning found by  
the checkpatch.pl tool.

Signed-off-by: Yash Omer 
---
 drivers/staging/comedi/range.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/range.c b/drivers/staging/comedi/range.c
index 087bbde7bf12..ec128a6a70bb 100644
--- a/drivers/staging/comedi/range.c
+++ b/drivers/staging/comedi/range.c
@@ -24,7 +24,7 @@ EXPORT_SYMBOL_GPL(range_unipolar5);
 const struct comedi_lrange range_unipolar2_5 = { 1, {UNI_RANGE(2.5)} };
 EXPORT_SYMBOL_GPL(range_unipolar2_5);
 const struct comedi_lrange RANGE_0_20m_A = { 1, {RANGE_m_A(0, 20)} };
-EXPORT_SYMBOL_GPL(range_0_20mA);
+EXPORT_SYMBOL_GPL(range_0_20m_A);
 const struct comedi_lrange range_4_20mA = { 1, {RANGE_mA(4, 20)} };
 EXPORT_SYMBOL_GPL(range_4_20mA);
 const struct comedi_lrange RANGE_0_32m_A = { 1, {RANGE_mA(0, 32)} };
-- 
2.14.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH char-misc 1/1] Drivers: hv: vmbus: Fix ring buffer signaling

2018-02-14 Thread Stephen Hemminger
What about the following simplification. If on older hosts you can avoid more 
code
and the additional barrier. Also cleanup comment wording somewhat.



>From de2d566d9092cbbc8e5974dea581617ef787ff69 Mon Sep 17 00:00:00 2001
From: Michael Kelley 
Date: Sat, 10 Feb 2018 20:48:49 +
Subject: [PATCH 1/9] Drivers: hv: vmbus: Fix ring buffer signaling

Fix bugs in signaling the Hyper-V host when freeing space in the
host->guest ring buffer:

1. The interrupt_mask must not be used to determine whether to signal
   on the host->guest ring buffer
2. The ring buffer write_index must be read (via hv_get_bytes_to_write)
   *after* pending_send_sz is read in order to avoid a race condition
3. Comparisons with pending_send_sz must treat the "equals" case as
   not-enough-space
4. Don't signal if the pending_send_sz feature is not present. Older
   versions of Hyper-V that don't implement this feature will poll.

Fixes: 03bad714a161 ("vmbus: more host signalling avoidance")
Signed-off-by: Michael Kelley 
---
 drivers/hv/ring_buffer.c | 67 +---
 1 file changed, 40 insertions(+), 27 deletions(-)

diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c
index 50e071444a5c..d27cbb66279c 100644
--- a/drivers/hv/ring_buffer.c
+++ b/drivers/hv/ring_buffer.c
@@ -417,13 +417,25 @@ __hv_pkt_iter_next(struct vmbus_channel *channel,
 }
 EXPORT_SYMBOL_GPL(__hv_pkt_iter_next);
 
+/* How many bytes were read in this iterator cycle */
+static u32 hv_pkt_iter_bytes_read(const struct hv_ring_buffer_info *rbi)
+{
+   if (rbi->ring_buffer->read_index < rbi->priv_read_index)
+   return rbi->priv_read_index - rbi->ring_buffer->read_index;
+   else
+   return rbi->ring_datasize -
+   rbi->ring_buffer->read_index + rbi->priv_read_index;
+}
+
 /*
  * Update host ring buffer after iterating over packets.
  */
 void hv_pkt_iter_close(struct vmbus_channel *channel)
 {
struct hv_ring_buffer_info *rbi = >inbound;
-   u32 orig_write_sz = hv_get_bytes_to_write(rbi);
+   u32 curr_write_sz;
+   u32 delta = hv_pkt_iter_bytes_read(rbi);
+   u32 pending_sz;
 
/*
 * Make sure all reads are done before we update the read index since
@@ -433,39 +445,40 @@ void hv_pkt_iter_close(struct vmbus_channel *channel)
virt_rmb();
rbi->ring_buffer->read_index = rbi->priv_read_index;
 
+   /* Older versions do not require signalling */
+   if (!rbi->ring_buffer->feature_bits.feat_pending_send_sz)
+   return;
+
/*
-* Issue a full memory barrier before making the signaling decision.
-* Here is the reason for having this barrier:
-* If the reading of the pend_sz (in this function)
-* were to be reordered and read before we commit the new read
-* index (in the calling function)  we could
-* have a problem. If the host were to set the pending_sz after we
-* have sampled pending_sz and go to sleep before we commit the
-* read index, we could miss sending the interrupt. Issue a full
-* memory barrier to address this.
+* If the reading of the pend_sz were to be reordered and read
+* before we commit the new read index then we would have a
+* problem. If the host were to set the pending_sz after we
+* have sampled pending_sz and go to sleep before we commit
+* the read index, we could miss sending the interrupt.
 */
virt_mb();
 
-   /* If host has disabled notifications then skip */
-   if (rbi->ring_buffer->interrupt_mask)
-   return;
+   pending_sz = READ_ONCE(rbi->ring_buffer->pending_send_sz);
 
-   if (rbi->ring_buffer->feature_bits.feat_pending_send_sz) {
-   u32 pending_sz = READ_ONCE(rbi->ring_buffer->pending_send_sz);
+   /*
+* Ensure the read of write_index in hv_get_bytes_to_write()
+* happens after the read of pending_send_sz.
+*/
+   virt_rmb();
+   curr_write_sz = hv_get_bytes_to_write(rbi);
 
-   /*
-* If there was space before we began iteration,
-* then host was not blocked. Also handles case where
-* pending_sz is zero then host has nothing pending
-* and does not need to be signaled.
-*/
-   if (orig_write_sz > pending_sz)
-   return;
+   /*
+* If there was space before we began iteration,
+* then host was not blocked. Also handles case where
+* pending_sz is zero then host has nothing pending and does
+* not need to be  signaled.
+*/
+   if (curr_write_sz - delta > pending_sz)
+   return;
 
-   /* If pending write will not fit, don't give false hope. */
-   if (hv_get_bytes_to_write(rbi) < pending_sz)
-  

[PATCH 4/6] staging: wilc1000: fix line over 80 characters in wilc_spi_init()

2018-02-14 Thread Ajay Singh
Modified wilc_spi_init() to fix the line over 80 char issues reported
by checkpatch.pl script.
To overcome the checkpatch.pl reported issue modified debug logs and
comments used in wilc_spi_init().

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_spi.c | 18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_spi.c 
b/drivers/staging/wilc1000/wilc_spi.c
index 30a9a61..fddc0db 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -835,7 +835,6 @@ static int wilc_spi_init(struct wilc *wilc, bool resume)
struct spi_device *spi = to_spi_device(wilc->dev);
u32 reg;
u32 chipid;
-
static int isinit;
 
if (isinit) {
@@ -864,20 +863,25 @@ static int wilc_spi_init(struct wilc *wilc, bool resume)
 * is removed but chip isn't reset
 */
g_spi.crc_off = 1;
-   dev_err(>dev, "Failed internal read protocol with CRC on, 
retrying with CRC off...\n");
+   dev_err(>dev,
+   "Failed read with CRC on, retrying with CRC off\n");
if (!spi_internal_read(wilc, WILC_SPI_PROTOCOL_OFFSET, )) {
-   /* Reaad failed with both CRC on and off, something 
went bad */
-   dev_err(>dev,
-   "Failed internal read protocol...\n");
+   /*
+* Read failed with both CRC on and off,
+* something went bad
+*/
+   dev_err(>dev, "Failed internal read protocol\n");
return 0;
}
}
-   if (g_spi.crc_off == 0) {
+   if (g_spi.crc_off == 0) {
reg &= ~0xc; /* disable crc checking */
reg &= ~0x70;
reg |= (0x5 << 4);
if (!spi_internal_write(wilc, WILC_SPI_PROTOCOL_OFFSET, reg)) {
-   dev_err(>dev, "[wilc spi %d]: Failed internal 
write protocol reg...\n", __LINE__);
+   dev_err(>dev,
+   "[wilc spi %d]: Failed internal write reg\n",
+   __LINE__);
return 0;
}
g_spi.crc_off = 1;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 6/6] staging: wilc1000: fix line over 80 chars in wilc_spi_clear_int_ext()

2018-02-14 Thread Ajay Singh
Refactor wilc_spi_clear_int_ext() to fix the "line over 80 char" issue
reported by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_spi.c | 113 +---
 1 file changed, 54 insertions(+), 59 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_spi.c 
b/drivers/staging/wilc1000/wilc_spi.c
index 7c58beb8..6b392c9 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -988,74 +988,69 @@ static int wilc_spi_clear_int_ext(struct wilc *wilc, u32 
val)
 {
struct spi_device *spi = to_spi_device(wilc->dev);
int ret;
+   u32 flags;
+   u32 tbl_ctl;
 
if (g_spi.has_thrpt_enh) {
ret = spi_internal_write(wilc, 0xe844 - WILC_SPI_REG_BASE,
 val);
-   } else {
-   u32 flags;
-
-   flags = val & (BIT(MAX_NUM_INT) - 1);
-   if (flags) {
-   int i;
-
-   ret = 1;
-   for (i = 0; i < g_spi.nint; i++) {
-   /*
-* No matter what you write 1 or 0,
-* it will clear interrupt.
-*/
-   if (flags & 1)
-   ret = wilc_spi_write_reg(wilc, 0x10c8 + 
i * 4, 1);
-   if (!ret)
-   break;
-   flags >>= 1;
-   }
-   if (!ret) {
+   return ret;
+   }
+
+   flags = val & (BIT(MAX_NUM_INT) - 1);
+   if (flags) {
+   int i;
+
+   ret = 1;
+   for (i = 0; i < g_spi.nint; i++) {
+   /*
+* No matter what you write 1 or 0,
+* it will clear interrupt.
+*/
+   if (flags & 1)
+   ret = wilc_spi_write_reg(wilc,
+0x10c8 + i * 4, 1);
+   if (!ret)
+   break;
+   flags >>= 1;
+   }
+   if (!ret) {
+   dev_err(>dev,
+   "Failed wilc_spi_write_reg, set reg %x ...\n",
+   0x10c8 + i * 4);
+   goto _fail_;
+   }
+   for (i = g_spi.nint; i < MAX_NUM_INT; i++) {
+   if (flags & 1)
dev_err(>dev,
-   "Failed wilc_spi_write_reg, set reg %x 
...\n",
-   0x10c8 + i * 4);
-   goto _fail_;
-   }
-   for (i = g_spi.nint; i < MAX_NUM_INT; i++) {
-   if (flags & 1)
-   dev_err(>dev,
-   "Unexpected interrupt cleared 
%d...\n",
-   i);
-   flags >>= 1;
-   }
+   "Unexpected interrupt cleared %d...\n",
+   i);
+   flags >>= 1;
}
+   }
 
-   {
-   u32 tbl_ctl;
-
-   tbl_ctl = 0;
-   /* select VMM table 0 */
-   if ((val & SEL_VMM_TBL0) == SEL_VMM_TBL0)
-   tbl_ctl |= BIT(0);
-   /* select VMM table 1 */
-   if ((val & SEL_VMM_TBL1) == SEL_VMM_TBL1)
-   tbl_ctl |= BIT(1);
+   tbl_ctl = 0;
+   /* select VMM table 0 */
+   if ((val & SEL_VMM_TBL0) == SEL_VMM_TBL0)
+   tbl_ctl |= BIT(0);
+   /* select VMM table 1 */
+   if ((val & SEL_VMM_TBL1) == SEL_VMM_TBL1)
+   tbl_ctl |= BIT(1);
 
-   ret = wilc_spi_write_reg(wilc, WILC_VMM_TBL_CTL,
-tbl_ctl);
-   if (!ret) {
-   dev_err(>dev,
-   "fail write reg vmm_tbl_ctl...\n");
-   goto _fail_;
-   }
+   ret = wilc_spi_write_reg(wilc, WILC_VMM_TBL_CTL, tbl_ctl);
+   if (!ret) {
+   dev_err(>dev, "fail write reg vmm_tbl_ctl...\n");
+   goto _fail_;
+   }
 
-   if ((val & EN_VMM) == EN_VMM) {
-   /*
-* enable vmm transfer.
-*/
-   ret = 

[PATCH 5/6] staging: wilc1000: fix line over 80 characters in wilc_spi_read_int()

2018-02-14 Thread Ajay Singh
Refactor wilc_spi_read_int() to fix the line over 80 char issues reported
by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_spi.c | 57 +++--
 1 file changed, 29 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_spi.c 
b/drivers/staging/wilc1000/wilc_spi.c
index fddc0db..7c58beb8 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -939,45 +939,46 @@ static int wilc_spi_read_int(struct wilc *wilc, u32 
*int_status)
int happened, j;
u32 unknown_mask;
u32 irq_flags;
+   int k = IRG_FLAGS_OFFSET + 5;
 
if (g_spi.has_thrpt_enh) {
ret = spi_internal_read(wilc, 0xe840 - WILC_SPI_REG_BASE,
int_status);
-   } else {
-   ret = wilc_spi_read_reg(wilc, WILC_VMM_TO_HOST_SIZE,
-   _cnt);
-   if (!ret) {
-   dev_err(>dev,
-   "Failed read WILC_VMM_TO_HOST_SIZE ...\n");
-   goto _fail_;
-   }
-   tmp = (byte_cnt >> 2) & IRQ_DMA_WD_CNT_MASK;
+   return ret;
+   }
+   ret = wilc_spi_read_reg(wilc, WILC_VMM_TO_HOST_SIZE, _cnt);
+   if (!ret) {
+   dev_err(>dev,
+   "Failed read WILC_VMM_TO_HOST_SIZE ...\n");
+   goto _fail_;
+   }
+   tmp = (byte_cnt >> 2) & IRQ_DMA_WD_CNT_MASK;
 
-   j = 0;
-   do {
-   happened = 0;
+   j = 0;
+   do {
+   happened = 0;
 
-   wilc_spi_read_reg(wilc, 0x1a90, _flags);
-   tmp |= ((irq_flags >> 27) << IRG_FLAGS_OFFSET);
+   wilc_spi_read_reg(wilc, 0x1a90, _flags);
+   tmp |= ((irq_flags >> 27) << IRG_FLAGS_OFFSET);
 
-   if (g_spi.nint > 5) {
-   wilc_spi_read_reg(wilc, 0x1a94,
- _flags);
-   tmp |= (((irq_flags >> 0) & 0x7) << 
(IRG_FLAGS_OFFSET + 5));
-   }
+   if (g_spi.nint > 5) {
+   wilc_spi_read_reg(wilc, 0x1a94, _flags);
+   tmp |= (((irq_flags >> 0) & 0x7) << k);
+   }
 
-   unknown_mask = ~((1ul << g_spi.nint) - 1);
+   unknown_mask = ~((1ul << g_spi.nint) - 1);
 
-   if ((tmp >> IRG_FLAGS_OFFSET) & unknown_mask) {
-   dev_err(>dev, "Unexpected interrupt (2): 
j=%d, tmp=%x, mask=%x\n", j, tmp, unknown_mask);
-   happened = 1;
-   }
+   if ((tmp >> IRG_FLAGS_OFFSET) & unknown_mask) {
+   dev_err(>dev,
+   "Unexpected interrupt(2):j=%d,tmp=%x,mask=%x\n",
+   j, tmp, unknown_mask);
+   happened = 1;
+   }
 
-   j++;
-   } while (happened);
+   j++;
+   } while (happened);
 
-   *int_status = tmp;
-   }
+   *int_status = tmp;
 
 _fail_:
return ret;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/6] staging: wilc1000: modified code comments as per linux coding style

2018-02-14 Thread Ajay Singh
Cleanup patch to follow the comments style as per the Linux coding
style.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_spi.c | 151 
 1 file changed, 82 insertions(+), 69 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_spi.c 
b/drivers/staging/wilc1000/wilc_spi.c
index 8f71a60..5d0de4e 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -422,9 +422,9 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 
adr, u8 *b, u32 sz,
return N_FAIL;
}
 
-   /**
+   /*
 * Command/Control response
-**/
+*/
if (cmd == CMD_RESET ||
cmd == CMD_TERMINATE ||
cmd == CMD_REPEAT) {
@@ -443,9 +443,9 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 
adr, u8 *b, u32 sz,
return N_FAIL;
}
 
-   /**
+   /*
 * State response
-**/
+*/
rsp = rb[rix++];
if (rsp != 0x00) {
dev_err(>dev, "Failed cmd state response state (%02x)\n",
@@ -458,12 +458,15 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, 
u32 adr, u8 *b, u32 sz,
int retry;
/* u16 crc1, crc2; */
u8 crc[2];
-   /**
+   /*
 * Data Respnose header
-**/
+*/
retry = 100;
do {
-   /* ensure there is room in buffer later to read data 
and crc */
+   /*
+* ensure there is room in buffer later
+* to read data and crc
+*/
if (rix < len2) {
rsp = rb[rix++];
} else {
@@ -481,9 +484,9 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 
adr, u8 *b, u32 sz,
}
 
if (cmd == CMD_INTERNAL_READ || cmd == CMD_SINGLE_READ) {
-   /**
+   /*
 * Read bytes
-**/
+*/
if ((rix + 3) < len2) {
b[0] = rb[rix++];
b[1] = rb[rix++];
@@ -496,9 +499,9 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 
adr, u8 *b, u32 sz,
}
 
if (!g_spi.crc_off) {
-   /**
+   /*
 * Read Crc
-**/
+*/
if ((rix + 1) < len2) {
crc[0] = rb[rix++];
crc[1] = rb[rix++];
@@ -524,18 +527,18 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, 
u32 adr, u8 *b, u32 sz,
else
nbytes = DATA_PKT_SZ - ix;
 
-   /**
+   /*
 * Read bytes
-**/
+*/
if (wilc_spi_rx(wilc, [ix], nbytes)) {
dev_err(>dev, "Failed data block 
read, bus error...\n");
result = N_FAIL;
goto _error_;
}
 
-   /**
+   /*
 * Read Crc
-**/
+*/
if (!g_spi.crc_off) {
if (wilc_spi_rx(wilc, crc, 2)) {
dev_err(>dev, "Failed data 
block crc read, bus error...\n");
@@ -548,7 +551,10 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 
adr, u8 *b, u32 sz,
sz -= nbytes;
}
 
-   /*  if any data in left unread, then read the rest 
using normal DMA code.*/
+   /*
+* if any data in left unread,
+* then read the rest using normal DMA code.
+*/
while (sz > 0) {
int nbytes;
 
@@ -557,14 +563,14 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, 
u32 adr, u8 *b, u32 sz,
else
nbytes = DATA_PKT_SZ;
 
-   /**
+   /*
 * read data response only on the next DMA 
cycles not
 * the first 

[PATCH 2/6] staging: wilc1000: removed the unnecessary commented code

2018-02-14 Thread Ajay Singh
Cleanup patch to remove the unused commented code.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_spi.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_spi.c 
b/drivers/staging/wilc1000/wilc_spi.c
index 5d0de4e..66b6aea 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -431,10 +431,7 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 
adr, u8 *b, u32 sz,
rix++; /* skip 1 byte */
}
 
-   /* do { */
rsp = rb[rix++];
-   /*  if(rsp == cmd) break; */
-   /* } while([1] <= [len2]); */
 
if (rsp != cmd) {
dev_err(>dev,
@@ -456,7 +453,6 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 
adr, u8 *b, u32 sz,
if (cmd == CMD_INTERNAL_READ || cmd == CMD_SINGLE_READ ||
cmd == CMD_DMA_READ || cmd == CMD_DMA_EXT_READ) {
int retry;
-   /* u16 crc1, crc2; */
u8 crc[2];
/*
 * Data Respnose header
@@ -620,7 +616,6 @@ static int spi_data_write(struct wilc *wilc, u8 *b, u32 sz)
int ix, nbytes;
int result = 1;
u8 cmd, order, crc[2] = {0};
-   /* u8 rsp; */
 
/*
 * Data
@@ -897,7 +892,6 @@ static int wilc_spi_init(struct wilc *wilc, bool resume)
dev_err(>dev, "Fail cmd read chip id...\n");
return 0;
}
-   /* dev_err(>dev, "chipid (%08x)\n", chipid); */
 
g_spi.has_thrpt_enh = 1;
 
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/6] fix line over 80 char & coding style in wilc_spi.c

2018-02-14 Thread Ajay Singh
This patch series contains changes to remove "fix line over 80 char"
issues found by checkpatch.pl script.
Also, few changes code changes are done to follow Linux coding style.

Ajay Singh (6):
  staging: wilc1000: modified code comments as per linux coding style
  staging: wilc1000: removed the unnecessary commented code
  staging: wilc1000: fix line over 80 characters in spi_cmd_complete()
  staging: wilc1000: fix line over 80 characters in wilc_spi_init()
  staging: wilc1000: fix line over 80 characters in wilc_spi_read_int()
  staging: wilc1000: fix line over 80 chars in wilc_spi_clear_int_ext()

 drivers/staging/wilc1000/wilc_spi.c | 551 ++--
 1 file changed, 278 insertions(+), 273 deletions(-)

-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel