[PATCH v2 1/1] staging: vt6655: ioctl.c - missing __user annotation

2014-07-30 Thread Anil Belur
From: Anil Belur ask...@gmail.com

v2:
- private_ioctl() internally calls copy_{to,from}_user() and does
  not use '__user' which gives out several sparse warnings
- this patch adds __user annotation to the data member of struct
  tagSCmdRequest as suggested by tklau...@distanz.ch
- sparse warnings fixed:
 drivers/staging/vt6655/ioctl.c:78:51: warning: incorrect type in argument 2 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:78:51:expected void const [noderef] 
asn:1*from
 drivers/staging/vt6655/ioctl.c:78:51:got void *data
 drivers/staging/vt6655/ioctl.c:117:55: warning: incorrect type in argument 2 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:117:55:expected void const [noderef] 
asn:1*from
 drivers/staging/vt6655/ioctl.c:117:55:got void *data
 drivers/staging/vt6655/ioctl.c:149:46: warning: incorrect type in argument 1 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:149:46:expected void [noderef] asn:1*to
 drivers/staging/vt6655/ioctl.c:149:46:got void *data
 drivers/staging/vt6655/ioctl.c:166:51: warning: incorrect type in argument 2 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:166:51:expected void const [noderef] 
asn:1*from
 drivers/staging/vt6655/ioctl.c:166:51:got void *data
 drivers/staging/vt6655/ioctl.c:212:50: warning: incorrect type in argument 2 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:212:50:expected void const [noderef] 
asn:1*from
 drivers/staging/vt6655/ioctl.c:212:50:got void *data
 drivers/staging/vt6655/ioctl.c:276:38: warning: incorrect type in argument 1 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:276:38:expected void [noderef] asn:1*to
 drivers/staging/vt6655/ioctl.c:276:38:got void *data
 drivers/staging/vt6655/ioctl.c:292:38: warning: incorrect type in argument 1 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:292:38:expected void [noderef] asn:1*to
 drivers/staging/vt6655/ioctl.c:292:38:got void *data
 drivers/staging/vt6655/ioctl.c:300:48: warning: incorrect type in argument 2 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:300:48:expected void const [noderef] 
asn:1*from
 drivers/staging/vt6655/ioctl.c:300:48:got void *data
 drivers/staging/vt6655/ioctl.c:344:38: warning: incorrect type in argument 1 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:344:38:expected void [noderef] asn:1*to
 drivers/staging/vt6655/ioctl.c:344:38:got void *data
 drivers/staging/vt6655/ioctl.c:353:38: warning: incorrect type in argument 1 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:353:38:expected void [noderef] asn:1*to
 drivers/staging/vt6655/ioctl.c:353:38:got void *data
 drivers/staging/vt6655/ioctl.c:360:38: warning: incorrect type in argument 1 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:360:38:expected void [noderef] asn:1*to
 drivers/staging/vt6655/ioctl.c:360:38:got void *data
 drivers/staging/vt6655/ioctl.c:401:49: warning: incorrect type in argument 2 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:401:49:expected void const [noderef] 
asn:1*from
 drivers/staging/vt6655/ioctl.c:401:49:got void *data
 drivers/staging/vt6655/ioctl.c:424:49: warning: incorrect type in argument 2 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:424:49:expected void const [noderef] 
asn:1*from
 drivers/staging/vt6655/ioctl.c:424:49:got void *data
 drivers/staging/vt6655/ioctl.c:440:49: warning: incorrect type in argument 2 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:440:49:expected void const [noderef] 
asn:1*from
 drivers/staging/vt6655/ioctl.c:440:49:got void *data
 drivers/staging/vt6655/ioctl.c:457:49: warning: incorrect type in argument 2 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:457:49:expected void const [noderef] 
asn:1*from
 drivers/staging/vt6655/ioctl.c:457:49:got void *data
 drivers/staging/vt6655/ioctl.c:479:54: warning: incorrect type in argument 2 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:479:54:expected void const [noderef] 
asn:1*from
 drivers/staging/vt6655/ioctl.c:479:54:got void *data
 drivers/staging/vt6655/ioctl.c:563:38: warning: incorrect type in argument 1 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:563:38:expected void [noderef] asn:1*to
 drivers/staging/vt6655/ioctl.c:563:38:got void *data
 drivers/staging/vt6655/ioctl.c:571:52: warning: incorrect type in argument 2 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:571:52:expected void const [noderef] 
asn:1*from
 drivers/staging/vt6655/ioctl.c:571:52:got void *data
 drivers/staging/vt6655/ioctl.c:615:38: warning: incorrect type in argument 1 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:615:38:expected void [noderef] asn:1*to
 drivers/staging/vt6655/ioctl.c:615:38:got void *data
 

Re: [PATCH v2 1/1] staging: vt6655: ioctl.c - missing __user annotation

2014-07-30 Thread Tobias Klauser
On 2014-07-30 at 12:41:59 +0200, Anil Belur ask...@gmail.com wrote:
 From: Anil Belur ask...@gmail.com

This line is only necessary if you're sending the patch on behalf of
someone else. Also there is no need to have the 1/1 in the Subject line
as you're only sending one patch, not an entire series.

 v2:
 - private_ioctl() internally calls copy_{to,from}_user() and does
   not use '__user' which gives out several sparse warnings
 - this patch adds __user annotation to the data member of struct
   tagSCmdRequest as suggested by tklau...@distanz.ch

Patch history should go below the '---' as it doesn't need to be
included in the commit message.

 - sparse warnings fixed:
  drivers/staging/vt6655/ioctl.c:78:51: warning: incorrect type in argument 2 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:78:51:expected void const [noderef] 
 asn:1*from
  drivers/staging/vt6655/ioctl.c:78:51:got void *data

It's sufficient to only show one instance of the sparse warning in the
commit message, since they're all the same.

  drivers/staging/vt6655/ioctl.c:117:55: warning: incorrect type in argument 2 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:117:55:expected void const [noderef] 
 asn:1*from
  drivers/staging/vt6655/ioctl.c:117:55:got void *data
  drivers/staging/vt6655/ioctl.c:149:46: warning: incorrect type in argument 1 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:149:46:expected void [noderef] asn:1*to
  drivers/staging/vt6655/ioctl.c:149:46:got void *data
  drivers/staging/vt6655/ioctl.c:166:51: warning: incorrect type in argument 2 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:166:51:expected void const [noderef] 
 asn:1*from
  drivers/staging/vt6655/ioctl.c:166:51:got void *data
  drivers/staging/vt6655/ioctl.c:212:50: warning: incorrect type in argument 2 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:212:50:expected void const [noderef] 
 asn:1*from
  drivers/staging/vt6655/ioctl.c:212:50:got void *data
  drivers/staging/vt6655/ioctl.c:276:38: warning: incorrect type in argument 1 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:276:38:expected void [noderef] asn:1*to
  drivers/staging/vt6655/ioctl.c:276:38:got void *data
  drivers/staging/vt6655/ioctl.c:292:38: warning: incorrect type in argument 1 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:292:38:expected void [noderef] asn:1*to
  drivers/staging/vt6655/ioctl.c:292:38:got void *data
  drivers/staging/vt6655/ioctl.c:300:48: warning: incorrect type in argument 2 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:300:48:expected void const [noderef] 
 asn:1*from
  drivers/staging/vt6655/ioctl.c:300:48:got void *data
  drivers/staging/vt6655/ioctl.c:344:38: warning: incorrect type in argument 1 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:344:38:expected void [noderef] asn:1*to
  drivers/staging/vt6655/ioctl.c:344:38:got void *data
  drivers/staging/vt6655/ioctl.c:353:38: warning: incorrect type in argument 1 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:353:38:expected void [noderef] asn:1*to
  drivers/staging/vt6655/ioctl.c:353:38:got void *data
  drivers/staging/vt6655/ioctl.c:360:38: warning: incorrect type in argument 1 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:360:38:expected void [noderef] asn:1*to
  drivers/staging/vt6655/ioctl.c:360:38:got void *data
  drivers/staging/vt6655/ioctl.c:401:49: warning: incorrect type in argument 2 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:401:49:expected void const [noderef] 
 asn:1*from
  drivers/staging/vt6655/ioctl.c:401:49:got void *data
  drivers/staging/vt6655/ioctl.c:424:49: warning: incorrect type in argument 2 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:424:49:expected void const [noderef] 
 asn:1*from
  drivers/staging/vt6655/ioctl.c:424:49:got void *data
  drivers/staging/vt6655/ioctl.c:440:49: warning: incorrect type in argument 2 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:440:49:expected void const [noderef] 
 asn:1*from
  drivers/staging/vt6655/ioctl.c:440:49:got void *data
  drivers/staging/vt6655/ioctl.c:457:49: warning: incorrect type in argument 2 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:457:49:expected void const [noderef] 
 asn:1*from
  drivers/staging/vt6655/ioctl.c:457:49:got void *data
  drivers/staging/vt6655/ioctl.c:479:54: warning: incorrect type in argument 2 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:479:54:expected void const [noderef] 
 asn:1*from
  drivers/staging/vt6655/ioctl.c:479:54:got void *data
  drivers/staging/vt6655/ioctl.c:563:38: warning: incorrect type in argument 1 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:563:38:expected void [noderef] asn:1*to
  

Re: [PATCH] staging: vt6655: Fix device table definition.

2014-07-30 Thread Tobias Klauser
On 2014-07-29 at 19:44:24 +0200, fernando.apesteg...@gmail.com 
fernando.apesteg...@gmail.com wrote:
 From: Fernando Apesteguia fernando.apesteg...@gmail.com
 
 Add static to the definition of the pci device table.
 
 Signed-off-by: Fernando Apesteguia fernando.apesteg...@gmail.com

This change is already part of Greg's tree, see commit
9e4c5c2837a4 (staging: vt6655: statify some variables) in branch
staging-next. Please make sure you work against that branch (which is
also a part of linux-next) for any patches you submit.

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


[PATCH 13/19 v2] staging: comedi: amplc_pci230: remove unnecessary braces

2014-07-30 Thread Ian Abbott
Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
v2: Be less aggressive in brace removal.  Keep them for outer nested
'if's.  Keep them in outer control statements where the inner control
statement uses braces.
---
 drivers/staging/comedi/drivers/amplc_pci230.c | 120 ++
 1 file changed, 46 insertions(+), 74 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c 
b/drivers/staging/comedi/drivers/amplc_pci230.c
index 4222e28..dfc8798 100644
--- a/drivers/staging/comedi/drivers/amplc_pci230.c
+++ b/drivers/staging/comedi/drivers/amplc_pci230.c
@@ -862,19 +862,18 @@ static int pci230_ai_rinsn(struct comedi_device *dev,
if (aref == AREF_DIFF) {
/* Differential. */
gainshift = chan * 2;
-   if (devpriv-hwver == 0) {
+   if (devpriv-hwver == 0)
/*
 * Original PCI230/260 expects both inputs of the
 * differential channel to be enabled.
 */
adcen = 3  gainshift;
-   } else {
+   else
/*
 * PCI230+/260+ expects only one input of the
 * differential channel to be enabled.
 */
adcen = 1  gainshift;
-   }
adccon |= PCI230_ADC_IM_DIF;
} else {
/* Single ended. */
@@ -889,7 +888,6 @@ static int pci230_ai_rinsn(struct comedi_device *dev,
else
adccon |= PCI230_ADC_IR_UNI;
 
-
/*
 * Enable only this channel in the scan list - otherwise by default
 * we'll get one sample from each channel.
@@ -953,10 +951,9 @@ static int pci230_ao_winsn(struct comedi_device *dev,
 * Writing a list of values to an AO channel is probably not
 * very useful, but that's how the interface is defined.
 */
-   for (i = 0; i  insn-n; i++) {
+   for (i = 0; i  insn-n; i++)
/* Write value to DAC and store it. */
pci230_ao_write_nofifo(dev, data[i], chan);
-   }
 
/* return the number of samples read/written */
return i;
@@ -1025,7 +1022,7 @@ static int pci230_ao_cmdtest(struct comedi_device *dev,
err |= cfc_check_trigger_src(cmd-start_src, TRIG_INT);
 
tmp = TRIG_TIMER | TRIG_INT;
-   if ((thisboard-min_hwver  0)  (devpriv-hwver = 2)) {
+   if ((thisboard-min_hwver  0)  (devpriv-hwver = 2))
/*
 * For PCI230+ hardware version 2 onwards, allow external
 * trigger from EXTTRIG/EXTCONVCLK input (PCI230+ pin 25).
@@ -1041,7 +1038,6 @@ static int pci230_ao_cmdtest(struct comedi_device *dev,
 * guarantee!
 */
tmp |= TRIG_EXT;
-   }
err |= cfc_check_trigger_src(cmd-scan_begin_src, tmp);
 
err |= cfc_check_trigger_src(cmd-convert_src, TRIG_NOW);
@@ -1151,18 +1147,16 @@ static void pci230_ao_stop(struct comedi_device *dev,
if (!started)
return;
cmd = s-async-cmd;
-   if (cmd-scan_begin_src == TRIG_TIMER) {
+   if (cmd-scan_begin_src == TRIG_TIMER)
/* Stop scan rate generator. */
pci230_cancel_ct(dev, 1);
-   }
/* Determine interrupt source. */
-   if (devpriv-hwver  2) {
+   if (devpriv-hwver  2)
/* Not using DAC FIFO.  Using CT1 interrupt. */
intsrc = PCI230_INT_ZCLK_CT1;
-   } else {
+   else
/* Using DAC FIFO interrupt. */
intsrc = PCI230P2_INT_DAC;
-   }
/*
 * Disable interrupt and wait for interrupt routine to finish running
 * unless we are called from the interrupt routine.
@@ -1249,10 +1243,9 @@ static int pci230_handle_ao_fifo(struct comedi_device 
*dev,
/* Fixed number of scans. */
if (num_scans  devpriv-ao_scan_count)
num_scans = devpriv-ao_scan_count;
-   if (devpriv-ao_scan_count == 0) {
+   if (devpriv-ao_scan_count == 0)
/* End of acquisition. */
events |= COMEDI_CB_EOA;
-   }
}
if (events == 0) {
/* Check for FIFO underrun. */
@@ -1390,10 +1383,9 @@ static void pci230_ao_start(struct comedi_device *dev,
/* Preload FIFO data. */
run = pci230_handle_ao_fifo(dev, s);
comedi_event(dev, s);
-   if (!run) {
+   if (!run)
/* Stopped. */
return;
-   }
/* Set scan trigger source. */
switch (cmd-scan_begin_src) {
case TRIG_TIMER:
@@ -1401,13 +1393,12 @@ 

[PATCH 19/19 v2] staging: comedi: amplc_pci230: remove some unnecessary parentheses

2014-07-30 Thread Ian Abbott
Remove some pairs of parentheses that don't really improve readability.
Also, reduce the amount of leading whitespace in a few places.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
v2: fixed conflict with v2 on an earlier patch in the series.
---
 drivers/staging/comedi/drivers/amplc_pci230.c | 78 +--
 1 file changed, 37 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c 
b/drivers/staging/comedi/drivers/amplc_pci230.c
index 589a4ee..8abadd9 100644
--- a/drivers/staging/comedi/drivers/amplc_pci230.c
+++ b/drivers/staging/comedi/drivers/amplc_pci230.c
@@ -628,7 +628,7 @@ static inline void pci230_ao_write_nofifo(struct 
comedi_device *dev,
 
/* Write mangled datum to appropriate DACOUT register. */
outw(pci230_ao_mangle_datum(dev, datum),
-dev-iobase + (((chan) == 0) ? PCI230_DACOUT1 : PCI230_DACOUT2));
+dev-iobase + (chan == 0 ? PCI230_DACOUT1 : PCI230_DACOUT2));
 }
 
 static inline void pci230_ao_write_fifo(struct comedi_device *dev,
@@ -657,7 +657,7 @@ static int get_resources(struct comedi_device *dev, 
unsigned int res_mask,
ok = 1;
claimed = 0;
spin_lock_irqsave(devpriv-res_spinlock, irqflags);
-   for (b = 1, i = 0; (i  NUM_RESOURCES)  res_mask; b = 1, i++) {
+   for (b = 1, i = 0; i  NUM_RESOURCES  res_mask; b = 1, i++) {
if (res_mask  b) {
res_mask = ~b;
if (devpriv-res_owner[i] == OWNER_NONE) {
@@ -683,7 +683,7 @@ static int get_resources(struct comedi_device *dev, 
unsigned int res_mask,
 static inline int get_one_resource(struct comedi_device *dev,
   unsigned int resource, unsigned char owner)
 {
-   return get_resources(dev, (1U  resource), owner);
+   return get_resources(dev, 1U  resource, owner);
 }
 
 static void put_resources(struct comedi_device *dev, unsigned int res_mask,
@@ -695,7 +695,7 @@ static void put_resources(struct comedi_device *dev, 
unsigned int res_mask,
unsigned long irqflags;
 
spin_lock_irqsave(devpriv-res_spinlock, irqflags);
-   for (b = 1, i = 0; (i  NUM_RESOURCES)  res_mask; b = 1, i++) {
+   for (b = 1, i = 0; i  NUM_RESOURCES  res_mask; b = 1, i++) {
if (res_mask  b) {
res_mask = ~b;
if (devpriv-res_owner[i] == owner)
@@ -708,7 +708,7 @@ static void put_resources(struct comedi_device *dev, 
unsigned int res_mask,
 static inline void put_one_resource(struct comedi_device *dev,
unsigned int resource, unsigned char owner)
 {
-   put_resources(dev, (1U  resource), owner);
+   put_resources(dev, 1U  resource, owner);
 }
 
 static inline void put_all_resources(struct comedi_device *dev,
@@ -750,7 +750,7 @@ static unsigned int pci230_choose_clk_count(uint64_t ns, 
unsigned int *count,
 
for (clk_src = CLK_10MHZ;; clk_src++) {
cnt = divide_ns(ns, pci230_timebase[clk_src], flags);
-   if ((cnt = 65536) || (clk_src == CLK_1KHZ))
+   if (cnt = 65536 || clk_src == CLK_1KHZ)
break;
}
*count = cnt;
@@ -1007,7 +1007,7 @@ static int pci230_ao_cmdtest(struct comedi_device *dev,
err |= cfc_check_trigger_src(cmd-start_src, TRIG_INT);
 
tmp = TRIG_TIMER | TRIG_INT;
-   if ((thisboard-min_hwver  0)  (devpriv-hwver = 2))
+   if (thisboard-min_hwver  0  devpriv-hwver = 2)
/*
 * For PCI230+ hardware version 2 onwards, allow external
 * trigger from EXTTRIG/EXTCONVCLK input (PCI230+ pin 25).
@@ -1074,11 +1074,11 @@ static int pci230_ao_cmdtest(struct comedi_device *dev,
 * The only flags allowed are CR_EDGE and CR_INVERT.
 * The CR_EDGE flag is ignored.
 */
-   if (cmd-scan_begin_arg 
-   (CR_FLAGS_MASK  ~(CR_EDGE | CR_INVERT))) {
-   cmd-scan_begin_arg = COMBINE(cmd-scan_begin_arg, 0,
- CR_FLAGS_MASK 
- ~(CR_EDGE | CR_INVERT));
+   if (cmd-scan_begin_arg  CR_FLAGS_MASK 
+   ~(CR_EDGE | CR_INVERT)) {
+   cmd-scan_begin_arg =
+   COMBINE(cmd-scan_begin_arg, 0,
+   CR_FLAGS_MASK  ~(CR_EDGE | CR_INVERT));
err |= -EINVAL;
}
break;
@@ -1243,8 +1243,8 @@ static int pci230_handle_ao_fifo(struct comedi_device 
*dev,
 * (otherwise there will be loads of DAC FIFO not half full
 * interrupts).
 */
-   if ((num_scans == 0) 
-   ((dacstat  PCI230P2_DAC_FIFO_HALF) == 0)) {
+   if (num_scans == 0 
+   (dacstat  

Re: [PATCH 00/19] staging: comedi: amplc_pci230: tidy up a bit

2014-07-30 Thread Ian Abbott

On 2014-07-30 01:54, Hartley Sweeten wrote:

On Tuesday, July 29, 2014 4:58 AM, Ian Abbott wrote:


Tidy up the amplc_pci230 driver a bit.  There are more changes to come
after this.  The only one of these that should alter the object code is
patch 06, which replaces a udelay() call with usleep_range().

01) staging: comedi: amplc_pci230: reformat a load of comments
02) staging: comedi: amplc_pci230: fix checkpatch line over 80
 characters
03) staging: comedi: amplc_pci230: logical continuations should be on
 the previous line
04) staging: comedi: amplc_pci230: blank lines aren't necessary before a
 close brace '}'
05) staging: comedi: amplc_pci230: alignment should match open
 parenthesis
06) staging: comedi: amplc_pci230: usleep_range is preferred over udelay
07) staging: comedi: amplc_pci230: remove unused settling time constants
08) staging: comedi: amplc_pci230: remove PCI230_ADC_CONV
09) staging: comedi: amplc_pci230: remove PCI230_TEST_BIT()
10) staging: comedi: amplc_pci230: add whitespace to register values
11) staging: comedi: amplc_pci230: don't begin line with binary operator
12) staging: comedi: amplc_pci230: omit '!= 0' from logical expressions
13) staging: comedi: amplc_pci230: remove unnecessary braces
14) staging: comedi: amplc_pci230: remove some indentation in
 pci230_ai_check_chanlist()
15) staging: comedi: amplc_pci230: no need for 'function'
16) staging: comedi: amplc_pci230: add whitespace to pci230_boards[]
17) staging: comedi: amplc_pci230: no need to initialize named members
 to zero
18) staging: comedi: amplc_pci230: tidy up stuct pci230_private
19) staging: comedi: amplc_pci230: remove some unnecessary parentheses

  drivers/staging/comedi/drivers/amplc_pci230.c | 1417 +
  1 file changed, 736 insertions(+), 681 deletions(-)


Other than my comment about patch 13, this looks ok.

Reviewed-by: H Hartley Sweeten hswee...@visionengravers.com


I've posted v2 patches for patches 13 and 19.  Patch 13 v2 is less 
aggressive about brace removal.  Patch 19 is updated to v2 because of 
conflicts with the new patch 13.


--
-=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk)=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587 )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3] staging: vt6655: ioctl.c - missing __user annotation

2014-07-30 Thread Anil Belur
- private_ioctl() internally calls copy_{to,from}_user() and does
  not use '__user' which gives out several sparse warnings
- these sparse warnings were fixed by adding __user annotation to
  the data member of struct tagSCmdRequest:

 drivers/staging/vt6655/ioctl.c:78:51: warning: incorrect type in argument 2 
(different address spaces)
 drivers/staging/vt6655/ioctl.c:78:51:expected void const [noderef] 
asn:1*from
 drivers/staging/vt6655/ioctl.c:78:51:got void *data

Signed-off-by: Anil Belur ask...@gmail.com
---
v2:
- replaced the 'void __user *' casts by adding '__user' annotation to the data 
member of struct
  tagSCmdRequest which is much cleaner approach as suggested by 
tklau...@distanz.ch
v1:
- added 'void __user *' casts to supress the warnings

 drivers/staging/vt6655/iocmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vt6655/iocmd.h b/drivers/staging/vt6655/iocmd.h
index e499f1b..dd12498 100644
--- a/drivers/staging/vt6655/iocmd.h
+++ b/drivers/staging/vt6655/iocmd.h
@@ -100,7 +100,7 @@ typedef enum tagWZONETYPE {
 #pragma pack(1)
 typedef struct tagSCmdRequest {
u8  name[16];
-   void*data;
+   void __user *data;
u16 wResult;
u16 wCmdCode;
 } SCmdRequest, *PSCmdRequest;
-- 
1.9.1

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


Re: [PATCH 4/8] staging: unisys: remove U64 type

2014-07-30 Thread Dan Carpenter
On Tue, Jul 29, 2014 at 03:09:43PM -0400, Benjamin Romer wrote:
 -#define CHANNEL_u32_MISMATCH(chType, chName, field, expected, actual, fil, \
 +#define CHANNEL_U32_MISMATCH(chType, chName, field, expected, actual, fil, \
lin, logCtx)   \
   do {\
   syslog(LOG_USER | LOG_ERR,  \

Just delete this in a later patch since it's unused.

regards,
dan carpenter

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


Re: [PATCH 00/26] staging: comedi: tidy up memory mapped I/O

2014-07-30 Thread Ian Abbott

On 2014-07-29 23:01, H Hartley Sweeten wrote:

Some of the comedi drivers use memory mapped I/O. Currently all of these
drivers save the ioremap'ed base address in their private data.

Add a new member, 'mmio' to the comedi_device struct so the drivers don't
need to carry it in the private data. For some drivers this allows removing
the private data completely. For many of the others it simplifies the code
a bit since the private data does not need to be accessed in many places.

A note about patch 25/26.

The ii_pci20kc driver is a bit odd. The hardware is actually a memory mapped
ISA card and the driver attaches using the comedi_config utiltiy. Currently
the driver does not ioremap the address passed by the user. The it-options[0]
value is just cast to the void __iomem *. For now the existing code has not
been changed other than using the new member in the comedi_device to hold
the void __iomem *.

Patch 26/26 depends on the following series posted by Ian Abbott:
[PATCH 0/3] staging: comedi: amplc_dio200 detach cleanups

H Hartley Sweeten (26):
   staging: comedi: add an 'mmio' member to comedi_device
   staging: comedi: 8255_pci: use the comedi_device 'mmio' member
   staging: comedi: ni_65xx: use the comedi_device 'mmio' member
   staging: comedi: gsc_hpdi: use the comedi_device 'mmio' member
   staging: comedi: me_daq: use the comedi_device 'mmio' member
   staging: comedi: mf6x4: use the comedi_device 'mmio' member
   staging: comedi: icp_multi: use the comedi_device 'mmio' member
   staging: comedi: addi_apci_3xxx: use the comedi_device 'mmio' member
   staging: comedi: daqboard2000: use the comedi_device 'mmio' member
   staging: comedi: dt3000: use the comedi_device 'mmio' member
   staging: comedi: ni_6527: use the comedi_device 'mmio' member
   staging: comedi: ni_6527: iounmap resource when detached
   staging: comedi: ni_670x: use the comedi_device 'mmio' member
   staging: comedi: cb_pcidas64: use the comedi_device 'mmio' member
   staging: comedi: rtd520: use the comedi_device 'mmio' member
   staging: comedi: s626: use the comedi_device 'mmio' member
   staging: comedi: mite: inline mite_setup()
   staging: comedi: mite: pass comedi_device to mite_setup()
   staging: comedi: mite: use the comedi_device 'mmio' member
   staging: comedi: ni_labpc: pass comedi_device to the I/O callbacks
   staging: comedi: ni_labpc: don't pass dev-iobase to labpc_counter_load()
   staging: comedi: ni_labpc: don't pass dev-iobase to labpc_counter_set_mode()
   staging: comedi: ni_labpc: refactor labpc_8255_mmio()
   staging: comedi: ni_labpc: use the comedi_device 'mmio' member
   staging: comedi: ii_pci20kc: use the comedi_device 'mmio' member
   staging: comedi: amplc_dio200: use the comedi_device 'mmio' member

  drivers/staging/comedi/comedidev.h |   1 +
  drivers/staging/comedi/drivers.c   |   1 +
  drivers/staging/comedi/drivers/8255_pci.c  |  21 +-
  drivers/staging/comedi/drivers/addi_apci_3xxx.c|  68 +++---
  drivers/staging/comedi/drivers/amplc_dio200.c  |   3 +-
  drivers/staging/comedi/drivers/amplc_dio200.h  |  13 --
  .../staging/comedi/drivers/amplc_dio200_common.c   |  30 ++-
  drivers/staging/comedi/drivers/amplc_dio200_pci.c  |  14 +-
  drivers/staging/comedi/drivers/cb_pcidas64.c   |  41 ++--
  drivers/staging/comedi/drivers/daqboard2000.c  |  76 +++
  drivers/staging/comedi/drivers/dt3000.c| 104 -
  drivers/staging/comedi/drivers/gsc_hpdi.c  |  44 ++--
  drivers/staging/comedi/drivers/icp_multi.c |  80 ---
  drivers/staging/comedi/drivers/ii_pci20kc.c|  42 ++--
  drivers/staging/comedi/drivers/me_daq.c|  67 +++---
  drivers/staging/comedi/drivers/mf6x4.c |  47 ++---
  drivers/staging/comedi/drivers/mite.c  |  27 +--
  drivers/staging/comedi/drivers/mite.h  |  11 +-
  drivers/staging/comedi/drivers/ni_6527.c   |  87 
  drivers/staging/comedi/drivers/ni_65xx.c   |  80 +++
  drivers/staging/comedi/drivers/ni_660x.c   |  26 +--
  drivers/staging/comedi/drivers/ni_670x.c   |  28 +--
  drivers/staging/comedi/drivers/ni_labpc.c  | 197 +
  drivers/staging/comedi/drivers/ni_labpc.h  |   6 +-
  drivers/staging/comedi/drivers/ni_labpc_isadma.c   |   2 +-
  drivers/staging/comedi/drivers/ni_labpc_pci.c  |  11 +-
  drivers/staging/comedi/drivers/ni_mio_common.c |  36 ++--
  drivers/staging/comedi/drivers/ni_pcidio.c | 232 +
  drivers/staging/comedi/drivers/ni_pcimio.c |   8 +-
  drivers/staging/comedi/drivers/rtd520.c| 195 -
  drivers/staging/comedi/drivers/s626.c  | 194 -
  31 files changed, 766 insertions(+), 1026 deletions(-)



Reviewed-by: Ian Abbott abbo...@mev.co.uk

--
-=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk)=-
-=( Tel: +44 (0)161 477 1898   

Re: [PATCH v3] staging: vt6655: ioctl.c - missing __user annotation

2014-07-30 Thread Dan Carpenter
On Wed, Jul 30, 2014 at 06:29:57PM +0530, Anil Belur wrote:
 - private_ioctl() internally calls copy_{to,from}_user() and does
   not use '__user' which gives out several sparse warnings
 - these sparse warnings were fixed by adding __user annotation to
   the data member of struct tagSCmdRequest:
 
  drivers/staging/vt6655/ioctl.c:78:51: warning: incorrect type in argument 2 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:78:51:expected void const [noderef] 
 asn:1*from
  drivers/staging/vt6655/ioctl.c:78:51:got void *data
 
 Signed-off-by: Anil Belur ask...@gmail.com

Looks very nice now.

regards,
dan carpenter

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


Re: [PATCH 13/19 v2] staging: comedi: amplc_pci230: remove unnecessary braces

2014-07-30 Thread Dan Carpenter
On Wed, Jul 30, 2014 at 12:53:47PM +0100, Ian Abbott wrote:
 Signed-off-by: Ian Abbott abbo...@mev.co.uk
 ---
 v2: Be less aggressive in brace removal.  Keep them for outer nested
 'if's.  Keep them in outer control statements where the inner control
 statement uses braces.

Really every multi-line indent should have braces for readability.  This
isn't documented anywhere, but it's normal kernel style and Greg prefers
it for staging as well but I can't find the URL on google where he
mentioned that.

regards,
dan carpenter

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


Re: [PATCH 13/19 v2] staging: comedi: amplc_pci230: remove unnecessary braces

2014-07-30 Thread Ian Abbott

On 2014-07-30 14:41, Dan Carpenter wrote:

On Wed, Jul 30, 2014 at 12:53:47PM +0100, Ian Abbott wrote:

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
v2: Be less aggressive in brace removal.  Keep them for outer nested
'if's.  Keep them in outer control statements where the inner control
statement uses braces.


Really every multi-line indent should have braces for readability.  This
isn't documented anywhere, but it's normal kernel style and Greg prefers
it for staging as well but I can't find the URL on google where he
mentioned that.


With this version of the patch, amplc_pci230.c conforms to that -- as 
long as you don't count comments, or splitting a simple statement across 
multiple lines to fit within 80 columns, e.g.:


if (foo)
/* do this */
bar = baz +
  qux;

--
-=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk)=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587 )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 13/19 v2] staging: comedi: amplc_pci230: remove unnecessary braces

2014-07-30 Thread Dan Carpenter
On Wed, Jul 30, 2014 at 03:04:03PM +0100, Ian Abbott wrote:
 On 2014-07-30 14:41, Dan Carpenter wrote:
 On Wed, Jul 30, 2014 at 12:53:47PM +0100, Ian Abbott wrote:
 Signed-off-by: Ian Abbott abbo...@mev.co.uk
 ---
 v2: Be less aggressive in brace removal.  Keep them for outer nested
 'if's.  Keep them in outer control statements where the inner control
 statement uses braces.
 
 Really every multi-line indent should have braces for readability.  This
 isn't documented anywhere, but it's normal kernel style and Greg prefers
 it for staging as well but I can't find the URL on google where he
 mentioned that.
 
 With this version of the patch, amplc_pci230.c conforms to that --
 as long as you don't count comments, or splitting a simple statement
 across multiple lines to fit within 80 columns, e.g.:
 
   if (foo)
   /* do this */
   bar = baz +
 qux;

Heh...  I am counting comments and broken lines, though.  It's not a
totally strict rule and it's especially not strict for broken lines.
But we would prefer braces in those situations.

regards,
dan carpenter

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


Re: [PATCH] staging: vt6655: Fix device table definition.

2014-07-30 Thread Fernando ApesteguĂ­a
On Wed, Jul 30, 2014 at 1:43 PM, Tobias Klauser tklau...@distanz.ch wrote:

 On 2014-07-29 at 19:44:24 +0200, fernando.apesteg...@gmail.com 
 fernando.apesteg...@gmail.com wrote:
  From: Fernando Apesteguia fernando.apesteg...@gmail.com
 
  Add static to the definition of the pci device table.
 
  Signed-off-by: Fernando Apesteguia fernando.apesteg...@gmail.com

 This change is already part of Greg's tree, see commit
 9e4c5c2837a4 (staging: vt6655: statify some variables) in branch
 staging-next. Please make sure you work against that branch (which is
 also a part of linux-next) for any patches you submit.

Ooops. I will. Thanks for the hint!


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


Re: [PATCH v3] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic

2014-07-30 Thread Tomi Valkeinen
On 09/07/14 06:04, Dexuan Cui wrote:
 Currently the VSC has no chance to notify the VSP of the dirty rectangle on VM
 panic because the notification work is done in a workqueue, and in panic() the
 kernel typically ends up in an infinite loop, and a typical kernel config has
 CONFIG_PREEMPT_VOLUNTARY=y and CONFIG_PREEMPT is not set, so a context switch
 can't happen in panic() and the workqueue won't have a chance to run. As a
 result, the VM Connection window can't refresh until it's closed and we
 re-connect to the VM.
 
 We can register a handler on panic_notifier_list: the handler can notify
 the VSC and switch the framebuffer driver to a synchronous mode, meaning
 the VSC flushes any future framebuffer change to the VSP immediately.
 
 v2: removed the MS-TFS line in the commit message
 v3: remove some 'unlikely' markings
 
 Signed-off-by: Dexuan Cui de...@microsoft.com
 Reviewed-by: Haiyang Zhang haiya...@microsoft.com
 ---
  drivers/video/fbdev/hyperv_fb.c | 58 
 ++---
  1 file changed, 55 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
 index e23392e..a7b98e1 100644
 --- a/drivers/video/fbdev/hyperv_fb.c
 +++ b/drivers/video/fbdev/hyperv_fb.c
 @@ -226,11 +226,16 @@ struct hvfb_par {
   u8 recv_buf[MAX_VMBUS_PKT_SIZE];
  };
  
 +static struct fb_info *hvfb_info;

Static variables like these are usually a no-no. This prevents you from
having multiple device instances.

  static uint screen_width = HVFB_WIDTH;
  static uint screen_height = HVFB_HEIGHT;
  static uint screen_depth;
  static uint screen_fb_size;
  
 +/* If true, the VSC notifies the VSP on every framebuffer change */
 +static bool synchronous_fb;
 +

Same comment here.

However, if (and only if) the driver is already designed to work only
with single device instance, then this patch is probably ok. But even
then, I'd prefer this to be handled without static variables so that the
driver could eventually be changed to support multiple device instances.

 Tomi




signature.asc
Description: OpenPGP digital signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 13/19 v2] staging: comedi: amplc_pci230: remove unnecessary braces

2014-07-30 Thread Ian Abbott

On 2014-07-30 15:09, Dan Carpenter wrote:

On Wed, Jul 30, 2014 at 03:04:03PM +0100, Ian Abbott wrote:

On 2014-07-30 14:41, Dan Carpenter wrote:

On Wed, Jul 30, 2014 at 12:53:47PM +0100, Ian Abbott wrote:

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
v2: Be less aggressive in brace removal.  Keep them for outer nested
'if's.  Keep them in outer control statements where the inner control
statement uses braces.


Really every multi-line indent should have braces for readability.  This
isn't documented anywhere, but it's normal kernel style and Greg prefers
it for staging as well but I can't find the URL on google where he
mentioned that.


With this version of the patch, amplc_pci230.c conforms to that --
as long as you don't count comments, or splitting a simple statement
across multiple lines to fit within 80 columns, e.g.:

if (foo)
/* do this */
bar = baz +
  qux;


Heh...  I am counting comments and broken lines, though.  It's not a
totally strict rule and it's especially not strict for broken lines.
But we would prefer braces in those situations.


If necessary, patches 13 and 19 can be dropped entirely.

--
-=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk)=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587 )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH 13/19 v2] staging: comedi: amplc_pci230: remove unnecessary braces

2014-07-30 Thread Hartley Sweeten
On Wednesday, July 30, 2014 7:28 AM, Ian Abbott wrote:
 On 2014-07-30 15:09, Dan Carpenter wrote:
 On Wed, Jul 30, 2014 at 03:04:03PM +0100, Ian Abbott wrote:
 On 2014-07-30 14:41, Dan Carpenter wrote:
 On Wed, Jul 30, 2014 at 12:53:47PM +0100, Ian Abbott wrote:
 Signed-off-by: Ian Abbott abbo...@mev.co.uk
 ---
 v2: Be less aggressive in brace removal.  Keep them for outer nested
 'if's.  Keep them in outer control statements where the inner control
 statement uses braces.

 Really every multi-line indent should have braces for readability.  This
 isn't documented anywhere, but it's normal kernel style and Greg prefers
 it for staging as well but I can't find the URL on google where he
 mentioned that.

 With this version of the patch, amplc_pci230.c conforms to that --
 as long as you don't count comments, or splitting a simple statement
 across multiple lines to fit within 80 columns, e.g.:

 if (foo)
 /* do this */
 bar = baz +
   qux;

 Heh...  I am counting comments and broken lines, though.  It's not a
 totally strict rule and it's especially not strict for broken lines.
 But we would prefer braces in those situations.

 If necessary, patches 13 and 19 can be dropped entirely.

That might be best for now.

The rest of the series applies fine with them dropped.

Regards,
Hartley

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


[PATCH] Staging: vt6655: staticfy variable

2014-07-30 Thread fernando . apesteguia
From: Fernando Apesteguia fernando.apesteg...@gmail.com

Add static to variable.

Signed-off-by: Fernando Apesteguia fernando.apesteg...@gmail.com
---
 drivers/staging/vt6655/ioctl.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vt6655/ioctl.c b/drivers/staging/vt6655/ioctl.c
index 65e5933..cc6e47b 100644
--- a/drivers/staging/vt6655/ioctl.c
+++ b/drivers/staging/vt6655/ioctl.c
@@ -41,7 +41,7 @@
 static int msglevel = MSG_LEVEL_INFO;
 
 #ifdef WPA_SM_Transtatus
-SWPAResult wpa_Result;
+static SWPAResult wpa_Result;
 #endif
 
 int private_ioctl(PSDevice pDevice, struct ifreq *rq)
-- 
1.7.9.5

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


Re: [PATCH] Staging: vt6655: staticfy variable

2014-07-30 Thread Guillaume Clement
Hello,

 Add static to variable.
 Signed-off-by: Fernando Apesteguia fernando.apesteg...@gmail.com
 ---
  drivers/staging/vt6655/ioctl.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/drivers/staging/vt6655/ioctl.c
 b/drivers/staging/vt6655/ioctl.c
 index 65e5933..cc6e47b 100644
 --- a/drivers/staging/vt6655/ioctl.c
 +++ b/drivers/staging/vt6655/ioctl.c
 @@ -41,7 +41,7 @@
  static int msglevel = MSG_LEVEL_INFO;

  #ifdef WPA_SM_Transtatus
 -SWPAResult wpa_Result;
 +static SWPAResult wpa_Result;
  #endif

This changes breaks the compilation (actually the linking). wpa_Result
is actually used in device_main.c in device_open with the following:

 #ifdef WPA_SM_Transtatus
   extern SWPAResult wpa_Result;
 #endif
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: vt6655: staticfy variable

2014-07-30 Thread Fernando ApesteguĂ­a
On Wed, Jul 30, 2014 at 9:16 PM, Guillaume Clement gclem...@baobob.org wrote:
 Hello,

 Add static to variable.
 Signed-off-by: Fernando Apesteguia fernando.apesteg...@gmail.com
 ---
  drivers/staging/vt6655/ioctl.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/drivers/staging/vt6655/ioctl.c
 b/drivers/staging/vt6655/ioctl.c
 index 65e5933..cc6e47b 100644
 --- a/drivers/staging/vt6655/ioctl.c
 +++ b/drivers/staging/vt6655/ioctl.c
 @@ -41,7 +41,7 @@
  static int msglevel = MSG_LEVEL_INFO;

  #ifdef WPA_SM_Transtatus
 -SWPAResult wpa_Result;
 +static SWPAResult wpa_Result;
  #endif

 This changes breaks the compilation (actually the linking). wpa_Result
 is actually used in device_main.c in device_open with the following:

Argh... sorry, I missed that.


 #ifdef WPA_SM_Transtatus
   extern SWPAResult wpa_Result;
 #endif
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: rtl8192u: Staticfy debug method.

2014-07-30 Thread fernando . apesteguia
From: Fernando Apesteguia fernando.apesteg...@gmail.com

Add static to debug method.

Signed-off-by: Fernando Apesteguia fernando.apesteg...@gmail.com
---
 drivers/staging/rtl8192u/r8192U_core.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 7640386..c732a67 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -667,7 +667,7 @@ static void tx_timeout(struct net_device *dev)
 
 
 /* this is only for debug */
-void dump_eprom(struct net_device *dev)
+static void dump_eprom(struct net_device *dev)
 {
int i;
for (i = 0; i  63; i++)
-- 
1.7.9.5

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


Re: [PATCH] Staging: android: Missing a blank line after declarations in sw_sync.c This is a patch to the sw_sync.c file that fixes up a missing a blank warning found by the checkpatch.pl tool

2014-07-30 Thread Greg KH
On Mon, Jul 28, 2014 at 11:07:40PM +0200, adrianremo...@gmail.com wrote:
 From: Adrian Remonda adrianremo...@gmail.com
 

Your changelog text is up there in the subject, not down here in the
body of the email :(

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


[PATCH] Staging: android: timed_gpio.c: improved logic of gpio_get_time()

2014-07-30 Thread Murilo Opsfelder Araujo
Thanks for reviewing my first patch, Joe.  How about this new one,
guys?

-- 8 --
Consequently, made checkpatch.pl happy.

Signed-off-by: Murilo Opsfelder Araujo mopsfel...@gmail.com
---
 drivers/staging/android/timed_gpio.c |   15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/android/timed_gpio.c 
b/drivers/staging/android/timed_gpio.c
index 180c209..8fa4758 100644
--- a/drivers/staging/android/timed_gpio.c
+++ b/drivers/staging/android/timed_gpio.c
@@ -45,16 +45,17 @@ static enum hrtimer_restart gpio_timer_func(struct hrtimer 
*timer)

 static int gpio_get_time(struct timed_output_dev *dev)
 {
-   struct timed_gpio_data  *data =
-   container_of(dev, struct timed_gpio_data, dev);
+   struct timed_gpio_data *data;
+   struct timeval t;

-   if (hrtimer_active(data-timer)) {
-   ktime_t r = hrtimer_get_remaining(data-timer);
-   struct timeval t = ktime_to_timeval(r);
+   data = container_of(dev, struct timed_gpio_data, dev);

-   return t.tv_sec * 1000 + t.tv_usec / 1000;
-   } else
+   if (!hrtimer_active(data-timer))
return 0;
+
+   t = ktime_to_timeval(hrtimer_get_remaining(data-timer));
+
+   return t.tv_sec * 1000 + t.tv_usec / 1000;
 }

 static void gpio_enable(struct timed_output_dev *dev, int value)
--
1.7.10.4
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 13/19 v2] staging: comedi: amplc_pci230: remove unnecessary braces

2014-07-30 Thread Greg Kroah-Hartman
On Wed, Jul 30, 2014 at 04:15:23PM +, Hartley Sweeten wrote:
 On Wednesday, July 30, 2014 7:28 AM, Ian Abbott wrote:
  On 2014-07-30 15:09, Dan Carpenter wrote:
  On Wed, Jul 30, 2014 at 03:04:03PM +0100, Ian Abbott wrote:
  On 2014-07-30 14:41, Dan Carpenter wrote:
  On Wed, Jul 30, 2014 at 12:53:47PM +0100, Ian Abbott wrote:
  Signed-off-by: Ian Abbott abbo...@mev.co.uk
  ---
  v2: Be less aggressive in brace removal.  Keep them for outer nested
  'if's.  Keep them in outer control statements where the inner control
  statement uses braces.
 
  Really every multi-line indent should have braces for readability.  This
  isn't documented anywhere, but it's normal kernel style and Greg prefers
  it for staging as well but I can't find the URL on google where he
  mentioned that.
 
  With this version of the patch, amplc_pci230.c conforms to that --
  as long as you don't count comments, or splitting a simple statement
  across multiple lines to fit within 80 columns, e.g.:
 
if (foo)
/* do this */
bar = baz +
  qux;
 
  Heh...  I am counting comments and broken lines, though.  It's not a
  totally strict rule and it's especially not strict for broken lines.
  But we would prefer braces in those situations.
 
  If necessary, patches 13 and 19 can be dropped entirely.
 
 That might be best for now.
 
 The rest of the series applies fine with them dropped.

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


Re: [PATCH] Staging: rtl8192u: Staticfy debug method.

2014-07-30 Thread Greg KH
On Wed, Jul 30, 2014 at 11:33:41PM +0200, fernando.apesteg...@gmail.com wrote:
 From: Fernando Apesteguia fernando.apesteg...@gmail.com
 
 Add static to debug method.
 
 Signed-off-by: Fernando Apesteguia fernando.apesteg...@gmail.com
 ---
  drivers/staging/rtl8192u/r8192U_core.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
 b/drivers/staging/rtl8192u/r8192U_core.c
 index 7640386..c732a67 100644
 --- a/drivers/staging/rtl8192u/r8192U_core.c
 +++ b/drivers/staging/rtl8192u/r8192U_core.c
 @@ -667,7 +667,7 @@ static void tx_timeout(struct net_device *dev)
  
  
  /* this is only for debug */
 -void dump_eprom(struct net_device *dev)
 +static void dump_eprom(struct net_device *dev)
  {
   int i;
   for (i = 0; i  63; i++)

Someone sent this patch just before you :(

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


Re: [PATCH v3] staging: vt6655: ioctl.c - missing __user annotation

2014-07-30 Thread Greg KH
On Wed, Jul 30, 2014 at 06:29:57PM +0530, Anil Belur wrote:
 - private_ioctl() internally calls copy_{to,from}_user() and does
   not use '__user' which gives out several sparse warnings
 - these sparse warnings were fixed by adding __user annotation to
   the data member of struct tagSCmdRequest:
 
  drivers/staging/vt6655/ioctl.c:78:51: warning: incorrect type in argument 2 
 (different address spaces)
  drivers/staging/vt6655/ioctl.c:78:51:expected void const [noderef] 
 asn:1*from
  drivers/staging/vt6655/ioctl.c:78:51:got void *data
 
 Signed-off-by: Anil Belur ask...@gmail.com
 ---
 v2:
 - replaced the 'void __user *' casts by adding '__user' annotation to the 
 data member of struct
   tagSCmdRequest which is much cleaner approach as suggested by 
 tklau...@distanz.ch
 v1:
 - added 'void __user *' casts to supress the warnings
 
  drivers/staging/vt6655/iocmd.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/staging/vt6655/iocmd.h b/drivers/staging/vt6655/iocmd.h
 index e499f1b..dd12498 100644
 --- a/drivers/staging/vt6655/iocmd.h
 +++ b/drivers/staging/vt6655/iocmd.h
 @@ -100,7 +100,7 @@ typedef enum tagWZONETYPE {
  #pragma pack(1)
  typedef struct tagSCmdRequest {
   u8  name[16];
 - void*data;
 + void __user *data;
   u16 wResult;
   u16 wCmdCode;
  } SCmdRequest, *PSCmdRequest;

This patch doesn't apply against my tree at all, what did you make it
against?

Always work against linux-next, or the staging-next branch of my
staging.git tree on git.kernel.org.

thanks,

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


Re: [PATCH 2/8] staging: unisys: remove U16 type

2014-07-30 Thread Greg KH
On Tue, Jul 29, 2014 at 03:09:41PM -0400, Benjamin Romer wrote:
 This patch switches all use of the U16 typedef to use the kernel's u16 type
 instead.
 
 Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
 ---
  .../include/channels/controlframework.h| 18 
  .../include/channels/controlvmchannel.h| 24 
 +++---
  .../common-spar/include/channels/diagchannel.h |  8 
  .../common-spar/include/channels/iochannel.h   | 22 ++--
  .../unisys/common-spar/include/vmcallinterface.h   |  4 ++--
  drivers/staging/unisys/include/commontypes.h   |  1 -
  drivers/staging/unisys/include/uisqueue.h  |  2 +-
  .../unisys/visorchipset/visorchipset_main.c| 12 +--
  8 files changed, 45 insertions(+), 46 deletions(-)

This patch fails to apply at all, due to your previous patches:

checking file drivers/staging/unisys/visorchipset/visorchipset_main.c
Hunk #1 succeeded at 757 (offset 12 lines).
Hunk #2 succeeded at 1672 (offset 12 lines).
Hunk #3 FAILED at 1772.
Hunk #4 succeeded at 2028 (offset -35 lines).
Hunk #5 succeeded at 2053 (offset -35 lines).
1 out of 5 hunks FAILED

Please redo this series (I fuzzed the first one into place, don't resend
that.)

thanks,

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


Re: [PATCH] Staging: android: sw_sync.c: fix missing blank line after declaration

2014-07-30 Thread Greg KH
On Mon, Jul 28, 2014 at 07:38:23PM -0300, Murilo Opsfelder Araujo wrote:
 Fix coding style issue.
 
 Signed-off-by: Murilo Opsfelder Araujo mopsfel...@gmail.com
 ---
  drivers/staging/android/sw_sync.c |2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/drivers/staging/android/sw_sync.c 
 b/drivers/staging/android/sw_sync.c
 index a76db3f..863d4b1 100644
 --- a/drivers/staging/android/sw_sync.c
 +++ b/drivers/staging/android/sw_sync.c
 @@ -97,6 +97,7 @@ static void sw_sync_pt_value_str(struct sync_pt *sync_pt,
  char *str, int size)
  {
   struct sw_sync_pt *pt = (struct sw_sync_pt *)sync_pt;
 +
   snprintf(str, size, %d, pt-value);
  }
  
 @@ -156,6 +157,7 @@ static int sw_sync_open(struct inode *inode, struct file 
 *file)
  static int sw_sync_release(struct inode *inode, struct file *file)
  {
   struct sw_sync_timeline *obj = file-private_data;
 +
   sync_timeline_destroy(obj-obj);
   return 0;
  }

Does not apply to my tree at all :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/1] Drivers: net-next: hyperv

2014-07-30 Thread K. Y. Srinivasan
For forwarding scenarios, it will be useful to allocate larger
sendbuf. Make the necessary adjustments to permit this.

Signed-off-by: K. Y. Srinivasan k...@microsoft.com
---
 drivers/net/hyperv/hyperv_net.h |2 +-
 drivers/net/hyperv/netvsc.c |7 ++-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index 6cc37c1..40ba1ef 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -584,7 +584,7 @@ struct nvsp_message {
 
 #define NETVSC_RECEIVE_BUFFER_SIZE (1024*1024*16)  /* 16MB */
 #define NETVSC_RECEIVE_BUFFER_SIZE_LEGACY  (1024*1024*15)  /* 15MB */
-#define NETVSC_SEND_BUFFER_SIZE(1024 * 1024)   /* 1MB 
*/
+#define NETVSC_SEND_BUFFER_SIZE(1024 * 1024 * 16)   /* 
16MB */
 #define NETVSC_INVALID_INDEX   -1
 
 
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index c041f63..c76178e 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -193,8 +193,7 @@ static int netvsc_destroy_buf(struct netvsc_device 
*net_device)
}
if (net_device-send_buf) {
/* Free up the receive buffer */
-   free_pages((unsigned long)net_device-send_buf,
-  get_order(net_device-send_buf_size));
+   vfree(net_device-send_buf);
net_device-send_buf = NULL;
}
kfree(net_device-send_section_map);
@@ -303,9 +302,7 @@ static int netvsc_init_buf(struct hv_device *device)
 
/* Now setup the send buffer.
 */
-   net_device-send_buf =
-   (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO,
-get_order(net_device-send_buf_size));
+   net_device-send_buf = vzalloc(net_device-send_buf_size);
if (!net_device-send_buf) {
netdev_err(ndev, unable to allocate send 
   buffer of size %d\n, net_device-send_buf_size);
-- 
1.7.4.1

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


Re: [PATCH] Staging: android: sync.c: fix missing blank line after declaration

2014-07-30 Thread Greg KH
On Mon, Jul 28, 2014 at 08:03:46PM -0300, Murilo Opsfelder Araujo wrote:
 Fix coding style issue.
 
 Signed-off-by: Murilo Opsfelder Araujo mopsfel...@gmail.com
 ---
  drivers/staging/android/sync.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
 index e7b2e02..69c16cb 100644
 --- a/drivers/staging/android/sync.c
 +++ b/drivers/staging/android/sync.c
 @@ -705,6 +705,7 @@ static long sync_fence_ioctl(struct file *file, unsigned 
 int cmd,
unsigned long arg)
  {
   struct sync_fence *fence = file-private_data;
 +
   switch (cmd) {
   case SYNC_IOC_WAIT:
   return sync_fence_ioctl_wait(fence, arg);
 @@ -726,4 +727,3 @@ static const struct file_operations sync_fence_fops = {
   .unlocked_ioctl = sync_fence_ioctl,
   .compat_ioctl = sync_fence_ioctl,
  };
 -

Also doesn't apply, are you sure you are using the staging-next branch
of staging.git on git.kernel.org?

thanks,

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


Re: [PATCH] staging:r8190: coding style: Fixed checkpatch reported Error

2014-07-30 Thread Greg KH
On Tue, Jul 29, 2014 at 04:41:53PM +0530, Sanjeev Sharma wrote:
 This is a patch to the r8190_rtl8256.c file that fixes
 checkpatch reported space  coding style issues.
 
 Signed-off-by: Sanjeev Sharmasanjeev_sha...@mentor.com

Please use a ' ' character...

Please resend all of your patches, they don't have signed-off-by lines,
and I don't know what order to apply them in, even if I could do so.

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


Re: [PATCH 1/1] Drivers: net-next: hyperv

2014-07-30 Thread David Miller
From: K. Y. Srinivasan k...@microsoft.com
Date: Wed, 30 Jul 2014 18:20:16 -0700

 For forwarding scenarios, it will be useful to allocate larger
 sendbuf. Make the necessary adjustments to permit this.
 
 Signed-off-by: K. Y. Srinivasan k...@microsoft.com

Please submit this with a proper Subject line, something like
[PATCH 1/1] hyperv: ${DESCRIPTION} would be fine.

As is, nobody scanning the commit headers in the tree history can
see what might be unique about this change to the hyperv driver
vs. all others, because you haven't written a proper description.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/1] Drivers: net-next: hyperv: Increase the size of the sendbuf region

2014-07-30 Thread K. Y. Srinivasan
For forwarding scenarios, it will be useful to allocate larger
sendbuf. Make the necessary adjustments to permit this.

Signed-off-by: K. Y. Srinivasan k...@microsoft.com
---
 drivers/net/hyperv/hyperv_net.h |2 +-
 drivers/net/hyperv/netvsc.c |7 ++-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index 6cc37c1..40ba1ef 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -584,7 +584,7 @@ struct nvsp_message {
 
 #define NETVSC_RECEIVE_BUFFER_SIZE (1024*1024*16)  /* 16MB */
 #define NETVSC_RECEIVE_BUFFER_SIZE_LEGACY  (1024*1024*15)  /* 15MB */
-#define NETVSC_SEND_BUFFER_SIZE(1024 * 1024)   /* 1MB 
*/
+#define NETVSC_SEND_BUFFER_SIZE(1024 * 1024 * 16)   /* 
16MB */
 #define NETVSC_INVALID_INDEX   -1
 
 
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index c041f63..c76178e 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -193,8 +193,7 @@ static int netvsc_destroy_buf(struct netvsc_device 
*net_device)
}
if (net_device-send_buf) {
/* Free up the receive buffer */
-   free_pages((unsigned long)net_device-send_buf,
-  get_order(net_device-send_buf_size));
+   vfree(net_device-send_buf);
net_device-send_buf = NULL;
}
kfree(net_device-send_section_map);
@@ -303,9 +302,7 @@ static int netvsc_init_buf(struct hv_device *device)
 
/* Now setup the send buffer.
 */
-   net_device-send_buf =
-   (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO,
-get_order(net_device-send_buf_size));
+   net_device-send_buf = vzalloc(net_device-send_buf_size);
if (!net_device-send_buf) {
netdev_err(ndev, unable to allocate send 
   buffer of size %d\n, net_device-send_buf_size);
-- 
1.7.4.1

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


Re: [PATCH v3] staging: vt6655: ioctl.c - missing __user annotation

2014-07-30 Thread Anil Shashikumar Belur

On Thursday 31 July 2014 05:38 AM, Greg KH wrote:

 This patch doesn't apply against my tree at all, what did you make it
 against?

 Always work against linux-next, or the staging-next branch of my
 staging.git tree on git.kernel.org.

 thanks,

 greg k-h
Hi,

I am working on staging.git. After rebasing with staging-next, git log
shows someone has recently submitted this fix.

Thanks,
Anil


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


[PATCH V2] staging: dgap: introduce dgap_cleanup_nodes()

2014-07-30 Thread Daeseok Youn
When a configration file is parsed with dgap_parsefile(),
makes nodes for saving configrations for board.

Making a node will allocate node memory and strings for saving
configrations with kstrdup().

So these are freed when dgap is unloaded or failed to initialize.

Signed-off-by: Daeseok Youn daeseok.y...@gmail.com
---
V2: Do not need to free for NULLNODE.

I have been too busy to solve this issue, sorry for late.

Mark, Can you test this patch? I try to make simple module which is
testing dgap_parsefile() and dgap_cleanup_nodes().

There was a problem in freeing NULLNODE so if node is NULLNODE,
just bypass and get next one.

 drivers/staging/dgap/dgap.c |   52 +++
 1 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 06c55cb..ac12e99 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -201,6 +201,7 @@ static int dgap_test_fep(struct board_t *brd);
 static int dgap_tty_register_ports(struct board_t *brd);
 static int dgap_firmware_load(struct pci_dev *pdev, int card_type,
  struct board_t *brd);
+static void dgap_cleanup_nodes(void);
 
 static void dgap_cleanup_module(void);
 
@@ -619,6 +620,7 @@ unregister_tty:
 free_flipbuf:
dgap_free_flipbuf(brd);
 cleanup_brd:
+   dgap_cleanup_nodes();
dgap_release_remap(brd);
kfree(brd);
 
@@ -659,6 +661,8 @@ static void dgap_cleanup_module(void)
dgap_cleanup_board(dgap_board[i]);
}
 
+   dgap_cleanup_nodes();
+
if (dgap_numboards)
pci_unregister_driver(dgap_driver);
 }
@@ -6323,6 +6327,54 @@ static void dgap_remove_tty_sysfs(struct device *c)
sysfs_remove_group(c-kobj, dgap_tty_attribute_group);
 }
 
+static void dgap_cleanup_nodes(void)
+{
+   struct cnode *p;
+
+   p = dgap_head;
+
+   while (p) {
+   struct cnode *tmp = p-next;
+
+   if (p-type == NULLNODE) {
+   p = tmp;
+   continue;
+   }
+
+   switch (p-type) {
+   case BNODE:
+   kfree(p-u.board.portstr);
+   kfree(p-u.board.addrstr);
+   kfree(p-u.board.pcibusstr);
+   kfree(p-u.board.pcislotstr);
+   kfree(p-u.board.method);
+   break;
+   case CNODE:
+   kfree(p-u.conc.id);
+   kfree(p-u.conc.connect);
+   break;
+   case MNODE:
+   kfree(p-u.module.id);
+   break;
+   case TNODE:
+   kfree(p-u.ttyname);
+   break;
+   case CUNODE:
+   kfree(p-u.cuname);
+   break;
+   case LNODE:
+   kfree(p-u.line.cable);
+   break;
+   case PNODE:
+   kfree(p-u.printname);
+   break;
+   }
+
+   kfree(p-u.board.status);
+   kfree(p);
+   p = tmp;
+   }
+}
 /*
  * Parse a configuration file read into memory as a string.
  */
-- 
1.7.1

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


[PATCH v2 0/3] Fixed commenting style problem

2014-07-30 Thread Sanjeev Sharma
AddedSigned-off-by: line that was missing.

Sanjeev Sharma (3):
  staging:r8180: coding style: Fixed commenting style
  staging:r8180: coding style: Fixed too long lines
  staging:r8190: coding style: Fixed checkpatch reported Error

 drivers/staging/rtl8192u/r8180_93cx6.c   |  15 +--
 drivers/staging/rtl8192u/r8180_93cx6.h   |  11 +-
 drivers/staging/rtl8192u/r8190_rtl8256.c | 169 +++
 3 files changed, 95 insertions(+), 100 deletions(-)

-- 
1.7.11.7

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


[PATCH v2 2/3] staging:r8180: coding style: Fixed too long lines

2014-07-30 Thread Sanjeev Sharma
This is a patch to the r8180_93cx6.h file that fixes
long lines along with some additional warning.

Signed-off-by: Sanjeev Sharma sanjeev_sha...@mentor.com
---
Changes in v2:
  - Added signed-off field.

 drivers/staging/rtl8192u/r8180_93cx6.h | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8180_93cx6.h 
b/drivers/staging/rtl8192u/r8180_93cx6.h
index ee55dbf..b840348 100644
--- a/drivers/staging/rtl8192u/r8180_93cx6.h
+++ b/drivers/staging/rtl8192u/r8180_93cx6.h
@@ -3,11 +3,14 @@
Copyright (C) Andrea Merello 2004-2005  andrea.mere...@gmail.com
Released under the terms of GPL (General Public Licence)
 
-   Parts of this driver are based on the GPL part of the official realtek 
driver
-   Parts of this driver are based on the rtl8180 driver skeleton from 
Patric Schenke  Andres Salomon
+   Parts of this driver are based on the GPL part of the
+   official realtek driver
+   Parts of this driver are based on the rtl8180 driver skeleton
+   from Patric Schenke  Andres Salomon
Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver
 
-   We want to thank the Authors of such projects and the Ndiswrapper 
project Authors.
+   We want to thank the Authors of such projects and the Ndiswrapper
+   project Authors.
 */
 
 /*This files contains card eeprom (93c46 or 93c56) programming routines*/
@@ -37,4 +40,4 @@
 #define EPROM_TXPW1 0x3d
 
 
-u32 eprom_read(struct net_device *dev,u32 addr); //reads a 16 bits word
+u32 eprom_read(struct net_device *dev, u32 addr); /* reads a 16 bits word */
-- 
1.7.11.7

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


[PATCH v2 1/3] staging:r8180: coding style: Fixed commenting style

2014-07-30 Thread Sanjeev Sharma
This is a patch to the r8180_93cx6.c file that fixes
commenting style warning

Signed-off-by: Sanjeev Sharma sanjeev_sha...@mentor.com
---
Changes in v2:
  - Added signed-off field.

 drivers/staging/rtl8192u/r8180_93cx6.c | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c 
b/drivers/staging/rtl8192u/r8180_93cx6.c
index fb8a7a8..97d9b3f 100644
--- a/drivers/staging/rtl8192u/r8180_93cx6.c
+++ b/drivers/staging/rtl8192u/r8180_93cx6.c
@@ -103,7 +103,7 @@ u32 eprom_read(struct net_device *dev, u32 addr)
u32 ret;
 
ret = 0;
-   //enable EPROM programming
+   /* enable EPROM programming */
write_nic_byte_E(dev, EPROM_CMD,
   (EPROM_CMD_PROGRAMEPROM_CMD_OPERATING_MODE_SHIFT));
force_pci_posting(dev);
@@ -133,13 +133,16 @@ u32 eprom_read(struct net_device *dev, u32 addr)
eprom_send_bits_string(dev, read_cmd, 3);
eprom_send_bits_string(dev, addr_str, addr_len);
 
-   //keep chip pin D to low state while reading.
-   //I'm unsure if it is necessary, but anyway shouldn't hurt
+   /*
+* keep chip pin D to low state while reading.
+* I'm unsure if it is necessary, but anyway shouldn't hurt
+*/
eprom_w(dev, 0);
 
for (i = 0; i  16; i++) {
-   //eeprom needs a clk cycle between writing opcodeadr
-   //and reading data. (eeprom outs a dummy 0)
+   /* eeprom needs a clk cycle between writing opcodeadr
+* and reading data. (eeprom outs a dummy 0)
+*/
eprom_ck_cycle(dev);
ret |= (eprom_r(dev)(15-i));
}
@@ -147,7 +150,7 @@ u32 eprom_read(struct net_device *dev, u32 addr)
eprom_cs(dev, 0);
eprom_ck_cycle(dev);
 
-   //disable EPROM programming
+   /* disable EPROM programming */
write_nic_byte_E(dev, EPROM_CMD,
   (EPROM_CMD_NORMALEPROM_CMD_OPERATING_MODE_SHIFT));
return ret;
-- 
1.7.11.7

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


[PATCH v2 3/3] staging:r8190: coding style: Fixed checkpatch reported Error

2014-07-30 Thread Sanjeev Sharma
This is a patch to the r8190_rtl8256.c file that fixes
checkpatch reported space  coding style issues.

Signed-off-by: Sanjeev Sharma sanjeev_sha...@mentor.com
---
Changes in v2:
  - Added space character in the signed-off-by field.

 drivers/staging/rtl8192u/r8190_rtl8256.c | 169 +++
 1 file changed, 79 insertions(+), 90 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8190_rtl8256.c 
b/drivers/staging/rtl8192u/r8190_rtl8256.c
index 08e1bc9..43ed768 100644
--- a/drivers/staging/rtl8192u/r8190_rtl8256.c
+++ b/drivers/staging/rtl8192u/r8190_rtl8256.c
@@ -23,62 +23,64 @@
  * Return:  NONE
  * Note:   8226 support both 20M  and 40 MHz
  *---*/
-void PHY_SetRF8256Bandwidth(struct net_device *dev , HT_CHANNEL_WIDTH 
Bandwidth)   //20M or 40M
+void PHY_SetRF8256Bandwidth(struct net_device *dev , HT_CHANNEL_WIDTH 
Bandwidth)
 {
u8  eRFPath;
struct r8192_priv *priv = ieee80211_priv(dev);
 
-   //for(eRFPath = RF90_PATH_A; eRFPath pHalData-NumTotalRFPath; 
eRFPath++)
-   for(eRFPath = 0; eRFPath RF90_PATH_MAX; eRFPath++)
-   {
+   /* for(eRFPath = RF90_PATH_A; eRFPath pHalData-NumTotalRFPath;
+*  eRFPath++)
+*/
+   for (eRFPath = 0; eRFPath  RF90_PATH_MAX; eRFPath++) {
if (!rtl8192_phy_CheckIsLegalRFPath(dev, eRFPath))
continue;
 
-   switch (Bandwidth)
-   {
-   case HT_CHANNEL_WIDTH_20:
-   if(priv-card_8192_version == VERSION_819xU_A 
|| priv-card_8192_version == VERSION_819xU_B)// 8256 D-cut, E-cut, xiong: 
consider it later!
-   {
-   rtl8192_phy_SetRFReg(dev, 
(RF90_RADIO_PATH_E)eRFPath, 0x0b, bMask12Bits, 0x100); //phy para:1ba
-   rtl8192_phy_SetRFReg(dev, 
(RF90_RADIO_PATH_E)eRFPath, 0x2c, bMask12Bits, 0x3d7);
-   rtl8192_phy_SetRFReg(dev, 
(RF90_RADIO_PATH_E)eRFPath, 0x0e, bMask12Bits, 0x021);
-
-   //cosa add for sd3's request 01/23/2008
-   rtl8192_phy_SetRFReg(dev, 
(RF90_RADIO_PATH_E)eRFPath, 0x14, bMask12Bits, 0x5ab);
-   }
-   else
-   {
+   switch (Bandwidth) {
+   case HT_CHANNEL_WIDTH_20:
+   if (priv-card_8192_version == VERSION_819xU_A
+   || priv-card_8192_version
+   == VERSION_819xU_B) { /* 8256 D-cut, 
E-cut, xiong: consider it later! */
+   rtl8192_phy_SetRFReg(dev,
+   (RF90_RADIO_PATH_E)eRFPath,
+   0x0b, bMask12Bits, 0x100); /* 
phy para:1ba */
+   rtl8192_phy_SetRFReg(dev,
+   (RF90_RADIO_PATH_E)eRFPath,
+   0x2c, bMask12Bits, 0x3d7);
+   rtl8192_phy_SetRFReg(dev,
+   (RF90_RADIO_PATH_E)eRFPath,
+   0x0e, bMask12Bits, 0x021);
+
+   /* cosa add for sd3's request 01/23/2008
+*/
+   rtl8192_phy_SetRFReg(dev,
+   (RF90_RADIO_PATH_E)eRFPath,
+   0x14, bMask12Bits, 0x5ab);
+   } else {
RT_TRACE(COMP_ERR, 
PHY_SetRF8256Bandwidth(): unknown hardware version\n);
-   }
-
+   }
break;
-   case HT_CHANNEL_WIDTH_20_40:
-   if(priv-card_8192_version == VERSION_819xU_A 
||priv-card_8192_version == VERSION_819xU_B)// 8256 D-cut, E-cut, xiong: 
consider it later!
-   {
+   case HT_CHANNEL_WIDTH_20_40:
+   if (priv-card_8192_version == VERSION_819xU_A 
|| priv-card_8192_version == VERSION_819xU_B) { /* 8256 D-cut, E-cut, xiong: 
consider it later! */
rtl8192_phy_SetRFReg(dev, 
(RF90_RADIO_PATH_E)eRFPath, 0x0b, bMask12Bits, 0x300); //phy para:3ba
rtl8192_phy_SetRFReg(dev, 
(RF90_RADIO_PATH_E)eRFPath, 0x2c, bMask12Bits, 0x3df);
rtl8192_phy_SetRFReg(dev, 
(RF90_RADIO_PATH_E)eRFPath, 0x0e, bMask12Bits, 0x0a1);
 
//cosa add for 

RE: [PATCH] staging:r8190: coding style: Fixed checkpatch reported Error

2014-07-30 Thread Sharma, Sanjeev
Hi Greg,

I have resent all the patches in order. Please review.

Regards
Sanjeev Sharma

-Original Message-
From: Greg KH [mailto:gre...@linuxfoundation.org] 
Sent: Thursday, July 31, 2014 5:51 AM
To: Sharma, Sanjeev
Cc: de...@driverdev.osuosl.org; oor...@gmail.com; linux-ker...@vger.kernel.org
Subject: Re: [PATCH] staging:r8190: coding style: Fixed checkpatch reported 
Error

On Tue, Jul 29, 2014 at 04:41:53PM +0530, Sanjeev Sharma wrote:
 This is a patch to the r8190_rtl8256.c file that fixes checkpatch 
 reported space  coding style issues.
 
 Signed-off-by: Sanjeev Sharmasanjeev_sha...@mentor.com

Please use a ' ' character...

Please resend all of your patches, they don't have signed-off-by lines, and I 
don't know what order to apply them in, even if I could do so.

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