[PATCH 3.19.0-rc3 1/1] STAGING: Fix pcl818.c coding style issue

2015-01-09 Thread Simon Guo
Correct coding style problem in pcl818.c. The coding style problems(29 
warnings detected by checkpatch.pl) includes:
- line over 80 characters
- There is space before tabs
The changed file has been verified with checkpatch.pl to be clean for 
warnings/errors.

Signed-off-by: Simon Guo 
---
 drivers/staging/comedi/drivers/pcl818.c | 50 -
 1 file changed, 30 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index 8edea35..111bee1 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -45,11 +45,11 @@ A word or two about DMA. Driver support DMA operations at 
two ways:
 [1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
 [2] - DMA  (0=disable, 1, 3)
 [3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
+ 1= 1MHz clock for 8254
 [4] - 0,  5=A/D input  -5V.. +5V
-  1, 10=A/D input -10V..+10V
+ 1, 10=A/D input -10V..+10V
 [5] - 0,  5=D/A output 0-5V  (internal reference -5V)
-  1, 10=D/A output 0-10V (internal reference -10V)
+ 1, 10=D/A output 0-10V (internal reference -10V)
  2=D/A output unknown (external reference)
 
Options for PCL-818, PCL-818H:
@@ -57,44 +57,44 @@ A word or two about DMA. Driver support DMA operations at 
two ways:
 [1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
 [2] - DMA  (0=disable, 1, 3)
 [3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
+ 1= 1MHz clock for 8254
 [4] - 0,  5=D/A output 0-5V  (internal reference -5V)
-  1, 10=D/A output 0-10V (internal reference -10V)
+ 1, 10=D/A output 0-10V (internal reference -10V)
  2=D/A output unknown (external reference)
 
Options for PCL-818HD, PCL-818HG:
 [0] - IO Base
 [1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
 [2] - DMA/FIFO  (-1=use FIFO, 0=disable both FIFO and DMA,
-  1=use DMA ch 1, 3=use DMA ch 3)
+ 1=use DMA ch 1, 3=use DMA ch 3)
 [3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
+ 1= 1MHz clock for 8254
 [4] - 0,  5=D/A output 0-5V  (internal reference -5V)
-  1, 10=D/A output 0-10V (internal reference -10V)
- 2=D/A output unknown (external reference)
+ 1, 10=D/A output 0-10V (internal reference -10V)
+ 2=D/A output unknown (external reference)
 
Options for PCL-718:
 [0] - IO Base
 [1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
 [2] - DMA  (0=disable, 1, 3)
 [3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
+ 1= 1MHz clock for 8254
 [4] - 0=A/D Range is +/-10V
  1= +/-5V
  2= +/-2.5V
  3= +/-1V
  4= +/-0.5V
- 5= user defined bipolar
+ 5= user defined bipolar
  6= 0-10V
  7= 0-5V
- 8= 0-2V
+ 8= 0-2V
  9= 0-1V
 10= user defined unipolar
 [5] - 0,  5=D/A outputs 0-5V  (internal reference -5V)
-  1, 10=D/A outputs 0-10V (internal reference -10V)
+ 1, 10=D/A outputs 0-10V (internal reference -10V)
  2=D/A outputs unknown (external reference)
 [6] - 0, 60=max  60kHz A/D sampling
-  1,100=max 100kHz A/D sampling (PCL-718 with Option 001 installed)
+ 1,100=max 100kHz A/D sampling (PCL-718 with Option 001 installed)
 
 */
 
@@ -309,11 +309,19 @@ struct pcl818_private {
unsigned long dmabuf[2];/*  pointers to begin of DMA buffers */
unsigned int hwdmaptr[2];   /*  hardware address of DMA buffers */
int next_dma_buf;   /*  which DMA buffer will be used next round */
-   long dma_runs_to_end;   /*  how many we must permorm DMA transfer to 
end of record */
-   unsigned long last_dma_run; /*  how many bytes we must transfer on 
last DMA page */
-   unsigned int ns_min;/*  manimal allowed delay between samples (in 
us) for actual card */
+   long dma_runs_to_end;   /*  how many we must permorm DMA transfer
+*  to end of record
+*/
+   unsigned long last_dma_run; /*  how many bytes we must transfer
+*  on last DMA page
+*/
+   unsigned int ns_min;/*  manimal allowed delay between
+*  samples (in us) for actual card
+*/
int i8253_osc_base; /*  1/frequency of on board oscilator in ns */
-   unsigned int act_chanlist[16];  /*  MUX setting for actual AI 
operations */
+   unsigned int act_chanlist[16];  /*  MUX

[PATCH 4.1.0-rc4] STAGING: Delare request_cache as static for drivers/staging/lustre/lustre/ptlrpc/client.c

2015-05-27 Thread Simon Guo
Delare request_cache variable as static. It is only used by
drivers/staging/lustre/lustre/ptlrpc/client.c, and its naming is common
which will lead to namespace pollution.

Signed-off-by: Simon Guo 
---
 drivers/staging/lustre/lustre/ptlrpc/client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c 
b/drivers/staging/lustre/lustre/ptlrpc/client.c
index 45b7af7..347110e 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/client.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/client.c
@@ -390,7 +390,7 @@ static int ptlrpc_at_recv_early_reply(struct ptlrpc_request 
*req)
return rc;
 }
 
-struct kmem_cache *request_cache;
+static struct kmem_cache *request_cache;
 
 int ptlrpc_request_cache_init(void)
 {
-- 
1.8.1.2

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


[PATCH 4.1.0-rc4] STAGING: Declare request_cache as static for drivers/staging/lustre/lustre/ptlrpc/client.c

2015-05-30 Thread Simon Guo
Declare request_cache variable as static. It is only used by
drivers/staging/lustre/lustre/ptlrpc/client.c, and its naming is common
which will lead to namespace pollution.

Signed-off-by: Simon Guo 
---
 drivers/staging/lustre/lustre/ptlrpc/client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c 
b/drivers/staging/lustre/lustre/ptlrpc/client.c
index 45b7af7..347110e 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/client.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/client.c
@@ -390,7 +390,7 @@ static int ptlrpc_at_recv_early_reply(struct ptlrpc_request 
*req)
return rc;
 }
 
-struct kmem_cache *request_cache;
+static struct kmem_cache *request_cache;
 
 int ptlrpc_request_cache_init(void)
 {
-- 
1.8.1.2

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


[PATCH 3.19.0-rc5 01/03] STAGING: Fix pcl818.c coding style issue: code indent should use tabs where possible

2015-01-25 Thread Simon Guo
Correct one coding style problem(detected by checkpatch.pl) in pcl818.c.
- code indent should use tabs where possible

Signed-off-by: Simon Guo 
---
 drivers/staging/comedi/drivers/pcl818.c | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index ba2e137..72a700c 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -45,11 +45,11 @@ A word or two about DMA. Driver support DMA operations at 
two ways:
 [1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
 [2] - DMA  (0=disable, 1, 3)
 [3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
+ 1= 1MHz clock for 8254
 [4] - 0,  5=A/D input  -5V.. +5V
-  1, 10=A/D input -10V..+10V
+ 1, 10=A/D input -10V..+10V
 [5] - 0,  5=D/A output 0-5V  (internal reference -5V)
-  1, 10=D/A output 0-10V (internal reference -10V)
+ 1, 10=D/A output 0-10V (internal reference -10V)
  2=D/A output unknown (external reference)
 
Options for PCL-818, PCL-818H:
@@ -57,28 +57,28 @@ A word or two about DMA. Driver support DMA operations at 
two ways:
 [1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
 [2] - DMA  (0=disable, 1, 3)
 [3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
+ 1= 1MHz clock for 8254
 [4] - 0,  5=D/A output 0-5V  (internal reference -5V)
-  1, 10=D/A output 0-10V (internal reference -10V)
+ 1, 10=D/A output 0-10V (internal reference -10V)
  2=D/A output unknown (external reference)
 
Options for PCL-818HD, PCL-818HG:
 [0] - IO Base
 [1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
 [2] - DMA/FIFO  (-1=use FIFO, 0=disable both FIFO and DMA,
-  1=use DMA ch 1, 3=use DMA ch 3)
+ 1=use DMA ch 1, 3=use DMA ch 3)
 [3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
+ 1= 1MHz clock for 8254
 [4] - 0,  5=D/A output 0-5V  (internal reference -5V)
-  1, 10=D/A output 0-10V (internal reference -10V)
- 2=D/A output unknown (external reference)
+ 1, 10=D/A output 0-10V (internal reference -10V)
+ 2=D/A output unknown (external reference)
 
Options for PCL-718:
 [0] - IO Base
 [1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
 [2] - DMA  (0=disable, 1, 3)
 [3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
+ 1= 1MHz clock for 8254
 [4] - 0=A/D Range is +/-10V
  1= +/-5V
  2= +/-2.5V
@@ -87,14 +87,14 @@ A word or two about DMA. Driver support DMA operations at 
two ways:
  5= user defined bipolar
  6= 0-10V
  7= 0-5V
- 8= 0-2V
+ 8= 0-2V
  9= 0-1V
 10= user defined unipolar
 [5] - 0,  5=D/A outputs 0-5V  (internal reference -5V)
-  1, 10=D/A outputs 0-10V (internal reference -10V)
+ 1, 10=D/A outputs 0-10V (internal reference -10V)
  2=D/A outputs unknown (external reference)
 [6] - 0, 60=max  60kHz A/D sampling
-  1,100=max 100kHz A/D sampling (PCL-718 with Option 001 installed)
+ 1,100=max 100kHz A/D sampling (PCL-718 with Option 001 installed)
 
 */
 
-- 
1.8.1.2

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


[PATCH 3.19.0-rc5 02/03] STAGING: Fix pcl818.c coding style issue: line over 80 characters

2015-01-25 Thread Simon Guo
Correct one coding style problem(detected by checkpatch.pl) in pcl818.c.
- line over 80 characters

Signed-off-by: Simon Guo 
---
 drivers/staging/comedi/drivers/pcl818.c | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index 72a700c..0873617 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -304,9 +304,13 @@ static const struct pcl818_board boardtypes[] = {
 
 struct pcl818_private {
struct comedi_isadma *dma;
-   unsigned int ns_min;/*  manimal allowed delay between samples (in 
us) for actual card */
+   unsigned int ns_min;/*  manimal allowed delay between samples
+*  (in us) for actual card
+*/
int i8253_osc_base; /*  1/frequency of on board oscilator in ns */
-   unsigned int act_chanlist[16];  /*  MUX setting for actual AI 
operations */
+   unsigned int act_chanlist[16];  /*  MUX setting for actual
+*  AI operations
+*/
unsigned int act_chanlist_len;  /*  how long is actual MUX list */
unsigned int act_chanlist_pos;  /*  actual position in MUX list */
unsigned int divisor1;
@@ -648,7 +652,8 @@ static int check_channel_list(struct comedi_device *dev,
break;
nowmustbechan =
(CR_CHAN(chansegment[i - 1]) + 1) % s->n_chan;
-   if (nowmustbechan != CR_CHAN(chanlist[i])) {/*  
channel list isn't continuous :-( */
+   if (nowmustbechan != CR_CHAN(chanlist[i])) {
+   /*  channel list isn't continuous :-( */
dev_dbg(dev->class_dev,
"channel list must be continuous! 
chanlist[%i]=%d but must be %d or %d!\n",
i, CR_CHAN(chanlist[i]), nowmustbechan,
@@ -1154,8 +1159,9 @@ static int pcl818_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
devpriv->ns_min = board->ns_min;
 
if (!board->is_818) {
+   /* extended PCL718 to 100kHz DAC */
if ((it->options[6] == 1) || (it->options[6] == 100))
-   devpriv->ns_min = 1;/* extended PCL718 to 
100kHz DAC */
+   devpriv->ns_min = 1;
}
 
pcl818_reset(dev);
-- 
1.8.1.2

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


[PATCH 3.19.0-rc5 03/03] STAGING: Fix pcl818.c coding style issue: no space before tabs

2015-01-25 Thread Simon Guo
Correct one coding style problem(detected by checkpatch.pl) in pcl818.c.
- please, no space before tabs

Signed-off-by: Simon Guo 
---
 drivers/staging/comedi/drivers/pcl818.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index 0873617..a1f366f 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -84,7 +84,7 @@ A word or two about DMA. Driver support DMA operations at two 
ways:
  2= +/-2.5V
  3= +/-1V
  4= +/-0.5V
- 5= user defined bipolar
+ 5= user defined bipolar
  6= 0-10V
  7= 0-5V
  8= 0-2V
-- 
1.8.1.2

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


Re: [PATCH 3.19.0-rc5 01/03] STAGING: Fix pcl818.c coding style issue: code indent should use tabs where possible

2015-01-26 Thread Simon Guo

Ian,

At 2015/1/26 19:31, Ian Abbott wrote:


Okay, but this comment block really needs reformatting to use the usual
block comment style, and with spaces to line up the columns instead of
tabs so it still looks okay when the " * " is removed from the start of
each line of the block comment.

Reviewed-by: Ian Abbott 



Thanks for your comments for my patch 1~3. I will rework and resend the 
3 patches.


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


[PATCH 3.19.0-rc5 01/03] STAGING: Fix pcl818.c coding style issue: code indent should use tabs where possible

2015-01-26 Thread Simon Guo
Correct one coding style problem(detected by checkpatch.pl) in pcl818.c.
- code indent should use tabs where possible
It is fixed by reformatting the comment block to usual comment style.

Signed-off-by: Simon Guo 
---
 drivers/staging/comedi/drivers/pcl818.c | 195 
 1 file changed, 97 insertions(+), 98 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index ba2e137..5a005e5 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -1,102 +1,101 @@
 /*
-   comedi/drivers/pcl818.c
-
-   Author:  Michal Dobes 
-
-   hardware driver for Advantech cards:
-card:   PCL-818L, PCL-818H, PCL-818HD, PCL-818HG, PCL-818, PCL-718
-driver: pcl818l,  pcl818h,  pcl818hd,  pcl818hg,  pcl818,  pcl718
-*/
-/*
-Driver: pcl818
-Description: Advantech PCL-818 cards, PCL-718
-Author: Michal Dobes 
-Devices: [Advantech] PCL-818L (pcl818l), PCL-818H (pcl818h),
-  PCL-818HD (pcl818hd), PCL-818HG (pcl818hg), PCL-818 (pcl818),
-  PCL-718 (pcl718)
-Status: works
-
-All cards have 16 SE/8 DIFF ADCs, one or two DACs, 16 DI and 16 DO.
-Differences are only at maximal sample speed, range list and FIFO
-support.
-The driver support AI mode 0, 1, 3 other subdevices (AO, DI, DO) support
-only mode 0. If DMA/FIFO/INT are disabled then AI support only mode 0.
-PCL-818HD and PCL-818HG support 1kword FIFO. Driver support this FIFO
-but this code is untested.
-A word or two about DMA. Driver support DMA operations at two ways:
-1) DMA uses two buffers and after one is filled then is generated
-   INT and DMA restart with second buffer. With this mode I'm unable run
-   more that 80Ksamples/secs without data dropouts on K6/233.
-2) DMA uses one buffer and run in autoinit mode and the data are
-   from DMA buffer moved on the fly with 2kHz interrupts from RTC.
-   This mode is used if the interrupt 8 is available for allocation.
-   If not, then first DMA mode is used. With this I can run at
-   full speed one card (100ksamples/secs) or two cards with
-   60ksamples/secs each (more is problem on account of ISA limitations).
-   To use this mode you must have compiled  kernel with disabled
-   "Enhanced Real Time Clock Support".
-   Maybe you can have problems if you use xntpd or similar.
-   If you've data dropouts with DMA mode 2 then:
-a) disable IDE DMA
-b) switch text mode console to fb.
-
-   Options for PCL-818L:
-[0] - IO Base
-[1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
-[2] - DMA  (0=disable, 1, 3)
-[3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
-[4] - 0,  5=A/D input  -5V.. +5V
-  1, 10=A/D input -10V..+10V
-[5] - 0,  5=D/A output 0-5V  (internal reference -5V)
-  1, 10=D/A output 0-10V (internal reference -10V)
- 2=D/A output unknown (external reference)
-
-   Options for PCL-818, PCL-818H:
-[0] - IO Base
-[1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
-[2] - DMA  (0=disable, 1, 3)
-[3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
-[4] - 0,  5=D/A output 0-5V  (internal reference -5V)
-  1, 10=D/A output 0-10V (internal reference -10V)
- 2=D/A output unknown (external reference)
-
-   Options for PCL-818HD, PCL-818HG:
-[0] - IO Base
-[1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
-[2] - DMA/FIFO  (-1=use FIFO, 0=disable both FIFO and DMA,
-  1=use DMA ch 1, 3=use DMA ch 3)
-[3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
-[4] - 0,  5=D/A output 0-5V  (internal reference -5V)
-  1, 10=D/A output 0-10V (internal reference -10V)
- 2=D/A output unknown (external reference)
-
-   Options for PCL-718:
-[0] - IO Base
-[1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
-[2] - DMA  (0=disable, 1, 3)
-[3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
-[4] - 0=A/D Range is +/-10V
- 1= +/-5V
- 2= +/-2.5V
- 3= +/-1V
- 4= +/-0.5V
- 5= user defined bipolar
- 6= 0-10V
- 7= 0-5V
- 8= 0-2V
- 9= 0-1V
-10= user defined unipolar
-[5] - 0,  5=D/A outputs 0-5V  (internal reference -5V)
-  1, 10=D/A outputs 0-10V (internal reference -10V)
- 2=D/A outputs unknown (external reference)
-[6] - 0, 60=max  60kHz A/D sampling
-  1,100=max 100kHz A/D sampling (PCL-718 with Option 001 installed)
-
-*/
+ * comedi/drivers/pcl818.c
+ *
+ * Author:  Michal Dobes 
+ *
+ * hardware driver for Advantech cards:
+ *  card:   PCL-818L, PCL-818H, PCL-818HD, PCL-818HG, PCL-818, PCL-718
+ *  driver: pcl818l,  pcl818h,  pcl818hd,  pcl818hg,  pcl818,  pcl718
+
+ * Driver: pcl818
+ * Description: Advantech PC

[PATCH 3.19.0-rc5 02/03] STAGING: Fix pcl818.c coding style issue: line over 80 characters

2015-01-26 Thread Simon Guo
Correct one coding style problem(detected by checkpatch.pl) in pcl818.c.
- line over 80 characters

Signed-off-by: Simon Guo 
---
 drivers/staging/comedi/drivers/pcl818.c | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index 5a005e5..bc8493f 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -303,9 +303,11 @@ static const struct pcl818_board boardtypes[] = {
 
 struct pcl818_private {
struct comedi_isadma *dma;
-   unsigned int ns_min;/*  manimal allowed delay between samples (in 
us) for actual card */
+   /*  manimal allowed delay between samples (in us) for actual card */
+   unsigned int ns_min;
int i8253_osc_base; /*  1/frequency of on board oscilator in ns */
-   unsigned int act_chanlist[16];  /*  MUX setting for actual AI 
operations */
+   /*  MUX setting for actual AI operations */
+   unsigned int act_chanlist[16];
unsigned int act_chanlist_len;  /*  how long is actual MUX list */
unsigned int act_chanlist_pos;  /*  actual position in MUX list */
unsigned int divisor1;
@@ -647,7 +649,8 @@ static int check_channel_list(struct comedi_device *dev,
break;
nowmustbechan =
(CR_CHAN(chansegment[i - 1]) + 1) % s->n_chan;
-   if (nowmustbechan != CR_CHAN(chanlist[i])) {/*  
channel list isn't continuous :-( */
+   if (nowmustbechan != CR_CHAN(chanlist[i])) {
+   /*  channel list isn't continuous :-( */
dev_dbg(dev->class_dev,
"channel list must be continuous! 
chanlist[%i]=%d but must be %d or %d!\n",
i, CR_CHAN(chanlist[i]), nowmustbechan,
@@ -1153,8 +1156,10 @@ static int pcl818_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
devpriv->ns_min = board->ns_min;
 
if (!board->is_818) {
-   if ((it->options[6] == 1) || (it->options[6] == 100))
-   devpriv->ns_min = 1;/* extended PCL718 to 
100kHz DAC */
+   if ((it->options[6] == 1) || (it->options[6] == 100)) {
+   /* extended PCL718 to 100kHz DAC */
+   devpriv->ns_min = 1;
+   }
}
 
pcl818_reset(dev);
-- 
1.8.1.2

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


[PATCH 3.19.0-rc5 03/03] STAGING: Fix pcl818.c coding style issue: no space before tabs

2015-01-26 Thread Simon Guo
Correct one coding style problem(detected by checkpatch.pl) in pcl818.c.
- please, no space before tabs

Signed-off-by: Simon Guo 
---
 drivers/staging/comedi/drivers/pcl818.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index bc8493f..4104f47 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -83,7 +83,7 @@
  *   2= +/-2.5V
  *   3= +/-1V
  *   4= +/-0.5V
- *   5= user defined bipolar
+ *   5=  user defined bipolar
  *   6= 0-10V
  *   7= 0-5V
  *   8= 0-2V
-- 
1.8.1.2

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


[PATCH 3.19.0-rc5 01/02] STAGING: Fix pcl818.c coding style issue: code indent should use tabs where possible

2015-01-27 Thread Simon Guo

Correct one coding style problem(detected by checkpatch.pl) in pcl818.c.
- code indent should use tabs where possible
It is fixed by reformatting the comment block to usual comment style.

And with the reformatting, following coding style problem is also fixed:
- please, no space before tabs

Signed-off-by: Simon Guo 
---
 drivers/staging/comedi/drivers/pcl818.c | 189 +++-
 1 file changed, 91 insertions(+), 98 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index ba2e137..5d9050c 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -1,102 +1,95 @@
 /*
-   comedi/drivers/pcl818.c
-
-   Author:  Michal Dobes 
-
-   hardware driver for Advantech cards:
-card:   PCL-818L, PCL-818H, PCL-818HD, PCL-818HG, PCL-818, PCL-718
-driver: pcl818l,  pcl818h,  pcl818hd,  pcl818hg,  pcl818,  pcl718
-*/
-/*
-Driver: pcl818
-Description: Advantech PCL-818 cards, PCL-718
-Author: Michal Dobes 
-Devices: [Advantech] PCL-818L (pcl818l), PCL-818H (pcl818h),
-  PCL-818HD (pcl818hd), PCL-818HG (pcl818hg), PCL-818 (pcl818),
-  PCL-718 (pcl718)
-Status: works
-
-All cards have 16 SE/8 DIFF ADCs, one or two DACs, 16 DI and 16 DO.
-Differences are only at maximal sample speed, range list and FIFO
-support.
-The driver support AI mode 0, 1, 3 other subdevices (AO, DI, DO) support
-only mode 0. If DMA/FIFO/INT are disabled then AI support only mode 0.
-PCL-818HD and PCL-818HG support 1kword FIFO. Driver support this FIFO
-but this code is untested.
-A word or two about DMA. Driver support DMA operations at two ways:
-1) DMA uses two buffers and after one is filled then is generated
-   INT and DMA restart with second buffer. With this mode I'm unable run
-   more that 80Ksamples/secs without data dropouts on K6/233.
-2) DMA uses one buffer and run in autoinit mode and the data are
-   from DMA buffer moved on the fly with 2kHz interrupts from RTC.
-   This mode is used if the interrupt 8 is available for allocation.
-   If not, then first DMA mode is used. With this I can run at
-   full speed one card (100ksamples/secs) or two cards with
-   60ksamples/secs each (more is problem on account of ISA limitations).
-   To use this mode you must have compiled  kernel with disabled
-   "Enhanced Real Time Clock Support".
-   Maybe you can have problems if you use xntpd or similar.
-   If you've data dropouts with DMA mode 2 then:
-a) disable IDE DMA
-b) switch text mode console to fb.
-
-   Options for PCL-818L:
-[0] - IO Base
-[1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
-[2] - DMA  (0=disable, 1, 3)
-[3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
-[4] - 0,  5=A/D input  -5V.. +5V
-  1, 10=A/D input -10V..+10V
-[5] - 0,  5=D/A output 0-5V  (internal reference -5V)
-  1, 10=D/A output 0-10V (internal reference -10V)
- 2=D/A output unknown (external reference)
-
-   Options for PCL-818, PCL-818H:
-[0] - IO Base
-[1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
-[2] - DMA  (0=disable, 1, 3)
-[3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
-[4] - 0,  5=D/A output 0-5V  (internal reference -5V)
-  1, 10=D/A output 0-10V (internal reference -10V)
- 2=D/A output unknown (external reference)
-
-   Options for PCL-818HD, PCL-818HG:
-[0] - IO Base
-[1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
-[2] - DMA/FIFO  (-1=use FIFO, 0=disable both FIFO and DMA,
-  1=use DMA ch 1, 3=use DMA ch 3)
-[3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
-[4] - 0,  5=D/A output 0-5V  (internal reference -5V)
-  1, 10=D/A output 0-10V (internal reference -10V)
- 2=D/A output unknown (external reference)
-
-   Options for PCL-718:
-[0] - IO Base
-[1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
-[2] - DMA  (0=disable, 1, 3)
-[3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
-[4] - 0=A/D Range is +/-10V
- 1= +/-5V
- 2= +/-2.5V
- 3= +/-1V
- 4= +/-0.5V
- 5= user defined bipolar
- 6= 0-10V
- 7= 0-5V
- 8= 0-2V
- 9= 0-1V
-10= user defined unipolar
-[5] - 0,  5=D/A outputs 0-5V  (internal reference -5V)
-  1, 10=D/A outputs 0-10V (internal reference -10V)
- 2=D/A outputs unknown (external reference)
-[6] - 0, 60=max  60kHz A/D sampling
-  1,100=max 100kHz A/D sampling (PCL-718 with Option 001 installed)
-
-*/
+ * comedi/drivers/pcl818.c
+ *
+ * Driver: pcl818
+ * Description: Advantech PCL-818 cards, PCL-718
+ * Author: Michal Dobes 
+ * Devices: [Advantech] PCL-818L (pcl818l), PCL-818H (pcl81

[PATCH 3.19.0-rc5 02/02] STAGING: Fix pcl818.c coding style issue: line over 80 characters

2015-01-27 Thread Simon Guo
Correct one coding style problem(detected by checkpatch.pl) in pcl818.c.
- line over 80 characters

Signed-off-by: Simon Guo 
---
 drivers/staging/comedi/drivers/pcl818.c | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index 5d9050c..2b8a05e 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -297,9 +297,11 @@ static const struct pcl818_board boardtypes[] = {
 
 struct pcl818_private {
struct comedi_isadma *dma;
-   unsigned int ns_min;/*  manimal allowed delay between samples (in 
us) for actual card */
+   /*  manimal allowed delay between samples (in us) for actual card */
+   unsigned int ns_min;
int i8253_osc_base; /*  1/frequency of on board oscilator in ns */
-   unsigned int act_chanlist[16];  /*  MUX setting for actual AI 
operations */
+   /*  MUX setting for actual AI operations */
+   unsigned int act_chanlist[16];
unsigned int act_chanlist_len;  /*  how long is actual MUX list */
unsigned int act_chanlist_pos;  /*  actual position in MUX list */
unsigned int divisor1;
@@ -641,7 +643,8 @@ static int check_channel_list(struct comedi_device *dev,
break;
nowmustbechan =
(CR_CHAN(chansegment[i - 1]) + 1) % s->n_chan;
-   if (nowmustbechan != CR_CHAN(chanlist[i])) {/*  
channel list isn't continuous :-( */
+   if (nowmustbechan != CR_CHAN(chanlist[i])) {
+   /*  channel list isn't continuous :-( */
dev_dbg(dev->class_dev,
"channel list must be continuous! 
chanlist[%i]=%d but must be %d or %d!\n",
i, CR_CHAN(chanlist[i]), nowmustbechan,
@@ -1147,8 +1150,10 @@ static int pcl818_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
devpriv->ns_min = board->ns_min;
 
if (!board->is_818) {
-   if ((it->options[6] == 1) || (it->options[6] == 100))
-   devpriv->ns_min = 1;/* extended PCL718 to 
100kHz DAC */
+   if ((it->options[6] == 1) || (it->options[6] == 100)) {
+   /* extended PCL718 to 100kHz DAC */
+   devpriv->ns_min = 1;
+   }
}
 
pcl818_reset(dev);
-- 
1.8.1.2

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


[PATCH v2 01/02] STAGING: Fix pcl818.c coding style issue: code indent should use tabs where possible

2015-01-28 Thread Simon Guo
Correct one coding style problem(detected by checkpatch.pl) in pcl818.c.
- code indent should use tabs where possible
It is fixed by reformatting the comment block to usual comment style.

And with the reformatting, following coding style problem is also fixed:
- please, no space before tabs

Signed-off-by: Simon Guo 
---
 drivers/staging/comedi/drivers/pcl818.c | 189 +++-
 1 file changed, 91 insertions(+), 98 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index ba2e137..5d9050c 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -1,102 +1,95 @@
 /*
-   comedi/drivers/pcl818.c
-
-   Author:  Michal Dobes 
-
-   hardware driver for Advantech cards:
-card:   PCL-818L, PCL-818H, PCL-818HD, PCL-818HG, PCL-818, PCL-718
-driver: pcl818l,  pcl818h,  pcl818hd,  pcl818hg,  pcl818,  pcl718
-*/
-/*
-Driver: pcl818
-Description: Advantech PCL-818 cards, PCL-718
-Author: Michal Dobes 
-Devices: [Advantech] PCL-818L (pcl818l), PCL-818H (pcl818h),
-  PCL-818HD (pcl818hd), PCL-818HG (pcl818hg), PCL-818 (pcl818),
-  PCL-718 (pcl718)
-Status: works
-
-All cards have 16 SE/8 DIFF ADCs, one or two DACs, 16 DI and 16 DO.
-Differences are only at maximal sample speed, range list and FIFO
-support.
-The driver support AI mode 0, 1, 3 other subdevices (AO, DI, DO) support
-only mode 0. If DMA/FIFO/INT are disabled then AI support only mode 0.
-PCL-818HD and PCL-818HG support 1kword FIFO. Driver support this FIFO
-but this code is untested.
-A word or two about DMA. Driver support DMA operations at two ways:
-1) DMA uses two buffers and after one is filled then is generated
-   INT and DMA restart with second buffer. With this mode I'm unable run
-   more that 80Ksamples/secs without data dropouts on K6/233.
-2) DMA uses one buffer and run in autoinit mode and the data are
-   from DMA buffer moved on the fly with 2kHz interrupts from RTC.
-   This mode is used if the interrupt 8 is available for allocation.
-   If not, then first DMA mode is used. With this I can run at
-   full speed one card (100ksamples/secs) or two cards with
-   60ksamples/secs each (more is problem on account of ISA limitations).
-   To use this mode you must have compiled  kernel with disabled
-   "Enhanced Real Time Clock Support".
-   Maybe you can have problems if you use xntpd or similar.
-   If you've data dropouts with DMA mode 2 then:
-a) disable IDE DMA
-b) switch text mode console to fb.
-
-   Options for PCL-818L:
-[0] - IO Base
-[1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
-[2] - DMA  (0=disable, 1, 3)
-[3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
-[4] - 0,  5=A/D input  -5V.. +5V
-  1, 10=A/D input -10V..+10V
-[5] - 0,  5=D/A output 0-5V  (internal reference -5V)
-  1, 10=D/A output 0-10V (internal reference -10V)
- 2=D/A output unknown (external reference)
-
-   Options for PCL-818, PCL-818H:
-[0] - IO Base
-[1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
-[2] - DMA  (0=disable, 1, 3)
-[3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
-[4] - 0,  5=D/A output 0-5V  (internal reference -5V)
-  1, 10=D/A output 0-10V (internal reference -10V)
- 2=D/A output unknown (external reference)
-
-   Options for PCL-818HD, PCL-818HG:
-[0] - IO Base
-[1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
-[2] - DMA/FIFO  (-1=use FIFO, 0=disable both FIFO and DMA,
-  1=use DMA ch 1, 3=use DMA ch 3)
-[3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
-[4] - 0,  5=D/A output 0-5V  (internal reference -5V)
-  1, 10=D/A output 0-10V (internal reference -10V)
- 2=D/A output unknown (external reference)
-
-   Options for PCL-718:
-[0] - IO Base
-[1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
-[2] - DMA  (0=disable, 1, 3)
-[3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
-[4] - 0=A/D Range is +/-10V
- 1= +/-5V
- 2= +/-2.5V
- 3= +/-1V
- 4= +/-0.5V
- 5= user defined bipolar
- 6= 0-10V
- 7= 0-5V
- 8= 0-2V
- 9= 0-1V
-10= user defined unipolar
-[5] - 0,  5=D/A outputs 0-5V  (internal reference -5V)
-  1, 10=D/A outputs 0-10V (internal reference -10V)
- 2=D/A outputs unknown (external reference)
-[6] - 0, 60=max  60kHz A/D sampling
-  1,100=max 100kHz A/D sampling (PCL-718 with Option 001 installed)
-
-*/
+ * comedi/drivers/pcl818.c
+ *
+ * Driver: pcl818
+ * Description: Advantech PCL-818 cards, PCL-718
+ * Author: Michal Dobes 
+ * Devices: [Advantech] PCL-818L (pcl818l), PCL-818H (pcl81

[PATCH v2 02/02] STAGING: Fix pcl818.c coding style issue: line over 80 characters

2015-01-28 Thread Simon Guo
Correct one coding style problem(detected by checkpatch.pl) in pcl818.c.
- line over 80 characters

Signed-off-by: Simon Guo 
---
 drivers/staging/comedi/drivers/pcl818.c | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index 5d9050c..2b8a05e 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -297,9 +297,11 @@ static const struct pcl818_board boardtypes[] = {
 
 struct pcl818_private {
struct comedi_isadma *dma;
-   unsigned int ns_min;/*  manimal allowed delay between samples (in 
us) for actual card */
+   /*  manimal allowed delay between samples (in us) for actual card */
+   unsigned int ns_min;
int i8253_osc_base; /*  1/frequency of on board oscilator in ns */
-   unsigned int act_chanlist[16];  /*  MUX setting for actual AI 
operations */
+   /*  MUX setting for actual AI operations */
+   unsigned int act_chanlist[16];
unsigned int act_chanlist_len;  /*  how long is actual MUX list */
unsigned int act_chanlist_pos;  /*  actual position in MUX list */
unsigned int divisor1;
@@ -641,7 +643,8 @@ static int check_channel_list(struct comedi_device *dev,
break;
nowmustbechan =
(CR_CHAN(chansegment[i - 1]) + 1) % s->n_chan;
-   if (nowmustbechan != CR_CHAN(chanlist[i])) {/*  
channel list isn't continuous :-( */
+   if (nowmustbechan != CR_CHAN(chanlist[i])) {
+   /*  channel list isn't continuous :-( */
dev_dbg(dev->class_dev,
"channel list must be continuous! 
chanlist[%i]=%d but must be %d or %d!\n",
i, CR_CHAN(chanlist[i]), nowmustbechan,
@@ -1147,8 +1150,10 @@ static int pcl818_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
devpriv->ns_min = board->ns_min;
 
if (!board->is_818) {
-   if ((it->options[6] == 1) || (it->options[6] == 100))
-   devpriv->ns_min = 1;/* extended PCL718 to 
100kHz DAC */
+   if ((it->options[6] == 1) || (it->options[6] == 100)) {
+   /* extended PCL718 to 100kHz DAC */
+   devpriv->ns_min = 1;
+   }
}
 
pcl818_reset(dev);
-- 
1.8.1.2

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