Re: [PATCH 2/5] Drivers: hv: balloon: account for gaps in hot add regions

2016-08-25 Thread Vitaly Kuznetsov
Yauheni Kaliuta  writes:

> Hi, kys!
>
>> On Wed, 24 Aug 2016 16:23:10 -0700, kys   wrote:
>
> [...]
>
>  > -static bool pfn_covered(unsigned long start_pfn, unsigned long pfn_cnt)
>  > +static int pfn_covered(unsigned long start_pfn, unsigned long pfn_cnt)
>  >  {
>  >struct list_head *cur;
>  >struct hv_hotadd_state *has;
>  > +  struct hv_hotadd_gap *gap;
>  >unsigned long residual, new_inc;
>
>  >if (list_empty(&dm_device.ha_region_list))
>
> One "return false;" left here.
>

This is removed in patch 4/5 of this series and false is 0 anyway)

[...]

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


Re: [PATCH] staging: octeon: Use IS_ENABLED() instead of checking for built-in or module

2016-08-25 Thread Javier Martinez Canillas
Hello Greg,

On 08/21/2016 12:02 PM, Greg Kroah-Hartman wrote:
> On Thu, Jul 14, 2016 at 01:06:09PM -0400, Javier Martinez Canillas wrote:
>> The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
>> built-in or as a module, use that macro instead of open coding the same.
>>
>> Signed-off-by: Javier Martinez Canillas 
>> Acked-by: David Daney 
>> ---
>>
>>  drivers/staging/octeon/ethernet.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/octeon/ethernet.c 
>> b/drivers/staging/octeon/ethernet.c
>> index e9cd5f242921..c0c62143ffc8 100644
>> --- a/drivers/staging/octeon/ethernet.c
>> +++ b/drivers/staging/octeon/ethernet.c
>> @@ -238,7 +238,7 @@ static int cvm_oct_common_change_mtu(struct net_device 
>> *dev, int new_mtu)
>>  struct octeon_ethernet *priv = netdev_priv(dev);
>>  int interface = INTERFACE(priv->port);
>>  int index = INDEX(priv->port);
>> -#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
>> +#if IS_ENABLED(CONFIG_VLAN_8021Q)
>>  int vlan_bytes = 4;
>>  #else
>>  int vlan_bytes = 0;
> 
> Fails to apply to the tree :(
> 

Ok, it used to apply when the patch was posted so I guess that something
changed in the code. I'll post a new one rebased on top of latest head.

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RESEND PATCH] staging: octeon: Use IS_ENABLED() instead of checking for built-in or module

2016-08-25 Thread Javier Martinez Canillas
The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Using the macro makes the code more readable by helping abstract away some
of the Kconfig built-in and module enable details.

Signed-off-by: Javier Martinez Canillas 
Acked-by: David Daney 

---

Changes since first post:
- Added David Daney Acked-by tag.
- Rebased on top of latest master.

 drivers/staging/octeon/ethernet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/octeon/ethernet.c 
b/drivers/staging/octeon/ethernet.c
index 2eb97317f631..a473f034b01a 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -237,7 +237,7 @@ static int cvm_oct_common_change_mtu(struct net_device 
*dev, int new_mtu)
 {
struct octeon_ethernet *priv = netdev_priv(dev);
int interface = INTERFACE(priv->port);
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#if IS_ENABLED(CONFIG_VLAN_8021Q)
int vlan_bytes = 4;
 #else
int vlan_bytes = 0;
-- 
2.5.5

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


Re: [PATCH] staging: rts5208: rtsx.c: Fix checkpatch warnings.

2016-08-25 Thread Ming-Chia Chung
On Tue, Aug 23, 2016 at 12:01:36PM +0530, Sudip Mukherjee wrote:
> On Tue, Aug 23, 2016 at 08:19:46AM +0800, Ming-Chia Chung wrote:
> > On Mon, Aug 22, 2016 at 10:51:27PM +0530, Sudip Mukherjee wrote:
> > > On Tue, Aug 23, 2016 at 12:54:17AM +0800, MingChia Chung wrote:
> > > >   This patch fixes a minor checkpatch warnings:
> > > > 
> > > >   "WARNING: Block comments use a trailing */ on a separate line"
> > > > 
> > > >   Signed-off-by: Ming-Chia Chung 
> > > > ---
> > > >  drivers/staging/rts5208/rtsx.c | 42 
> > > > --
> > > >  1 file changed, 28 insertions(+), 14 deletions(-)
> > > > 
> > > > diff --git a/drivers/staging/rts5208/rtsx.c 
> > > > b/drivers/staging/rts5208/rtsx.c
> > > > index e992e03..a880411 100644
> > > > --- a/drivers/staging/rts5208/rtsx.c
> > > > +++ b/drivers/staging/rts5208/rtsx.c
> > > > @@ -81,14 +81,16 @@ static int slave_alloc(struct scsi_device *sdev)
> > > >  
> > > >  static int slave_configure(struct scsi_device *sdev)
> > > >  {
> > > > -   /* Scatter-gather buffers (all but the last) must have a length
> > > > +   /*
> > > > +   * Scatter-gather buffers (all but the last) must have a length
> > > 
> > > The alignment doesnot look correct here. Also in some more places later
> > > in this patch.
> > > 
> > > regards
> > > Sudip
> > 
> > I sent this patch by following docs ([1] and [2]). The style for long
> > comments needs the begining and ending almost-blank lines. There is no
> > the begining almost-blank line only for the files in net/ and
> > drivers/net/.
> > Please let me know what I misunderstood.
> 
> After applying the patch the file was like:
> /*
>* Scatter-gather buffers (all but the last) must have a length
>  * divisible by the bulk maxpacket size.  Otherwise a data packet
>  * would end up being short, causing a premature end to the data
>  * transfer.  Since high-speed bulk pipes have a maxpacket size
> 
> See the alignment of the second line. Please use tab instead of space. And 
> also
> checkpatch should have warned you not to use space before the Signed-off-by.
> 
> regards
> sudip

Thank you for detailed explanation. I enabled "expandtab" in vim so that
I didn't realize the alignment is wrong. Now, I install 'linuxsty.vim'
to view the code. But checkpatch.pl didn't show the warning of space.
Here is my command:
`kernels/staging$ perl scripts/checkpatch.pl -f drivers/staging/rts5208/rtsx.c`

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


[PATCH] staging: android: lowmemorykiller.c: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpatch.pl 'line over 80 characters' warning

Signed-off-by: Anson Jacob 
---
 drivers/staging/android/lowmemorykiller.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/lowmemorykiller.c 
b/drivers/staging/android/lowmemorykiller.c
index 45a1b4e..80d7adf 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -92,8 +92,8 @@ static unsigned long lowmem_scan(struct shrinker *s, struct 
shrink_control *sc)
int array_size = ARRAY_SIZE(lowmem_adj);
int other_free = global_page_state(NR_FREE_PAGES) - totalreserve_pages;
int other_file = global_node_page_state(NR_FILE_PAGES) -
-   
global_node_page_state(NR_SHMEM) -
-   total_swapcache_pages();
+   global_node_page_state(NR_SHMEM) -
+   total_swapcache_pages();
 
if (lowmem_adj_size < array_size)
array_size = lowmem_adj_size;
-- 
2.7.4

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


[PATCH 0/6] staging: comedi: cb_pcidas64.c: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpath.pl warning:
line over 80 characters
Block comments use * on subsequent lines
Block comments use a trailing */ on a separate line
Statements should start on a tabstop
Comparisons should place the constant on the right side of the test

Anson Jacob (6):
  staging: comedi: cb_pcidas64.c: Fix checkpatch warning
  staging: comedi: jr3_pci.h: Fix checkpatch warning
  staging: comedi: ni_atmio.c: Fix checkpatch warning
  staging: comedi: s626.h: Fix checkpatch warning
  staging: comedi: jr3_pci.c: Fix checkpatch warning
  staging: comedi: ni_at_a2150.c: Fix checkpatch warning

 drivers/staging/comedi/drivers/cb_pcidas64.c | 105 ++-
 drivers/staging/comedi/drivers/jr3_pci.c |   3 +-
 drivers/staging/comedi/drivers/jr3_pci.h |  13 ++--
 drivers/staging/comedi/drivers/ni_at_a2150.c |  82 -
 drivers/staging/comedi/drivers/ni_atmio.c|   4 +-
 drivers/staging/comedi/drivers/s626.h|   2 +-
 6 files changed, 113 insertions(+), 96 deletions(-)

-- 
2.7.4

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


[PATCH 1/6] staging: comedi: cb_pcidas64.c: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpatch.pl warning:
Block comments use * on subsequent lines
Block comments use a trailing */ on a separate line

Signed-off-by: Anson Jacob 
---
 drivers/staging/comedi/drivers/cb_pcidas64.c | 105 ++-
 1 file changed, 55 insertions(+), 50 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c 
b/drivers/staging/comedi/drivers/cb_pcidas64.c
index aae839e..29725c5 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas64.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
@@ -1,34 +1,34 @@
 /*
-comedi/drivers/cb_pcidas64.c
-This is a driver for the ComputerBoards/MeasurementComputing PCI-DAS
-64xx, 60xx, and 4020 cards.
-
-Author:  Frank Mori Hess 
-Copyright (C) 2001, 2002 Frank Mori Hess
-
-Thanks also go to the following people:
-
-Steve Rosenbluth, for providing the source code for
-his pci-das6402 driver, and source code for working QNX pci-6402
-drivers by Greg Laird and Mariusz Bogacz.  None of the code was
-used directly here, but it was useful as an additional source of
-documentation on how to program the boards.
-
-John Sims, for much testing and feedback on pcidas-4020 support.
-
-COMEDI - Linux Control and Measurement Device Interface
-Copyright (C) 1997-8 David A. Schleef 
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
+ * comedi/drivers/cb_pcidas64.c
+ * This is a driver for the ComputerBoards/MeasurementComputing PCI-DAS
+ * 64xx, 60xx, and 4020 cards.
+ *
+ * Author:  Frank Mori Hess 
+ * Copyright (C) 2001, 2002 Frank Mori Hess
+ *
+ * Thanks also go to the following people:
+ *
+ * Steve Rosenbluth, for providing the source code for
+ * his pci-das6402 driver, and source code for working QNX pci-6402
+ * drivers by Greg Laird and Mariusz Bogacz.  None of the code was
+ * used directly here, but it was useful as an additional source of
+ * documentation on how to program the boards.
+ *
+ * John Sims, for much testing and feedback on pcidas-4020 support.
+ *
+ * COMEDI - Linux Control and Measurement Device Interface
+ * Copyright (C) 1997-8 David A. Schleef 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
 
 /*
  * Driver: cb_pcidas64
@@ -66,19 +66,18 @@
  */
 
 /*
-
-TODO:
-   make it return error if user attempts an ai command that uses the
-   external queue, and an ao command simultaneously user counter subdevice
-   there are a number of boards this driver will support when they are
-   fully released, but does not yet since the pci device id numbers
-   are not yet available.
-
-   support prescaled 100khz clock for slow pacing (not available on 6000
-   series?)
-
-   make ao fifo size adjustable like ai fifo
-*/
+ * TODO:
+ * make it return error if user attempts an ai command that uses the
+ * external queue, and an ao command simultaneously user counter subdevice
+ * there are a number of boards this driver will support when they are
+ * fully released, but does not yet since the pci device id numbers
+ * are not yet available.
+ *
+ * support prescaled 100khz clock for slow pacing (not available on 6000
+ * series?)
+ *
+ * make ao fifo size adjustable like ai fifo
+ */
 
 #include 
 #include 
@@ -91,11 +90,12 @@ TODO:
 
 #define TIMER_BASE 25  /*  40MHz master clock */
 /* 100kHz 'prescaled' clock for slow acquisition,
- * maybe I'll support this someday */
+ * maybe I'll support this someday
+ */
 #define PRESCALED_TIMER_BASE   1
 #define DMA_BUFFER_SIZE 0x1000
 
-/* maximum value that can be loaded into board's 24-bit counters*/
+/* maximum value that can be loaded into board's 24-bit counters */
 static const int max_counter_value = 0xff;
 
 /* PCI-DAS64xxx base addresses */
@@ -216,7 +216,8 @@ enum hw_config_contents {
/*  use 225 nanosec strobe when loading dac instead of 50 nanosec */
SLOW_DAC_BIT = 0x400,
/*  bit with unknown function yet given as default value in pci-das64
-*  manual */
+*  manual
+*/
HW_CONFIG_DUMMY_BITS = 0x2000,
  

[PATCH 3/6] staging: comedi: ni_atmio.c: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpatch.pl warning for 'Statements should start on a tabstop'

Signed-off-by: Anson Jacob 
---
 drivers/staging/comedi/drivers/ni_atmio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_atmio.c 
b/drivers/staging/comedi/drivers/ni_atmio.c
index 162a000..27ed117 100644
--- a/drivers/staging/comedi/drivers/ni_atmio.c
+++ b/drivers/staging/comedi/drivers/ni_atmio.c
@@ -278,10 +278,10 @@ static const struct ni_board_struct 
*ni_atmio_probe(struct comedi_device *dev)
}
if (device_id == 255)
dev_err(dev->class_dev, "can't find board\n");
-else if (device_id == 0)
+   else if (device_id == 0)
dev_err(dev->class_dev,
"EEPROM read error (?) or device not found\n");
-else
+   else
dev_err(dev->class_dev,
"unknown device ID %d -- contact author\n", device_id);
 
-- 
2.7.4

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


[PATCH 4/6] staging: comedi: s626.h: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpatch.pl warning for
Comparisons should place the constant on the right side of the test

Signed-off-by: Anson Jacob 
---
 drivers/staging/comedi/drivers/s626.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/s626.h 
b/drivers/staging/comedi/drivers/s626.h
index 6a00a64..95f8359 100644
--- a/drivers/staging/comedi/drivers/s626.h
+++ b/drivers/staging/comedi/drivers/s626.h
@@ -329,7 +329,7 @@
 * WS1-WS4 = CS* outputs.
 */
 
-#if S626_PLATFORM == S626_INTEL/*
+#if (S626_PLATFORM == S626_INTEL)  /*
 * Base ACON1 config: always run
 * A1 based on TSL1.
 */
-- 
2.7.4

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


[PATCH 2/6] staging: comedi: jr3_pci.h: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpatch.pl warning:
Block comments use * on subsequent lines
Block comments use a trailing */ on a separate line

Signed-off-by: Anson Jacob 
---
 drivers/staging/comedi/drivers/jr3_pci.h | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/comedi/drivers/jr3_pci.h 
b/drivers/staging/comedi/drivers/jr3_pci.h
index 356811d..f3614b4 100644
--- a/drivers/staging/comedi/drivers/jr3_pci.h
+++ b/drivers/staging/comedi/drivers/jr3_pci.h
@@ -421,12 +421,13 @@ struct jr3_channel {
 */
 
struct force_array filter[7];   /* offset 0x0090,
-  offset 0x0098,
-  offset 0x00a0,
-  offset 0x00a8,
-  offset 0x00b0,
-  offset 0x00b8 ,
-  offset 0x00c0 */
+* offset 0x0098,
+* offset 0x00a0,
+* offset 0x00a8,
+* offset 0x00b0,
+* offset 0x00b8,
+* offset 0x00c0
+*/
 
/* Rate_data is the calculated rate data. It is a first derivative
 * calculation. It is calculated at a frequency specified by the
-- 
2.7.4

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


[PATCH 5/6] staging: comedi: jr3_pci.c: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpatch.pl warning 'line over 80 characters'

Signed-off-by: Anson Jacob 
---
 drivers/staging/comedi/drivers/jr3_pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/jr3_pci.c 
b/drivers/staging/comedi/drivers/jr3_pci.c
index 6c4ff02..0291d3d 100644
--- a/drivers/staging/comedi/drivers/jr3_pci.c
+++ b/drivers/staging/comedi/drivers/jr3_pci.c
@@ -448,7 +448,8 @@ static int jr3_download_firmware(struct comedi_device *dev,
return 0;
 }
 
-static struct jr3_pci_poll_delay jr3_pci_poll_subdevice(struct 
comedi_subdevice *s)
+static struct jr3_pci_poll_delay
+jr3_pci_poll_subdevice(struct comedi_subdevice *s)
 {
struct jr3_pci_subdev_private *spriv = s->private;
struct jr3_pci_poll_delay result = poll_delay_min_max(1000, 2000);
-- 
2.7.4

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


[PATCH 6/6] staging: comedi: ni_at_a2150.c: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpatch.pl warning 'line over 80 characters'

Signed-off-by: Anson Jacob 
---
 drivers/staging/comedi/drivers/ni_at_a2150.c | 82 
 1 file changed, 46 insertions(+), 36 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_at_a2150.c 
b/drivers/staging/comedi/drivers/ni_at_a2150.c
index 957fb9f..3c00de1 100644
--- a/drivers/staging/comedi/drivers/ni_at_a2150.c
+++ b/drivers/staging/comedi/drivers/ni_at_a2150.c
@@ -58,41 +58,49 @@
 
 /* Registers and bits */
 #define CONFIG_REG 0x0
-#define   CHANNEL_BITS(x)  ((x) & 0x7)
-#define   CHANNEL_MASK 0x7
-#define   CLOCK_SELECT_BITS(x) (((x) & 0x3) << 3)
-#define   CLOCK_DIVISOR_BITS(x)(((x) & 0x3) << 5)
-#define   CLOCK_MASK   (0xf << 3)
-#define   ENABLE0_BIT  0x80/*  enable (don't internally ground) 
channels 0 and 1 */
-#define   ENABLE1_BIT  0x100   /*  enable (don't internally ground) 
channels 2 and 3 */
-#define   AC0_BIT  0x200   /*  ac couple channels 0,1 */
-#define   AC1_BIT  0x400   /*  ac couple channels 2,3 */
-#define   APD_BIT  0x800   /*  analog power down */
-#define   DPD_BIT  0x1000  /*  digital power down */
-#define TRIGGER_REG0x2 /*  trigger config register */
-#define   POST_TRIGGER_BITS0x2
-#define   DELAY_TRIGGER_BITS   0x3
-#define   HW_TRIG_EN   0x10/*  enable hardware trigger */
-#define FIFO_START_REG 0x6 /*  software start aquistion trigger */
-#define FIFO_RESET_REG 0x8 /*  clears fifo + fifo flags */
-#define FIFO_DATA_REG  0xa /*  read data */
-#define DMA_TC_CLEAR_REG   0xe /*  clear dma terminal count 
interrupt */
-#define STATUS_REG 0x12/*  read only */
-#define   FNE_BIT  0x1 /*  fifo not empty */
-#define   OVFL_BIT 0x8 /*  fifo overflow */
-#define   EDAQ_BIT 0x10/*  end of acquisition interrupt */
-#define   DCAL_BIT 0x20/*  offset calibration in progress */
-#define   INTR_BIT 0x40/*  interrupt has occurred */
-#define   DMA_TC_BIT   0x80/*  dma terminal count interrupt has 
occurred */
-#define   ID_BITS(x)   (((x) >> 8) & 0x3)
-#define IRQ_DMA_CNTRL_REG  0x12/*  write only */
-#define   DMA_CHAN_BITS(x) ((x) & 0x7) /*  sets dma channel */
-#define   DMA_EN_BIT   0x8 /*  enables dma */
-#define   IRQ_LVL_BITS(x)  (((x) & 0xf) << 4)  /*  sets irq 
level */
-#define   FIFO_INTR_EN_BIT 0x100   /*  enable fifo interrupts */
-#define   FIFO_INTR_FHF_BIT0x200   /*  interrupt fifo half full */
-#define   DMA_INTR_EN_BIT  0x800   /*  enable interrupt on dma 
terminal count */
-#define   DMA_DEM_EN_BIT   0x1000  /*  enables demand mode dma */
+#define CHANNEL_BITS(x)((x) & 0x7)
+#define CHANNEL_MASK   0x7
+#define CLOCK_SELECT_BITS(x)   (((x) & 0x3) << 3)
+#define CLOCK_DIVISOR_BITS(x)  (((x) & 0x3) << 5)
+#define CLOCK_MASK (0xf << 3)
+#define ENABLE0_BIT0x80/* enable (don't internally ground)
+* channels 0 and 1
+*/
+#define ENABLE1_BIT0x100   /* enable (don't internally ground)
+* channels 2 and 3
+*/
+#define AC0_BIT0x200   /* ac couple channels 0,1 */
+#define AC1_BIT0x400   /* ac couple channels 2,3 */
+#define APD_BIT0x800   /* analog power down */
+#define DPD_BIT0x1000  /* digital power down */
+#define TRIGGER_REG0x2 /* trigger config register */
+#define POST_TRIGGER_BITS  0x2
+#define DELAY_TRIGGER_BITS 0x3
+#define HW_TRIG_EN 0x10/* enable hardware trigger */
+#define FIFO_START_REG 0x6 /* software start aquistion trigger */
+#define FIFO_RESET_REG 0x8 /* clears fifo + fifo flags */
+#define FIFO_DATA_REG  0xa /* read data */
+#define DMA_TC_CLEAR_REG   0xe /* clear dma terminal count interrupt */
+#define STATUS_REG 0x12/* read only */
+#define FNE_BIT0x1 /* fifo not empty */
+#define OVFL_BIT   0x8 /* fifo overflow */
+#define EDAQ_BIT   0x10/* end of acquisition interrupt */
+#define DCAL_BIT   0x20/* offset calibration in progress */
+#define INTR_BIT   0x40/* interrupt has occurred */
+#define DMA_TC_BIT 0x80/* dma terminal count interrupt has
+* occurred
+*/
+#define ID_BITS(x) (((x) >> 8) & 0x3)
+#define IRQ_DMA_CNTRL_REG  0

[PATCH] staging: emxx_udc: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpatch.pl warning
Block comments use * on subsequent lines

Signed-off-by: Anson Jacob 
---
 drivers/staging/emxx_udc/emxx_udc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index 3b56b28..f4d9000 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -2264,9 +2264,7 @@ static int _nbu2ss_enable_controller(struct nbu2ss_udc 
*udc)
if (udc->udc_enabled)
return 0;
 
-   /*
-   Reset
-   */
+   /* Reset */
_nbu2ss_bitset(&udc->p_regs->EPCTR, (DIRPD | EPC_RST));
udelay(EPC_RST_DISABLE_TIME);   /* 1us wait */
 
-- 
2.7.4

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


[PATCH 1/9] staging: fbtft: fb_s6d02a1.c: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpatch.pl warning:
Block comments use * on subsequent lines
Block comments use a trailing */ on a separate line

Signed-off-by: Anson Jacob 
---
 drivers/staging/fbtft/fb_s6d02a1.c | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/fbtft/fb_s6d02a1.c 
b/drivers/staging/fbtft/fb_s6d02a1.c
index 3113355..774b0ff 100644
--- a/drivers/staging/fbtft/fb_s6d02a1.c
+++ b/drivers/staging/fbtft/fb_s6d02a1.c
@@ -113,12 +113,14 @@ static void set_addr_win(struct fbtft_par *par, int xs, 
int ys, int xe, int ye)
 #define MV BIT(5)
 static int set_var(struct fbtft_par *par)
 {
-   /* Memory data access control (0x36h)
-RGB/BGR:
-   1. Mode selection pin SRGB
-   RGB H/W pin for color filter setting: 0=RGB, 1=BGR
-   2. MADCTL RGB bit
-   RGB-BGR ORDER color filter panel: 0=RGB, 1=BGR */
+   /*
+* Memory data access control (0x36h)
+* RGB/BGR:
+*  1. Mode selection pin SRGB
+*  RGB H/W pin for color filter setting: 0=RGB, 1=BGR
+*  2. MADCTL RGB bit
+*  RGB-BGR ORDER color filter panel: 0=RGB, 1=BGR
+*/
switch (par->info->var.rotate) {
case 0:
write_reg(par, MIPI_DCS_SET_ADDRESS_MODE,
-- 
2.7.4

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


[PATCH 0/9] staging: fbtft: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpatch.pl warning:
Block comments use * on subsequent lines
Block comments use a trailing */ on a separate line

Anson Jacob (9):
  staging: fbtft: fb_s6d02a1.c: Fix checkpatch warning
  staging: fbtft: fb_s6d1121.c: Fix checkpatch warning
  staging: fbtft: fb_ssd1289: Fix checkpatch warning
  staging: fbtft: fb_ssd1306: Fix checkpatch warning
  staging: fbtft: fb_ssd1331: Fix checkpatch warning
  staging: fbtft: fb_st7735r: Fix checkpatch warning
  staging: fbtft: fbtft-bus: Fix checkpatch warning
  staging: fbtft: fbtft_device: Fix checkpatch warning
  staging: fbtft: fb_tls8204: Fix checkpatch warning

 drivers/staging/fbtft/fb_s6d02a1.c   | 14 +
 drivers/staging/fbtft/fb_s6d1121.c   |  8 ++---
 drivers/staging/fbtft/fb_ssd1289.c   |  8 ++---
 drivers/staging/fbtft/fb_ssd1306.c   | 23 ---
 drivers/staging/fbtft/fb_ssd1331.c   | 40 -
 drivers/staging/fbtft/fb_st7735r.c   | 43 ---
 drivers/staging/fbtft/fb_tls8204.c   | 57 ++--
 drivers/staging/fbtft/fbtft-bus.c|  3 +-
 drivers/staging/fbtft/fbtft_device.c |  8 +++--
 9 files changed, 110 insertions(+), 94 deletions(-)

-- 
2.7.4

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


[PATCH 2/9] staging: fbtft: fb_s6d1121.c: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpatch.pl warning:
Block comments use * on subsequent lines

Signed-off-by: Anson Jacob 
---
 drivers/staging/fbtft/fb_s6d1121.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/fbtft/fb_s6d1121.c 
b/drivers/staging/fbtft/fb_s6d1121.c
index d6ae76b..9b1d70b 100644
--- a/drivers/staging/fbtft/fb_s6d1121.c
+++ b/drivers/staging/fbtft/fb_s6d1121.c
@@ -125,10 +125,10 @@ static int set_var(struct fbtft_par *par)
 }
 
 /*
-  Gamma string format:
-PKP0 PKP1 PKP2 PKP3 PKP4 PKP5 PKP6 PKP7 PKP8 PKP9 PKP10 PKP11 VRP0 VRP1
-PKN0 PKN1 PKN2 PKN3 PKN4 PKN5 PKN6 PKN7 PRN8 PRN9 PRN10 PRN11 VRN0 VRN1
-*/
+ * Gamma string format:
+ * PKP0 PKP1 PKP2 PKP3 PKP4 PKP5 PKP6 PKP7 PKP8 PKP9 PKP10 PKP11 VRP0 VRP1
+ * PKN0 PKN1 PKN2 PKN3 PKN4 PKN5 PKN6 PKN7 PRN8 PRN9 PRN10 PRN11 VRN0 VRN1
+ */
 #define CURVE(num, idx)  curves[num * par->gamma.num_values + idx]
 static int set_gamma(struct fbtft_par *par, unsigned long *curves)
 {
-- 
2.7.4

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


[PATCH 4/9] staging: fbtft: fb_ssd1306: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpatch.pl warning:
Block comments use * on subsequent lines
Block comments use a trailing */ on a separate line

Signed-off-by: Anson Jacob 
---
 drivers/staging/fbtft/fb_ssd1306.c | 23 ---
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/fbtft/fb_ssd1306.c 
b/drivers/staging/fbtft/fb_ssd1306.c
index e0b34a4..80fc570 100644
--- a/drivers/staging/fbtft/fb_ssd1306.c
+++ b/drivers/staging/fbtft/fb_ssd1306.c
@@ -27,15 +27,15 @@
 #define HEIGHT 64
 
 /*
-  write_reg() caveat:
-
- This doesn't work because D/C has to be LOW for both values:
-   write_reg(par, val1, val2);
-
- Do it like this:
-   write_reg(par, val1);
-   write_reg(par, val2);
-*/
+ * write_reg() caveat:
+ *
+ * This doesn't work because D/C has to be LOW for both values:
+ * write_reg(par, val1, val2);
+ *
+ * Do it like this:
+ * write_reg(par, val1);
+ * write_reg(par, val2);
+ */
 
 /* Init sequence taken from the Adafruit SSD1306 Arduino library */
 static int init_display(struct fbtft_par *par)
@@ -113,8 +113,9 @@ static int init_display(struct fbtft_par *par)
write_reg(par, 0xA4);
 
/* Set Normal Display
-  0 in RAM: OFF in display panel
-  1 in RAM: ON in display panel */
+* 0 in RAM: OFF in display panel
+* 1 in RAM: ON in display panel
+*/
write_reg(par, 0xA6);
 
/* Set Display ON */
-- 
2.7.4

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


[PATCH 3/9] staging: fbtft: fb_ssd1289: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpatch.pl warning:
Block comments use * on subsequent lines

Signed-off-by: Anson Jacob 
---
 drivers/staging/fbtft/fb_ssd1289.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/fbtft/fb_ssd1289.c 
b/drivers/staging/fbtft/fb_ssd1289.c
index 5d5f280..25f9fbe 100644
--- a/drivers/staging/fbtft/fb_ssd1289.c
+++ b/drivers/staging/fbtft/fb_ssd1289.c
@@ -131,10 +131,10 @@ static int set_var(struct fbtft_par *par)
 }
 
 /*
-  Gamma string format:
-VRP0 VRP1 PRP0 PRP1 PKP0 PKP1 PKP2 PKP3 PKP4 PKP5
-VRN0 VRN1 PRN0 PRN1 PKN0 PKN1 PKN2 PKN3 PKN4 PKN5
-*/
+ * Gamma string format:
+ * VRP0 VRP1 PRP0 PRP1 PKP0 PKP1 PKP2 PKP3 PKP4 PKP5
+ * VRN0 VRN1 PRN0 PRN1 PKN0 PKN1 PKN2 PKN3 PKN4 PKN5
+ */
 #define CURVE(num, idx)  curves[num * par->gamma.num_values + idx]
 static int set_gamma(struct fbtft_par *par, unsigned long *curves)
 {
-- 
2.7.4

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


[PATCH 6/9] staging: fbtft: fb_st7735r: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpatch.pl warning:
Block comments use * on subsequent lines
Block comments use a trailing */ on a separate line

Signed-off-by: Anson Jacob 
---
 drivers/staging/fbtft/fb_st7735r.c | 43 +++---
 1 file changed, 26 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/fbtft/fb_st7735r.c 
b/drivers/staging/fbtft/fb_st7735r.c
index c5e51fe..6670f2b 100644
--- a/drivers/staging/fbtft/fb_st7735r.c
+++ b/drivers/staging/fbtft/fb_st7735r.c
@@ -33,35 +33,43 @@ static int default_init_sequence[] = {
-2, 500,   /* delay */
 
/* FRMCTR1 - frame rate control: normal mode
-frame rate = fosc / (1 x 2 + 40) * (LINE + 2C + 2D) */
+* frame rate = fosc / (1 x 2 + 40) * (LINE + 2C + 2D)
+*/
-1, 0xB1, 0x01, 0x2C, 0x2D,
 
/* FRMCTR2 - frame rate control: idle mode
-frame rate = fosc / (1 x 2 + 40) * (LINE + 2C + 2D) */
+* frame rate = fosc / (1 x 2 + 40) * (LINE + 2C + 2D)
+*/
-1, 0xB2, 0x01, 0x2C, 0x2D,
 
/* FRMCTR3 - frame rate control - partial mode
-dot inversion mode, line inversion mode */
+* dot inversion mode, line inversion mode
+*/
-1, 0xB3, 0x01, 0x2C, 0x2D, 0x01, 0x2C, 0x2D,
 
/* INVCTR - display inversion control
-no inversion */
+* no inversion
+*/
-1, 0xB4, 0x07,
 
/* PWCTR1 - Power Control
--4.6V, AUTO mode */
+* -4.6V, AUTO mode
+*/
-1, 0xC0, 0xA2, 0x02, 0x84,
 
/* PWCTR2 - Power Control
-VGH25 = 2.4C VGSEL = -10 VGH = 3 * AVDD */
+* VGH25 = 2.4C VGSEL = -10 VGH = 3 * AVDD
+*/
-1, 0xC1, 0xC5,
 
/* PWCTR3 - Power Control
-Opamp current small, Boost frequency */
+* Opamp current small, Boost frequency
+*/
-1, 0xC2, 0x0A, 0x00,
 
/* PWCTR4 - Power Control
-BCLK/2, Opamp current small & Medium low */
+* BCLK/2, Opamp current small & Medium low
+*/
-1, 0xC3, 0x8A, 0x2A,
 
/* PWCTR5 - Power Control */
@@ -101,11 +109,12 @@ static void set_addr_win(struct fbtft_par *par, int xs, 
int ys, int xe, int ye)
 static int set_var(struct fbtft_par *par)
 {
/* MADCTL - Memory data access control
-RGB/BGR:
-1. Mode selection pin SRGB
-   RGB H/W pin for color filter setting: 0=RGB, 1=BGR
-2. MADCTL RGB bit
-   RGB-BGR ORDER color filter panel: 0=RGB, 1=BGR */
+* RGB/BGR:
+* 1. Mode selection pin SRGB
+*RGB H/W pin for color filter setting: 0=RGB, 1=BGR
+* 2. MADCTL RGB bit
+*RGB-BGR ORDER color filter panel: 0=RGB, 1=BGR
+*/
switch (par->info->var.rotate) {
case 0:
write_reg(par, MIPI_DCS_SET_ADDRESS_MODE,
@@ -129,10 +138,10 @@ static int set_var(struct fbtft_par *par)
 }
 
 /*
-  Gamma string format:
-VRF0P VOS0P PK0P PK1P PK2P PK3P PK4P PK5P PK6P PK7P PK8P PK9P SELV0P 
SELV1P SELV62P SELV63P
-VRF0N VOS0N PK0N PK1N PK2N PK3N PK4N PK5N PK6N PK7N PK8N PK9N SELV0N 
SELV1N SELV62N SELV63N
-*/
+ * Gamma string format:
+ * VRF0P VOS0P PK0P PK1P PK2P PK3P PK4P PK5P PK6P PK7P PK8P PK9P SELV0P SELV1P 
SELV62P SELV63P
+ * VRF0N VOS0N PK0N PK1N PK2N PK3N PK4N PK5N PK6N PK7N PK8N PK9N SELV0N SELV1N 
SELV62N SELV63N
+ */
 #define CURVE(num, idx)  curves[num * par->gamma.num_values + idx]
 static int set_gamma(struct fbtft_par *par, unsigned long *curves)
 {
-- 
2.7.4

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


[PATCH 5/9] staging: fbtft: fb_ssd1331: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpatch.pl warning:
Block comments use * on subsequent lines

Signed-off-by: Anson Jacob 
---
 drivers/staging/fbtft/fb_ssd1331.c | 40 +++---
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/fbtft/fb_ssd1331.c 
b/drivers/staging/fbtft/fb_ssd1331.c
index bd294f8..1d74ac1 100644
--- a/drivers/staging/fbtft/fb_ssd1331.c
+++ b/drivers/staging/fbtft/fb_ssd1331.c
@@ -102,26 +102,26 @@ static void write_reg8_bus8(struct fbtft_par *par, int 
len, ...)
 }
 
 /*
-   Grayscale Lookup Table
-   GS1 - GS63
-   The driver Gamma curve contains the relative values between the entries
-   in the Lookup table.
-
-   From datasheet:
-   8.8 Gray Scale Decoder
-
-   there are total 180 Gamma Settings (Setting 0 to Setting 180)
-   available for the Gray Scale table.
-
-   The gray scale is defined in incremental way, with reference
-   to the length of previous table entry:
-   Setting of GS1 has to be >= 0
-   Setting of GS2 has to be > Setting of GS1 +1
-   Setting of GS3 has to be > Setting of GS2 +1
-   :
-   Setting of GS63 has to be > Setting of GS62 +1
-
-*/
+ * Grayscale Lookup Table
+ * GS1 - GS63
+ * The driver Gamma curve contains the relative values between the entries
+ * in the Lookup table.
+ *
+ * From datasheet:
+ * 8.8 Gray Scale Decoder
+ *
+ * there are total 180 Gamma Settings (Setting 0 to Setting 180)
+ * available for the Gray Scale table.
+ *
+ * The gray scale is defined in incremental way, with reference
+ * to the length of previous table entry:
+ * Setting of GS1 has to be >= 0
+ * Setting of GS2 has to be > Setting of GS1 +1
+ * Setting of GS3 has to be > Setting of GS2 +1
+ * :
+ * Setting of GS63 has to be > Setting of GS62 +1
+ *
+ */
 static int set_gamma(struct fbtft_par *par, unsigned long *curves)
 {
unsigned long tmp[GAMMA_NUM * GAMMA_LEN];
-- 
2.7.4

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


[PATCH 7/9] staging: fbtft: fbtft-bus: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpatch.pl warning:
Block comments use * on subsequent lines
Block comments use a trailing */ on a separate line

Signed-off-by: Anson Jacob 
---
 drivers/staging/fbtft/fbtft-bus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fbtft-bus.c 
b/drivers/staging/fbtft/fbtft-bus.c
index 83505bc..ec45043 100644
--- a/drivers/staging/fbtft/fbtft-bus.c
+++ b/drivers/staging/fbtft/fbtft-bus.c
@@ -92,7 +92,8 @@ void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, 
...)
 
if (par->spi && (par->spi->bits_per_word == 8)) {
/* we're emulating 9-bit, pad start of buffer with no-ops
-  (assuming here that zero is a no-op) */
+* (assuming here that zero is a no-op)
+*/
pad = (len % 4) ? 4 - (len % 4) : 0;
for (i = 0; i < pad; i++)
*buf++ = 0x000;
-- 
2.7.4

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


Re: [PATCH] staging: android: lowmemorykiller.c: Fix checkpatch warning

2016-08-25 Thread Andrey Utkin
On Thu, Aug 25, 2016 at 11:10:25AM -0400, Anson Jacob wrote:
> Fix checkpatch.pl 'line over 80 characters' warning
> 
> Signed-off-by: Anson Jacob 
> ---
>  drivers/staging/android/lowmemorykiller.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/android/lowmemorykiller.c 
> b/drivers/staging/android/lowmemorykiller.c
> index 45a1b4e..80d7adf 100644
> --- a/drivers/staging/android/lowmemorykiller.c
> +++ b/drivers/staging/android/lowmemorykiller.c
> @@ -92,8 +92,8 @@ static unsigned long lowmem_scan(struct shrinker *s, struct 
> shrink_control *sc)
>   int array_size = ARRAY_SIZE(lowmem_adj);
>   int other_free = global_page_state(NR_FREE_PAGES) - totalreserve_pages;
>   int other_file = global_node_page_state(NR_FILE_PAGES) -
> - 
> global_node_page_state(NR_SHMEM) -
> - total_swapcache_pages();
> + global_node_page_state(NR_SHMEM) -
> + total_swapcache_pages();
>  
>   if (lowmem_adj_size < array_size)
>   array_size = lowmem_adj_size;

Indeed original alignment on opening brace here doesn't make sense.
I don't mind if your patch gets accepted, but out of curiosity I have opened
this file in vim with kernel coding style plugin loaded
(https://github.com/vivien/vim-linux-coding-style), selected the affected
lines, and reindented the selection by pressing 'gq'. It ended up with this,
being both shorter and simpler:

diff --git a/drivers/staging/android/lowmemorykiller.c 
b/drivers/staging/android/lowmemorykiller.c
index 45a1b4e..3aef467 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -92,8 +92,7 @@ static unsigned long lowmem_scan(struct shrinker *s, struct 
shrink_control *sc)
int array_size = ARRAY_SIZE(lowmem_adj);
int other_free = global_page_state(NR_FREE_PAGES) - totalreserve_pages;
int other_file = global_node_page_state(NR_FILE_PAGES) -
-   
global_node_page_state(NR_SHMEM) -
-   total_swapcache_pages();
+   global_node_page_state(NR_SHMEM) - total_swapcache_pages();
 
if (lowmem_adj_size < array_size)
array_size = lowmem_adj_size;

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


[PATCH 8/9] staging: fbtft: fbtft_device: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpatch.pl warning:
Block comments use * on subsequent lines
Block comments use a trailing */ on a separate line

Signed-off-by: Anson Jacob 
---
 drivers/staging/fbtft/fbtft_device.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft_device.c 
b/drivers/staging/fbtft/fbtft_device.c
index 4d1f1e9..924abd3 100644
--- a/drivers/staging/fbtft/fbtft_device.c
+++ b/drivers/staging/fbtft/fbtft_device.c
@@ -1215,7 +1215,8 @@ static struct fbtft_device_display displays[] = {
}
}, {
/* This should be the last item.
-  Used with the custom argument */
+* Used with the custom argument
+*/
.name = "",
.spi = &(struct spi_board_info) {
.modalias = "",
@@ -1306,8 +1307,9 @@ static struct fbtft_gpio 
fbtft_device_param_gpios[MAX_GPIOS + 1] = { };
 static void fbtft_device_pdev_release(struct device *dev)
 {
 /* Needed to silence this message:
-Device 'xxx' does not have a release() function, it is broken and must be fixed
-*/
+ * Device 'xxx' does not have a release() function,
+ * it is broken and must be fixed
+ */
 }
 
 static int spi_device_found(struct device *dev, void *data)
-- 
2.7.4

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


[PATCH 9/9] staging: fbtft: fb_tls8204: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Fix checkpatch.pl warning:
Block comments use * on subsequent lines
Block comments use a trailing */ on a separate line

Signed-off-by: Anson Jacob 
---
 drivers/staging/fbtft/fb_tls8204.c | 57 +++---
 1 file changed, 29 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/fbtft/fb_tls8204.c 
b/drivers/staging/fbtft/fb_tls8204.c
index 545f7cb..ea2ddac 100644
--- a/drivers/staging/fbtft/fb_tls8204.c
+++ b/drivers/staging/fbtft/fb_tls8204.c
@@ -44,21 +44,21 @@ static int init_display(struct fbtft_par *par)
par->fbtftops.reset(par);
 
/* Enter extended command mode */
-   write_reg(par, 0x21); /* 5:1  1
-2:0  PD - Powerdown control: chip is active
-1:0  V  - Entry mode: horizontal addressing
-0:1  H  - Extended instruction set control:
-   extended
- */
+   write_reg(par, 0x21);   /* 5:1  1
+* 2:0  PD - Powerdown control: chip is active
+* 1:0  V  - Entry mode: horizontal addressing
+* 0:1  H  - Extended instruction set control:
+*   extended
+*/
 
/* H=1 Bias system */
-   write_reg(par, 0x10 | (bs & 0x7)); /*
-4:1  1
-3:0  0
-2:x  BS2 - Bias System
-1:x  BS1
-0:x  BS0
- */
+   write_reg(par, 0x10 | (bs & 0x7));
+   /* 4:1  1
+* 3:0  0
+* 2:x  BS2 - Bias System
+* 1:x  BS1
+* 0:x  BS0
+*/
 
/* Set the address of the first display line. */
write_reg(par, 0x04 | (64 >> 6));
@@ -68,12 +68,12 @@ static int init_display(struct fbtft_par *par)
write_reg(par, 0x20);
 
/* H=0 Display control */
-   write_reg(par, 0x08 | 4); /*
-3:1  1
-2:1  D  - DE: 10=normal mode
-1:0  0
-0:0  E
- */
+   write_reg(par, 0x08 | 4);
+   /* 3:1  1
+* 2:1  D - DE: 10=normal mode
+* 1:0  0
+* 0:0  E
+*/
 
return 0;
 }
@@ -81,15 +81,15 @@ static int init_display(struct fbtft_par *par)
 static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
 {
/* H=0 Set X address of RAM */
-   write_reg(par, 0x80); /* 7:1  1
-6-0: X[6:0] - 0x00
- */
+   write_reg(par, 0x80);   /* 7:1  1
+* 6-0: X[6:0] - 0x00
+*/
 
/* H=0 Set Y address of RAM */
-   write_reg(par, 0x40); /* 7:0  0
-6:1  1
-2-0: Y[2:0] - 0x0
- */
+   write_reg(par, 0x40);   /* 7:0  0
+* 6:1  1
+* 2-0: Y[2:0] - 0x0
+*/
 }
 
 static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
@@ -100,8 +100,9 @@ static int write_vmem(struct fbtft_par *par, size_t offset, 
size_t len)
 
for (y = 0; y < HEIGHT / 8; y++) {
u8 *buf = par->txbuf.buf;
-   /* The display is 102x68 but the LCD is 84x48.  Set
-  the write pointer at the start of each row. */
+   /* The display is 102x68 but the LCD is 84x48.
+* Set the write pointer at the start of each row.
+*/
gpio_set_value(par->gpio.dc, 0);
write_reg(par, 0x80 | 0);
write_reg(par, 0x40 | y);
-- 
2.7.4

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


Re: [PATCH 6/6] staging: comedi: ni_at_a2150.c: Fix checkpatch warning

2016-08-25 Thread Andrey Utkin
On Thu, Aug 25, 2016 at 11:16:13AM -0400, Anson Jacob wrote:
> Fix checkpatch.pl warning 'line over 80 characters'
> 
> Signed-off-by: Anson Jacob 
> ---
>  drivers/staging/comedi/drivers/ni_at_a2150.c | 82 
> 
>  1 file changed, 46 insertions(+), 36 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/ni_at_a2150.c 
> b/drivers/staging/comedi/drivers/ni_at_a2150.c
> index 957fb9f..3c00de1 100644
> --- a/drivers/staging/comedi/drivers/ni_at_a2150.c
> +++ b/drivers/staging/comedi/drivers/ni_at_a2150.c
> @@ -58,41 +58,49 @@
>  
>  /* Registers and bits */
>  #define CONFIG_REG   0x0
> -#define   CHANNEL_BITS(x)((x) & 0x7)
> -#define   CHANNEL_MASK   0x7
> -#define   CLOCK_SELECT_BITS(x)   (((x) & 0x3) << 3)

You have lost this treeish look which carried information about thing
being a register or a field.

> +#define CHANNEL_BITS(x)  ((x) & 0x7)
> +#define CHANNEL_MASK 0x7

No uniform alignment. Please get everything in a row.
If it's hard or this part of driver is expected to have a lot of changes
in near future, then I'd remove any whitespace over single space between
name and value.

> +#define ENABLE0_BIT  0x80/* enable (don't internally ground)
> +  * channels 0 and 1
> +  */
> +#define ENABLE1_BIT  0x100   /* enable (don't internally ground)
> +  * channels 2 and 3
> +  */

This commenting style is discouraged (Linus has even stated explicitly
that he dislikes it, even for pieces of code which historically had this
style everywhere). Opening "/*" should not be followed by text.

Also, In my personal experience, it is more stable to have these
comments on previous line, not at end of the line. This way you always
have enough space for both a comment and a macro.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RESEND PATCH] staging: octeon: Use IS_ENABLED() instead of checking for built-in or module

2016-08-25 Thread David Daney

On 08/25/2016 06:55 AM, Javier Martinez Canillas wrote:

The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Using the macro makes the code more readable by helping abstract away some
of the Kconfig built-in and module enable details.

Signed-off-by: Javier Martinez Canillas 
Acked-by: David Daney 

---

Changes since first post:
- Added David Daney Acked-by tag.
- Rebased on top of latest master.



You changed something about the patch.  In this case the Subject is not 
"RESEND", but rather "v2".  Incorrect Subject lines like this can lead 
to the patch being inadvertently ignored.


David Daney


  drivers/staging/octeon/ethernet.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/octeon/ethernet.c 
b/drivers/staging/octeon/ethernet.c
index 2eb97317f631..a473f034b01a 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -237,7 +237,7 @@ static int cvm_oct_common_change_mtu(struct net_device 
*dev, int new_mtu)
  {
struct octeon_ethernet *priv = netdev_priv(dev);
int interface = INTERFACE(priv->port);
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#if IS_ENABLED(CONFIG_VLAN_8021Q)
int vlan_bytes = 4;
  #else
int vlan_bytes = 0;



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


Re: [PATCH 6/6] staging: comedi: ni_at_a2150.c: Fix checkpatch warning

2016-08-25 Thread Anson Jacob
Thank you for your comments.

On Thu, Aug 25, 2016 at 06:47:08PM +0300, Andrey Utkin wrote:
> 
> > +#define CHANNEL_BITS(x)((x) & 0x7)
> > +#define CHANNEL_MASK   0x7
> 
> No uniform alignment. Please get everything in a row.
> If it's hard or this part of driver is expected to have a lot of changes
> in near future, then I'd remove any whitespace over single space between
> name and value.
>

I didn't get your point in this case. Could you explain it.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 6/6] staging: comedi: ni_at_a2150.c: Fix checkpatch warning

2016-08-25 Thread Andrey Utkin
On Thu, Aug 25, 2016 at 12:09:23PM -0400, Anson Jacob wrote:
> On Thu, Aug 25, 2016 at 06:47:08PM +0300, Andrey Utkin wrote:
> > 
> > > +#define CHANNEL_BITS(x)  ((x) & 0x7)
> > > +#define CHANNEL_MASK 0x7
> > 
> > No uniform alignment. Please get everything in a row.
> > If it's hard or this part of driver is expected to have a lot of changes
> > in near future, then I'd remove any whitespace over single space between
> > name and value.
> >
> 
> I didn't get your point in this case. Could you explain it.

Reviewing actual source code with the patch applied, it looks well.  But
if you look at the patch email itself, or in "git show , the
alignment is broken. This is an illustration why using tab characters in
the middle of lines is bad idea. However this is what I see in lots of
kernel code.
So feel free to ignore this point.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rts5208: rtsx.c: Fix checkpatch warnings.

2016-08-25 Thread Sudip Mukherjee
On Thu, Aug 25, 2016 at 09:59:46PM +0800, Ming-Chia Chung wrote:
> On Tue, Aug 23, 2016 at 12:01:36PM +0530, Sudip Mukherjee wrote:
> > On Tue, Aug 23, 2016 at 08:19:46AM +0800, Ming-Chia Chung wrote:
> > > On Mon, Aug 22, 2016 at 10:51:27PM +0530, Sudip Mukherjee wrote:
> > > > On Tue, Aug 23, 2016 at 12:54:17AM +0800, MingChia Chung wrote:
> > > > >   This patch fixes a minor checkpatch warnings:
> > > > > 
> > > > >   "WARNING: Block comments use a trailing */ on a separate line"
> > > > > 
> > > > >   Signed-off-by: Ming-Chia Chung 
> > > > > ---
> > > > >  drivers/staging/rts5208/rtsx.c | 42 
> > > > > --
> > > > >  1 file changed, 28 insertions(+), 14 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/staging/rts5208/rtsx.c 
> > > > > b/drivers/staging/rts5208/rtsx.c
> > > > > index e992e03..a880411 100644
> > > > > --- a/drivers/staging/rts5208/rtsx.c
> > > > > +++ b/drivers/staging/rts5208/rtsx.c
> > > > > @@ -81,14 +81,16 @@ static int slave_alloc(struct scsi_device *sdev)
> > > > >  
> > > > >  static int slave_configure(struct scsi_device *sdev)
> > > > >  {
> > > > > - /* Scatter-gather buffers (all but the last) must have a length
> > > > > + /*
> > > > > +   * Scatter-gather buffers (all but the last) must have a length
> > > > 
> > > > The alignment doesnot look correct here. Also in some more places later
> > > > in this patch.
> > > > 
> > > > regards
> > > > Sudip
> > > 
> > > I sent this patch by following docs ([1] and [2]). The style for long
> > > comments needs the begining and ending almost-blank lines. There is no
> > > the begining almost-blank line only for the files in net/ and
> > > drivers/net/.
> > > Please let me know what I misunderstood.
> > 
> > After applying the patch the file was like:
> > /*
> >* Scatter-gather buffers (all but the last) must have a length
> >  * divisible by the bulk maxpacket size.  Otherwise a data packet
> >  * would end up being short, causing a premature end to the data
> >  * transfer.  Since high-speed bulk pipes have a maxpacket size
> > 
> > See the alignment of the second line. Please use tab instead of space. And 
> > also
> > checkpatch should have warned you not to use space before the Signed-off-by.
> > 
> 
> Thank you for detailed explanation. I enabled "expandtab" in vim so that
> I didn't realize the alignment is wrong. Now, I install 'linuxsty.vim'
> to view the code. But checkpatch.pl didn't show the warning of space.
> Here is my command:
> `kernels/staging$ perl scripts/checkpatch.pl -f 
> drivers/staging/rts5208/rtsx.c`

Please run checkpatch on your patch and it will show you the warning
about space before Signed-off-by. But it missed the place where space
was used inplace of tab. Maybe you can send a patch to fix checkpatch.

Added Cc: to Joe and Andy.

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


[PATCH v2] Staging: wlan-ng: removed duplicate code in p80211req.c

2016-08-25 Thread Claudiu Beznea
This patch removes duplicate code in p80211req_mibset_mibget()
by adding p80211req_handle_action() function.

Changes since v1:
Removed prototype of p80211req_handle_action() from the prototype
list and add directly the function definition.

Signed-off-by: Claudiu Beznea 
---
 drivers/staging/wlan-ng/p80211req.c | 39 ++---
 1 file changed, 19 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211req.c 
b/drivers/staging/wlan-ng/p80211req.c
index 4b84b56..d830417 100644
--- a/drivers/staging/wlan-ng/p80211req.c
+++ b/drivers/staging/wlan-ng/p80211req.c
@@ -77,6 +77,21 @@ static void p80211req_mibset_mibget(wlandevice_t *wlandev,
   struct p80211msg_dot11req_mibget *mib_msg,
   int isget);
 
+static void p80211req_handle_action(struct wlandevice *wlandev, u32 *data,
+   int isget, u32 flag)
+{
+   if (isget) {
+   if (wlandev->hostwep & flag)
+   *data = P80211ENUM_truth_true;
+   else
+   *data = P80211ENUM_truth_false;
+   } else {
+   wlandev->hostwep &= ~flag;
+   if (*data == P80211ENUM_truth_true)
+   wlandev->hostwep |= flag;
+   }
+}
+
 /*
 * p80211req_dorequest
 *
@@ -219,31 +234,15 @@ static void p80211req_mibset_mibget(wlandevice_t *wlandev,
case DIDmib_dot11smt_dot11PrivacyTable_dot11PrivacyInvoked:{
u32 *data = (u32 *) mibitem->data;
 
-   if (isget) {
-   if (wlandev->hostwep & HOSTWEP_PRIVACYINVOKED)
-   *data = P80211ENUM_truth_true;
-   else
-   *data = P80211ENUM_truth_false;
-   } else {
-   wlandev->hostwep &= ~(HOSTWEP_PRIVACYINVOKED);
-   if (*data == P80211ENUM_truth_true)
-   wlandev->hostwep |= HOSTWEP_PRIVACYINVOKED;
-   }
+   p80211req_handle_action(wlandev, data, isget,
+   HOSTWEP_PRIVACYINVOKED);
break;
}
case DIDmib_dot11smt_dot11PrivacyTable_dot11ExcludeUnencrypted:{
u32 *data = (u32 *) mibitem->data;
 
-   if (isget) {
-   if (wlandev->hostwep & HOSTWEP_EXCLUDEUNENCRYPTED)
-   *data = P80211ENUM_truth_true;
-   else
-   *data = P80211ENUM_truth_false;
-   } else {
-   wlandev->hostwep &= ~(HOSTWEP_EXCLUDEUNENCRYPTED);
-   if (*data == P80211ENUM_truth_true)
-   wlandev->hostwep |= HOSTWEP_EXCLUDEUNENCRYPTED;
-   }
+   p80211req_handle_action(wlandev, data, isget,
+   HOSTWEP_EXCLUDEUNENCRYPTED);
break;
}
}
-- 
1.9.1

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


RE: [PATCH 2/5] Drivers: hv: balloon: account for gaps in hot add regions

2016-08-25 Thread KY Srinivasan


> -Original Message-
> From: devel [mailto:driverdev-devel-boun...@linuxdriverproject.org] On
> Behalf Of Yauheni Kaliuta
> Sent: Wednesday, August 24, 2016 9:54 PM
> To: k...@exchange.microsoft.com
> Cc: o...@aepfle.de; gre...@linuxfoundation.org; jasow...@redhat.com; Alex
> Ng (LIS) ; linux-ker...@vger.kernel.org;
> a...@canonical.com; de...@linuxdriverproject.org;
> leann.ogasaw...@canonical.com
> Subject: Re: [PATCH 2/5] Drivers: hv: balloon: account for gaps in hot add
> regions
> 
> Hi, kys!
> 
> > On Wed, 24 Aug 2016 16:23:10 -0700, kys   wrote:
> 
> [...]
> 
>  > -static bool pfn_covered(unsigned long start_pfn, unsigned long pfn_cnt)
>  > +static int pfn_covered(unsigned long start_pfn, unsigned long pfn_cnt)
>  >  {
>  >struct list_head *cur;
>  >struct hv_hotadd_state *has;
>  > +  struct hv_hotadd_gap *gap;
>  >unsigned long residual, new_inc;
> 
>  >if (list_empty(&dm_device.ha_region_list))
> 
> One "return false;" left here.

It is fixed up later in the series and the series is bisectable.

K. Y

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


Re: Improving OCTEON II 10G Ethernet performance

2016-08-25 Thread Aaro Koskinen
Hi,

On Wed, Aug 24, 2016 at 06:29:49PM -0700, Ed Swierk wrote:
> I'm trying to migrate from the Octeon SDK to a vanilla Linux 4.4
> kernel for a Cavium OCTEON II (CN6880) board running in 64-bit
> little-endian mode. So far I've gotten most of the hardware features I
> need working, including XAUI/RXAUI, USB, boot bus and I2C, with a
> fairly small set of patches.
> https://github.com/skyportsystems/linux/compare/master...octeon2

Interesting, have you considered sending some of this stuff into mainline?

> The biggest remaining hurdle is improving 10G Ethernet performance:
> iperf -P 10 on the SDK kernel gets close to 10 Gbit/sec throughput,
> while on my 4.4 kernel, it tops out around 1 Gbit/sec.

Did you compare throughput and packets per second performance of both
kernels using just a single core?

> Comparing the octeon-ethernet driver in the SDK
> (http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-contrib/tree/drivers/net/ethernet/octeon?h=apaliwal/octeon)
> against the one in 4.4, the latter appears to utilize only a single
> CPU core for the rx path. It's not clear to me if there is a similar
> issue on the tx side, or other bottlenecks.

Did you try CONFIG_RPS and moving softirqs into other core(s)?

> I started trying to port multi-CPU rx from the SDK octeon-ethernet
> driver, but had trouble teasing out just the necessary bits without
> following a maze of dependencies on unrelated functions. (Dragging
> major parts of the SDK wholesale into 4.4 defeats the purpose of
> switching to a vanilla kernel, and doesn't bring us closer to getting
> octeon-ethernet out of staging.)
> 
> Has there been any work on the octeon-ethernet driver since this patch
> set? https://www.linux-mips.org/archives/linux-mips/2015-08/msg00338.html
> 
> Any hints on what to pick out of the SDK code to improve 10G
> performance would be appreciated.

One thing that is missing from staging driver for CN68XX is the proper
SSO initialization. But I see that you have already implemented that.

Unfortunately I don't have a proper CN68XX test system at the moment, so
CN68XX support has not progressed much since that patch set from my side.

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


[PATCH] staging/lustre: Fix max_dirty_mb output in sysfs

2016-08-25 Thread Oleg Drokin
%ul definitely was supposed to be %lu in the format string,
so we print long unsigned int value, not just unsigned int
with a letter l added at the end.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c 
b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c
index 8f70dd2..bcf005d 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c
@@ -95,8 +95,9 @@ LUSTRE_STATIC_UINT_ATTR(timeout, &obd_timeout);
 static ssize_t max_dirty_mb_show(struct kobject *kobj, struct attribute *attr,
 char *buf)
 {
-   return sprintf(buf, "%ul\n",
-   obd_max_dirty_pages / (1 << (20 - PAGE_SHIFT)));
+   return sprintf(buf, "%lu\n",
+  (unsigned long)obd_max_dirty_pages /
+  (1 << (20 - PAGE_SHIFT)));
 }
 
 static ssize_t max_dirty_mb_store(struct kobject *kobj, struct attribute *attr,
-- 
2.7.4

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


[PATCH] Staging: wlan-ng: removed switch-case statements with macro

2016-08-25 Thread Claudiu Beznea
This patch removes multiple switch-case statements
with a new macro. The macro will generate the
corresponding bit mask based on the key index
received as input.

Signed-off-by: Claudiu Beznea 
---
 drivers/staging/wlan-ng/cfg80211.c  | 85 ++---
 drivers/staging/wlan-ng/p80211metadef.h |  4 ++
 2 files changed, 19 insertions(+), 70 deletions(-)

diff --git a/drivers/staging/wlan-ng/cfg80211.c 
b/drivers/staging/wlan-ng/cfg80211.c
index f46dfe6..73ba264 100644
--- a/drivers/staging/wlan-ng/cfg80211.c
+++ b/drivers/staging/wlan-ng/cfg80211.c
@@ -150,6 +150,9 @@ static int prism2_add_key(struct wiphy *wiphy, struct 
net_device *dev,
int err = 0;
int result = 0;
 
+   if (key_index >= NUM_WEPKEYS)
+   return -EINVAL;
+
switch (params->cipher) {
case WLAN_CIPHER_SUITE_WEP40:
case WLAN_CIPHER_SUITE_WEP104:
@@ -160,27 +163,7 @@ static int prism2_add_key(struct wiphy *wiphy, struct 
net_device *dev,
goto exit;
 
/* send key to driver */
-   switch (key_index) {
-   case 0:
-   did = 
DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey0;
-   break;
-
-   case 1:
-   did = 
DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey1;
-   break;
-
-   case 2:
-   did = 
DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey2;
-   break;
-
-   case 3:
-   did = 
DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey3;
-   break;
-
-   default:
-   err = -EINVAL;
-   goto exit;
-   }
+   did = DIDmib_dot11smt_dot11WEPDefaultKeysTable_key(key_index + 
1);
 
result = prism2_domibset_pstr32(wlandev, did,
params->key_len, params->key);
@@ -242,36 +225,13 @@ static int prism2_del_key(struct wiphy *wiphy, struct 
net_device *dev,
 * a key, so we will cheat by setting the key to a bogus value
 */
 
-   /* send key to driver */
-   switch (key_index) {
-   case 0:
-   did =
-   
DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey0;
-   break;
-
-   case 1:
-   did =
-   
DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey1;
-   break;
-
-   case 2:
-   did =
-   
DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey2;
-   break;
-
-   case 3:
-   did =
-   
DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey3;
-   break;
-
-   default:
-   err = -EINVAL;
-   goto exit;
-   }
+   if (key_index >= NUM_WEPKEYS)
+   return -EINVAL;
 
+   /* send key to driver */
+   did = DIDmib_dot11smt_dot11WEPDefaultKeysTable_key(key_index + 1);
result = prism2_domibset_pstr32(wlandev, did, 13, "0");
 
-exit:
if (result)
err = -EFAULT;
 
@@ -529,6 +489,11 @@ static int prism2_connect(struct wiphy *wiphy, struct 
net_device *dev,
/* Set the encryption - we only support wep */
if (is_wep) {
if (sme->key) {
+   if (sme->key_idx >= NUM_WEPKEYS) {
+   err = -EINVAL;
+   goto exit;
+   }
+
result = prism2_domibset_uint32(wlandev,

DIDmib_dot11smt_dot11PrivacyTable_dot11WEPDefaultKeyID,
sme->key_idx);
@@ -536,28 +501,8 @@ static int prism2_connect(struct wiphy *wiphy, struct 
net_device *dev,
goto exit;
 
/* send key to driver */
-   switch (sme->key_idx) {
-   case 0:
-   did = 
DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey0;
-   break;
-
-   case 1:
-   did = 
DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey1;
-   break;
-
-   case 2:
-   did = 
DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey2;
-   break;
-
-   case 3:
-   did = 
DIDmib_dot11smt_dot11WEPDefaultKeysTable_dot11WEPDefaultKey3;
-   break;
-
-   default:
-   err = -EINVAL;
-   goto exit;
-   }
-
+   did = DIDmib_dot11smt_dot11WEPDef

Re: Improving OCTEON II 10G Ethernet performance

2016-08-25 Thread Aaro Koskinen
Hi,

On Thu, Aug 25, 2016 at 09:50:15AM -0700, David Daney wrote:
> Ideally we would configure the packet classifiers on the RX side to create
> multiple RX queues based on a hash of the TCP 5-tuple, and handle each queue
> with a single NAPI instance.  That should result in better performance while
> maintaining packet ordering.

Would this need anything else than reprogramming CVMX_PIP_PRT_TAGX, and
eliminating the global pow_receive_group and creating multiple NAPI instances
and registering IRQ handlers?

In the Yocto tree, the CVMX_PIP_PRT_TAGX register values are actually
documented:

http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-contrib/tree/arch/mips/include/asm/octeon/cvmx-pip-defs.h?h=apaliwal/octeon#n3737

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


Re: Improving OCTEON II 10G Ethernet performance

2016-08-25 Thread David Daney

On 08/25/2016 11:22 AM, Aaro Koskinen wrote:

Hi,

On Thu, Aug 25, 2016 at 09:50:15AM -0700, David Daney wrote:

Ideally we would configure the packet classifiers on the RX side to create
multiple RX queues based on a hash of the TCP 5-tuple, and handle each queue
with a single NAPI instance.  That should result in better performance while
maintaining packet ordering.


Would this need anything else than reprogramming CVMX_PIP_PRT_TAGX, and
eliminating the global pow_receive_group and creating multiple NAPI instances
and registering IRQ handlers?



That is essentially how it works.  Set the tag generation parameters, 
and use the low order bits of the tag to select which POW/SSO group is 
assigned.  The SSO group corresponds to an "rx queue"




In the Yocto tree, the CVMX_PIP_PRT_TAGX register values are actually
documented:

http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-contrib/tree/arch/mips/include/asm/octeon/cvmx-pip-defs.h?h=apaliwal/octeon#n3737


Wow, I didn't realize that documentation was made public.




A.



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


Re: Improving OCTEON II 10G Ethernet performance

2016-08-25 Thread David Daney

On 08/24/2016 06:29 PM, Ed Swierk wrote:

I'm trying to migrate from the Octeon SDK to a vanilla Linux 4.4
kernel for a Cavium OCTEON II (CN6880) board running in 64-bit
little-endian mode. So far I've gotten most of the hardware features I
need working, including XAUI/RXAUI, USB, boot bus and I2C, with a
fairly small set of patches.
https://github.com/skyportsystems/linux/compare/master...octeon2



It is unclear what your motivations for doing this are, so I can think 
of several things you could do:


A) Get v4.4 based SDK from Cavium.

B) Major rewrite of octeon-ethernet driver.

C) Live with current staging driver.


The biggest remaining hurdle is improving 10G Ethernet performance:
iperf -P 10 on the SDK kernel gets close to 10 Gbit/sec throughput,
while on my 4.4 kernel, it tops out around 1 Gbit/sec.

Comparing the octeon-ethernet driver in the SDK
(http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-contrib/tree/drivers/net/ethernet/octeon?h=apaliwal/octeon)
against the one in 4.4, the latter appears to utilize only a single
CPU core for the rx path. It's not clear to me if there is a similar
issue on the tx side, or other bottlenecks.


The main limiting factor to performance is single threaded RX 
processing.  The main manner this is handled in the out-of-tree vendor 
driver is to have multiple NAPI processing threads running against the 
same RX queue when there is a queue backlog.  The disadvantage of doing 
this is that packets may be received out of order due to 
non-synchronization across multiple CPUs.


On the TX side, the locks on the queuing discipline can become contended 
leading to cache line bouncing.  In the TX code of the driver itself, 
there should be no impediments to parallel TX operations.


Ideally we would configure the packet classifiers on the RX side to 
create multiple RX queues based on a hash of the TCP 5-tuple, and handle 
each queue with a single NAPI instance.  That should result in better 
performance while maintaining packet ordering.





I started trying to port multi-CPU rx from the SDK octeon-ethernet
driver, but had trouble teasing out just the necessary bits without
following a maze of dependencies on unrelated functions. (Dragging
major parts of the SDK wholesale into 4.4 defeats the purpose of
switching to a vanilla kernel, and doesn't bring us closer to getting
octeon-ethernet out of staging.)


Yes, you have identified the main problem with this code.

All the code managing the SerDes and other MAC functions needs a 
complete rewrite.  One main problem is that all the SerDes/MACs in the 
system are configured simultaneously instead of on a per device basis. 
There are also a plethora of different SerDes technologies in use: 
(RGMII, SGMII, QSGMII, XFI, XAUI, RXAUI, SPI-4.1, XLAUI, KR, ...)  The 
code that handles all of these is mixed together with huge case 
statements switching on interface mode all over the place.


There is also code to handle target-mode PCI/PCIe packet engines mixed 
in as well.  This stuff should probably be removed.





Has there been any work on the octeon-ethernet driver since this patch
set? https://www.linux-mips.org/archives/linux-mips/2015-08/msg00338.html

Any hints on what to pick out of the SDK code to improve 10G
performance would be appreciated.

--Ed



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


Re: Improving OCTEON II 10G Ethernet performance

2016-08-25 Thread Aaro Koskinen
Hi,

On Thu, Aug 25, 2016 at 01:11:45PM -0700, David Daney wrote:
> On 08/25/2016 11:22 AM, Aaro Koskinen wrote:
> >On Thu, Aug 25, 2016 at 09:50:15AM -0700, David Daney wrote:
> >>Ideally we would configure the packet classifiers on the RX side to create
> >>multiple RX queues based on a hash of the TCP 5-tuple, and handle each queue
> >>with a single NAPI instance.  That should result in better performance while
> >>maintaining packet ordering.
> >
> >Would this need anything else than reprogramming CVMX_PIP_PRT_TAGX, and
> >eliminating the global pow_receive_group and creating multiple NAPI instances
> >and registering IRQ handlers?
> 
> That is essentially how it works.  Set the tag generation parameters, and
> use the low order bits of the tag to select which POW/SSO group is assigned.
> The SSO group corresponds to an "rx queue"

OK, I will try to experiment with this. Even though my home routers are
2-core only I could still create more queues and verify that the traffic
gets distributed by checking the counters...

> >In the Yocto tree, the CVMX_PIP_PRT_TAGX register values are actually
> >documented:
> >
> >http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-contrib/tree/arch/mips/include/asm/octeon/cvmx-pip-defs.h?h=apaliwal/octeon#n3737
> 
> Wow, I didn't realize that documentation was made public.

Also D-Link and Qbiquity GPL source offerings for their products usually
include documentation for register fields. Only in mainline kernel they
are missing.

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


Re: Improving OCTEON II 10G Ethernet performance

2016-08-25 Thread David Daney

On 08/25/2016 02:18 PM, Aaro Koskinen wrote:

Hi,

On Thu, Aug 25, 2016 at 01:11:45PM -0700, David Daney wrote:

On 08/25/2016 11:22 AM, Aaro Koskinen wrote:

On Thu, Aug 25, 2016 at 09:50:15AM -0700, David Daney wrote:

Ideally we would configure the packet classifiers on the RX side to create
multiple RX queues based on a hash of the TCP 5-tuple, and handle each queue
with a single NAPI instance.  That should result in better performance while
maintaining packet ordering.


Would this need anything else than reprogramming CVMX_PIP_PRT_TAGX, and
eliminating the global pow_receive_group and creating multiple NAPI instances
and registering IRQ handlers?


That is essentially how it works.  Set the tag generation parameters, and
use the low order bits of the tag to select which POW/SSO group is assigned.
The SSO group corresponds to an "rx queue"


OK, I will try to experiment with this. Even though my home routers are
2-core only I could still create more queues and verify that the traffic
gets distributed by checking the counters...



You will have to set proper SSO group masks, etc. when you do the get 
work operation, and who knows what else.


Good Luck!


In the Yocto tree, the CVMX_PIP_PRT_TAGX register values are actually
documented:

http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-contrib/tree/arch/mips/include/asm/octeon/cvmx-pip-defs.h?h=apaliwal/octeon#n3737


Wow, I didn't realize that documentation was made public.


Also D-Link and Qbiquity GPL source offerings for their products usually
include documentation for register fields. Only in mainline kernel they
are missing.



The desires of the Lawyers foiled again by the requirements of the GPL.


A.



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


Re: [RESEND PATCH] staging: octeon: Use IS_ENABLED() instead of checking for built-in or module

2016-08-25 Thread Javier Martinez Canillas
Hello David,

On 08/25/2016 12:01 PM, David Daney wrote:
> On 08/25/2016 06:55 AM, Javier Martinez Canillas wrote:
>> The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
>> built-in or as a module, use that macro instead of open coding the same.
>>
>> Using the macro makes the code more readable by helping abstract away some
>> of the Kconfig built-in and module enable details.
>>
>> Signed-off-by: Javier Martinez Canillas 
>> Acked-by: David Daney 
>>
>> ---
>>
>> Changes since first post:
>> - Added David Daney Acked-by tag.
>> - Rebased on top of latest master.
>>
> 
> You changed something about the patch.  In this case the Subject is not 
> "RESEND", but rather "v2".  Incorrect Subject lines like this can lead to the 
> patch being inadvertently ignored.
>

Yes, in fact I thought about adding a v2 suffix instead of RESEND but since
I didn't change the patch content (besides merge conflicts resolution), I
preferred to add the latter.

I can re-spin the patch if that's an issue.

> David Daney
> 
 
Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel