Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-12 Thread Marek Vasut
On Sunday, July 13, 2014 at 05:07:10 AM, Chen Gang wrote:
> Several drivers need 'devm_ioremap_resource' which need HAS_IOMEM enabled.
> So let them depend on HAS_IOMEM.
> 
> The related error (with allmodconfig under score):
> 
> MODPOST 1365 modules
>   ERROR: "devm_ioremap_resource" [drivers/watchdog/tegra_wdt.ko] undefined!
>   ERROR: "devm_ioremap_resource" [drivers/watchdog/of_xilinx_wdt.ko]
> undefined! ERROR: "devm_ioremap_resource"
> [drivers/staging/iio/adc/mxs-lradc.ko] undefined! ERROR:
> "devm_ioremap_resource" [drivers/pwm/pwm-clps711x.ko] undefined! ERROR:
> "devm_ioremap_resource" [drivers/input/serio/olpc_apsp.ko] undefined!
> ERROR: "devm_ioremap_resource" [drivers/input/serio/arc_ps2.ko] undefined!

This stuff should go through different trees, so I'd suggest to split this into 
multiple patches. Thanks for catching this stuff !

Best regards,
Marek Vasut
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] reformat_with_checkpatch: Add automation to checkpatch

2014-07-12 Thread Joe Perches
On Sat, 2014-07-12 at 12:28 -0700, Greg KH wrote:
> On Sat, Jul 12, 2014 at 11:29:37AM -0700, Joe Perches wrote:
> > On Sat, 2014-07-12 at 10:55 -0700, Greg KH wrote:
> > > Yes, the warnings are all due to line-length, but Joe, you shouldn't add
> > > a patch that causes more checkpatch warnings than before :)
> > 
> > Yeah, that was intentional though.
> > 
> > This script does a series of relatively discrete changes.
> > 
> > Lindent would more or less work, but it's _horrible_ at
> > wrapping overlong lines and merges all types of changes
> > together.
> 
> Oh I agree, I don't want to see Lindent, but maybe, if the patch adds
> checkpatch warnings, it should be at least "flagged" as maybe a problem?

The script I submitted does run checkpatch
before any commit is done.

> Would you want to be on the receiving end of this patch script?

You might have noticed I don't have a kernel.org
account.


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


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-12 Thread Chen Gang

After this last patch, score architecture can pass allmodconfig. :-)

And also find a compiler issue, I will try to fix it, but shall not notify
kernel mailing list, again. The related issue is below (it seems a kernel
issue, but in fact, it is a compiler's issue):

CC [M]  drivers/staging/lustre/lustre/ptlrpc/sec.o
  drivers/staging/lustre/lustre/ptlrpc/sec.c: In function 
'sptlrpc_cli_ctx_expire':
  drivers/staging/lustre/lustre/ptlrpc/sec.c:309:13: error: 'struct 
ptlrpc_ctx_ops' has no member named '__die'
ctx->cc_ops->die(ctx, 0);
   ^
  drivers/staging/lustre/lustre/ptlrpc/sec.c: In function 'ctx_refresh_timeout':
  drivers/staging/lustre/lustre/ptlrpc/sec.c:594:26: error: 'struct 
ptlrpc_ctx_ops' has no member named '__die'
 req->rq_cli_ctx->cc_ops->die(req->rq_cli_ctx, 0);
^
  make[5]: *** [drivers/staging/lustre/lustre/ptlrpc/sec.o] Error 1
  make[4]: *** [drivers/staging/lustre/lustre/ptlrpc] Error 2
  make[3]: *** [drivers/staging/lustre/lustre] Error 2
  make[2]: *** [drivers/staging/lustre] Error 2
  make[1]: *** [drivers/staging] Error 2
  make: *** [drivers] Error 2

Thanks.

On 07/13/2014 11:07 AM, Chen Gang wrote:
> Several drivers need 'devm_ioremap_resource' which need HAS_IOMEM enabled.
> So let them depend on HAS_IOMEM.
> 
> The related error (with allmodconfig under score):
> 
> MODPOST 1365 modules
>   ERROR: "devm_ioremap_resource" [drivers/watchdog/tegra_wdt.ko] undefined!
>   ERROR: "devm_ioremap_resource" [drivers/watchdog/of_xilinx_wdt.ko] 
> undefined!
>   ERROR: "devm_ioremap_resource" [drivers/staging/iio/adc/mxs-lradc.ko] 
> undefined!
>   ERROR: "devm_ioremap_resource" [drivers/pwm/pwm-clps711x.ko] undefined!
>   ERROR: "devm_ioremap_resource" [drivers/input/serio/olpc_apsp.ko] undefined!
>   ERROR: "devm_ioremap_resource" [drivers/input/serio/arc_ps2.ko] undefined!
> 
> 
> Signed-off-by: Chen Gang 
> ---
>  drivers/input/serio/Kconfig | 3 ++-
>  drivers/pwm/Kconfig | 2 +-
>  drivers/staging/iio/adc/Kconfig | 2 +-
>  drivers/watchdog/Kconfig| 3 ++-
>  4 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig
> index bc2d474..449d45f 100644
> --- a/drivers/input/serio/Kconfig
> +++ b/drivers/input/serio/Kconfig
> @@ -244,6 +244,7 @@ config SERIO_PS2MULT
>  
>  config SERIO_ARC_PS2
>   tristate "ARC PS/2 support"
> + depends on HAS_IOMEM
>   help
> Say Y here if you have an ARC FPGA platform with a PS/2
> controller in it.
> @@ -263,7 +264,7 @@ config SERIO_APBPS2
>  
>  config SERIO_OLPC_APSP
>   tristate "OLPC AP-SP input support"
> - depends on OLPC || COMPILE_TEST
> + depends on (OLPC || COMPILE_TEST) && HAS_IOMEM
>   help
> Say Y here if you want support for the keyboard and touchpad included
> in the OLPC XO-1.75 and XO-4 laptops.
> diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
> index 4ad7b89..2faf5ce 100644
> --- a/drivers/pwm/Kconfig
> +++ b/drivers/pwm/Kconfig
> @@ -82,7 +82,7 @@ config PWM_BFIN
>  
>  config PWM_CLPS711X
>   tristate "CLPS711X PWM support"
> - depends on ARCH_CLPS711X || COMPILE_TEST
> + depends on (ARCH_CLPS711X || COMPILE_TEST) && HAS_IOMEM
>   help
> Generic PWM framework driver for Cirrus Logic CLPS711X.
>  
> diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig
> index b87e382..4e927d2 100644
> --- a/drivers/staging/iio/adc/Kconfig
> +++ b/drivers/staging/iio/adc/Kconfig
> @@ -94,7 +94,7 @@ config LPC32XX_ADC
>  
>  config MXS_LRADC
>   tristate "Freescale i.MX23/i.MX28 LRADC"
> - depends on ARCH_MXS || COMPILE_TEST
> + depends on (ARCH_MXS || COMPILE_TEST) && HAS_IOMEM
>   depends on INPUT
>   select STMP_DEVICE
>   select IIO_BUFFER
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 76dd541..0e4abb2 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -113,6 +113,7 @@ config WM8350_WATCHDOG
>  
>  config XILINX_WATCHDOG
>   tristate "Xilinx Watchdog timer"
> + depends on HAS_IOMEM
>   select WATCHDOG_CORE
>   help
> Watchdog driver for the xps_timebase_wdt ip core.
> @@ -434,7 +435,7 @@ config SIRFSOC_WATCHDOG
>  
>  config TEGRA_WATCHDOG
>   tristate "Tegra watchdog"
> - depends on ARCH_TEGRA || COMPILE_TEST
> + depends on (ARCH_TEGRA || COMPILE_TEST) && HAS_IOMEM
>   select WATCHDOG_CORE
>   help
> Say Y here to include support for the watchdog timer
> 


-- 
Chen Gang

Open share and attitude like air water and life which God blessed
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-12 Thread Chen Gang
Several drivers need 'devm_ioremap_resource' which need HAS_IOMEM enabled.
So let them depend on HAS_IOMEM.

The related error (with allmodconfig under score):

MODPOST 1365 modules
  ERROR: "devm_ioremap_resource" [drivers/watchdog/tegra_wdt.ko] undefined!
  ERROR: "devm_ioremap_resource" [drivers/watchdog/of_xilinx_wdt.ko] undefined!
  ERROR: "devm_ioremap_resource" [drivers/staging/iio/adc/mxs-lradc.ko] 
undefined!
  ERROR: "devm_ioremap_resource" [drivers/pwm/pwm-clps711x.ko] undefined!
  ERROR: "devm_ioremap_resource" [drivers/input/serio/olpc_apsp.ko] undefined!
  ERROR: "devm_ioremap_resource" [drivers/input/serio/arc_ps2.ko] undefined!


Signed-off-by: Chen Gang 
---
 drivers/input/serio/Kconfig | 3 ++-
 drivers/pwm/Kconfig | 2 +-
 drivers/staging/iio/adc/Kconfig | 2 +-
 drivers/watchdog/Kconfig| 3 ++-
 4 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig
index bc2d474..449d45f 100644
--- a/drivers/input/serio/Kconfig
+++ b/drivers/input/serio/Kconfig
@@ -244,6 +244,7 @@ config SERIO_PS2MULT
 
 config SERIO_ARC_PS2
tristate "ARC PS/2 support"
+   depends on HAS_IOMEM
help
  Say Y here if you have an ARC FPGA platform with a PS/2
  controller in it.
@@ -263,7 +264,7 @@ config SERIO_APBPS2
 
 config SERIO_OLPC_APSP
tristate "OLPC AP-SP input support"
-   depends on OLPC || COMPILE_TEST
+   depends on (OLPC || COMPILE_TEST) && HAS_IOMEM
help
  Say Y here if you want support for the keyboard and touchpad included
  in the OLPC XO-1.75 and XO-4 laptops.
diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
index 4ad7b89..2faf5ce 100644
--- a/drivers/pwm/Kconfig
+++ b/drivers/pwm/Kconfig
@@ -82,7 +82,7 @@ config PWM_BFIN
 
 config PWM_CLPS711X
tristate "CLPS711X PWM support"
-   depends on ARCH_CLPS711X || COMPILE_TEST
+   depends on (ARCH_CLPS711X || COMPILE_TEST) && HAS_IOMEM
help
  Generic PWM framework driver for Cirrus Logic CLPS711X.
 
diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig
index b87e382..4e927d2 100644
--- a/drivers/staging/iio/adc/Kconfig
+++ b/drivers/staging/iio/adc/Kconfig
@@ -94,7 +94,7 @@ config LPC32XX_ADC
 
 config MXS_LRADC
tristate "Freescale i.MX23/i.MX28 LRADC"
-   depends on ARCH_MXS || COMPILE_TEST
+   depends on (ARCH_MXS || COMPILE_TEST) && HAS_IOMEM
depends on INPUT
select STMP_DEVICE
select IIO_BUFFER
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 76dd541..0e4abb2 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -113,6 +113,7 @@ config WM8350_WATCHDOG
 
 config XILINX_WATCHDOG
tristate "Xilinx Watchdog timer"
+   depends on HAS_IOMEM
select WATCHDOG_CORE
help
  Watchdog driver for the xps_timebase_wdt ip core.
@@ -434,7 +435,7 @@ config SIRFSOC_WATCHDOG
 
 config TEGRA_WATCHDOG
tristate "Tegra watchdog"
-   depends on ARCH_TEGRA || COMPILE_TEST
+   depends on (ARCH_TEGRA || COMPILE_TEST) && HAS_IOMEM
select WATCHDOG_CORE
help
  Say Y here to include support for the watchdog timer
-- 
1.7.11.7
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RESEND PATCH] staging: android: Clean up binder_buffer_size()

2014-07-12 Thread Greg Kroah-Hartman
On Sat, Jul 12, 2014 at 09:50:09PM -0300, Lucas Tanure wrote:
> Kernel coding style. Remove useless else statement after return.
> 
> Signed-off-by: Lucas Tanure 
> ---
>  drivers/staging/android/binder.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

What tree are you making this patch against?  Someone already has this
patch accepted into my staging-next branch, which means that linux-next
also should show this change in it.

thanks,

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


[PATCH] dgnc: DGNC_VERIFY_BOARD macro in do while block

2014-07-12 Thread Jeremiah Mahler
Enclose the body of the multi-statement DGNC_VERIFY_BOARD macro inside a
do - while block as per Documentation/CodingStyle.  Fixes 1 error found
by checkpatch.pl.

Signed-off-by: Jeremiah Mahler 
---
 drivers/staging/dgnc/dgnc_sysfs.c | 20 +++-
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_sysfs.c 
b/drivers/staging/dgnc/dgnc_sysfs.c
index 0f0e8fc..3f321bb 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.c
+++ b/drivers/staging/dgnc/dgnc_sysfs.c
@@ -150,15 +150,17 @@ void dgnc_remove_driver_sysfiles(struct pci_driver 
*dgnc_driver)
 }
 
 
-#define DGNC_VERIFY_BOARD(p, bd)   \
-   if (!p) \
-   return 0;   \
-   \
-   bd = dev_get_drvdata(p);\
-   if (!bd || bd->magic != DGNC_BOARD_MAGIC)   \
-   return 0;   \
-   if (bd->state != BOARD_READY)   \
-   return 0;   \
+#define DGNC_VERIFY_BOARD(p, bd)   \
+   do {\
+   if (!p) \
+   return 0;   \
+   \
+   bd = dev_get_drvdata(p);\
+   if (!bd || bd->magic != DGNC_BOARD_MAGIC)   \
+   return 0;   \
+   if (bd->state != BOARD_READY)   \
+   return 0;   \
+   } while (0)
 
 
 
-- 
2.0.1

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


[RESEND PATCH] staging: android: Clean up binder_buffer_size()

2014-07-12 Thread Lucas Tanure
Kernel coding style. Remove useless else statement after return.

Signed-off-by: Lucas Tanure 
---
 drivers/staging/android/binder.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
index cfe4bc8..1a0966b 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -451,8 +451,7 @@ static size_t binder_buffer_size(struct binder_proc *proc,
 {
if (list_is_last(&buffer->entry, &proc->buffers))
return proc->buffer + proc->buffer_size - (void *)buffer->data;
-   else
-   return (size_t)list_entry(buffer->entry.next,
+   return (size_t)list_entry(buffer->entry.next,
struct binder_buffer, entry) - (size_t)buffer->data;
 }
 
-- 
2.0.1

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


[PATCH 2/2] staging: comedi: addi_apci_1564: use addi_watchdog module to init watchdog subdevice

2014-07-12 Thread Chase Southwood
Use the addi_watchdog module to provide support for the watchdog
subdevice.

Also, rearrange the subdevice init blocks so that the order makes sense.
Digital input/output subdevices and subdevices for DI/DO interrupt
support, followed by timer/counter/watchdog subdevices is the new order.

Signed-off-by: Chase Southwood 
Cc: Ian Abbott 
Cc: H Hartley Sweeten 
---
 drivers/staging/comedi/drivers/addi_apci_1564.c | 34 +++--
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c 
b/drivers/staging/comedi/drivers/addi_apci_1564.c
index 16f3b69..190b026 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1564.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1564.c
@@ -373,7 +373,7 @@ static int apci1564_auto_attach(struct comedi_device *dev,
dev->irq = pcidev->irq;
}
 
-   ret = comedi_alloc_subdevices(dev, 4);
+   ret = comedi_alloc_subdevices(dev, 5);
if (ret)
return ret;
 
@@ -397,20 +397,8 @@ static int apci1564_auto_attach(struct comedi_device *dev,
s->insn_bits = apci1564_do_insn_bits;
s->insn_read = apci1564_do_read;
 
-   /*  Allocate and Initialise Timer Subdevice Structures */
-   s = &dev->subdevices[2];
-   s->type = COMEDI_SUBD_TIMER;
-   s->subdev_flags = SDF_WRITEABLE;
-   s->n_chan = 1;
-   s->maxdata = 0;
-   s->len_chanlist = 1;
-   s->range_table = &range_digital;
-   s->insn_write = apci1564_timer_write;
-   s->insn_read = apci1564_timer_read;
-   s->insn_config = apci1564_timer_config;
-
/* Change-Of-State (COS) interrupt subdevice */
-   s = &dev->subdevices[3];
+   s = &dev->subdevices[2];
if (dev->irq) {
dev->read_subdev = s;
s->type = COMEDI_SUBD_DI;
@@ -428,6 +416,24 @@ static int apci1564_auto_attach(struct comedi_device *dev,
s->type = COMEDI_SUBD_UNUSED;
}
 
+   /*  Allocate and Initialise Timer Subdevice Structures */
+   s = &dev->subdevices[3];
+   s->type = COMEDI_SUBD_TIMER;
+   s->subdev_flags = SDF_WRITEABLE;
+   s->n_chan = 1;
+   s->maxdata = 0;
+   s->len_chanlist = 1;
+   s->range_table = &range_digital;
+   s->insn_write = apci1564_timer_write;
+   s->insn_read = apci1564_timer_read;
+   s->insn_config = apci1564_timer_config;
+
+   /* Initialize the watchdog subdevice */
+   s = &dev->subdevices[4];
+   ret = addi_watchdog_init(s, devpriv->amcc_iobase + APCI1564_WDOG_REG);
+   if (ret)
+   return ret;
+
return 0;
 }
 
-- 
2.0.1

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


[PATCH 1/2] staging: comedi: addi_apci_1564: driver no longer needs to include addi_common.h

2014-07-12 Thread Chase Southwood
This driver no longer depends on anything in addi_common.h, save for a
few headers that it was including indirectly.  Remove the include of
addi_common.h and add the includes of 
and  directly.

Signed-off-by: Chase Southwood 
Cc: Ian Abbott 
Cc: H Hartley Sweeten 
---
 drivers/staging/comedi/drivers/addi_apci_1564.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c 
b/drivers/staging/comedi/drivers/addi_apci_1564.c
index 1e25342..16f3b69 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1564.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1564.c
@@ -1,13 +1,13 @@
 #include 
 #include 
+#include 
+#include 
 
 #include "../comedidev.h"
 #include "comedi_fc.h"
 #include "amcc_s5933.h"
 #include "addi_watchdog.h"
 
-#include "addi-data/addi_common.h"
-
 struct apci1564_private {
unsigned int amcc_iobase;   /* base of AMCC I/O registers */
unsigned int mode1; /* riding-edge/high level channels */
-- 
2.0.1

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


[PATCH] Remove useless else after a return statement

2014-07-12 Thread Lucas Tanure
Run Checkpatch and fixed the first warning.

Signed-off-by: Lucas Tanure 
---
 drivers/staging/android/binder.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
index cfe4bc8..1a0966b 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -451,8 +451,7 @@ static size_t binder_buffer_size(struct binder_proc *proc,
 {
if (list_is_last(&buffer->entry, &proc->buffers))
return proc->buffer + proc->buffer_size - (void *)buffer->data;
-   else
-   return (size_t)list_entry(buffer->entry.next,
+   return (size_t)list_entry(buffer->entry.next,
struct binder_buffer, entry) - (size_t)buffer->data;
 }
 
-- 
2.0.1

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


[PATCH] staging: android: Coding style fix

2014-07-12 Thread Modestas Stankus
This patch fixes warnings of checkpatch.pl script:
WARNING: void function return statements are not generally useful
+   return;
+}

Task of Eudyptula challenge.
---
 drivers/staging/android/ion/ion_carveout_heap.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion_carveout_heap.c 
b/drivers/staging/android/ion/ion_carveout_heap.c
index dcb6f21..9156d82 100644
--- a/drivers/staging/android/ion/ion_carveout_heap.c
+++ b/drivers/staging/android/ion/ion_carveout_heap.c
@@ -133,7 +133,6 @@ static struct sg_table *ion_carveout_heap_map_dma(struct 
ion_heap *heap,
 static void ion_carveout_heap_unmap_dma(struct ion_heap *heap,
struct ion_buffer *buffer)
 {
-   return;
 }
 
 static struct ion_heap_ops carveout_heap_ops = {
-- 
2.0.1

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


[GIT PULL] Staging driver fixes for 3.16-rc5

2014-07-12 Thread Greg KH
The following changes since commit cd3de83f147601356395b57a8673e9c5ff1e59d1:

  Linux 3.16-rc4 (2014-07-06 12:37:51 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/ 
tags/staging-3.16-rc5

for you to fetch changes up to bdac8ca90e07edde8bbef5396784f7011e6e5b8d:

  Merge tag 'iio-fixes-for-3.16c' of 
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus 
(2014-07-08 15:43:45 -0700)


Staging / IIO fixes for 3.16-rc5

Here are some IIO driver fixes for 3.16-rc5.  Nothing major, just
resolves some minor issues that have been reported.

Signed-off-by: Greg Kroah-Hartman 


Greg Kroah-Hartman (1):
  Merge tag 'iio-fixes-for-3.16c' of git://git.kernel.org/.../jic23/iio 
into staging-linus

Jan Kardell (1):
  iio: ti_am335x_adc: Fix: Use same step id at FIFOs both ends

Peter Meerwald (1):
  iio:tcs3472: Check for buffer enabled and locking

Sachin Kamat (6):
  iio: hid-sensor-press: Fix return values
  iio: hid-sensor-accel-3d: Fix return values
  iio: hid-sensor-magn-3d: Fix return values
  iio: hid-sensor-als: Fix return values
  iio: hid-sensor-gyro-3d: Fix return values
  iio: hid-sensor-prox: Fix return values

 drivers/iio/accel/hid-sensor-accel-3d.c   |  7 ++-
 drivers/iio/adc/ti_am335x_adc.c   |  2 +-
 drivers/iio/gyro/hid-sensor-gyro-3d.c |  7 ++-
 drivers/iio/light/hid-sensor-als.c|  7 ++-
 drivers/iio/light/hid-sensor-prox.c   |  7 ++-
 drivers/iio/light/tcs3472.c   | 11 ++-
 drivers/iio/magnetometer/hid-sensor-magn-3d.c |  7 ++-
 drivers/iio/pressure/hid-sensor-press.c   |  7 ++-
 8 files changed, 23 insertions(+), 32 deletions(-)
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: android: Cleanup style issues

2014-07-12 Thread Greg KH
On Sat, Jul 12, 2014 at 01:23:10PM -0700, Greg KH wrote:
> On Sat, Jul 12, 2014 at 09:55:56PM +0200, Peter Senna Tschudin wrote:
> > This patch fixes the following checkpatch warnings:
> >  - Remove else after return
> >  - Add space after declaration
> > 
> > Tested by compilation only.
> > 
> > Signed-off-by: Peter Senna Tschudin 
> > ---
> >  drivers/staging/android/sync_debug.c | 11 ---
> >  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> This file is no longer in my kernel tree, what tree did you make it
> against?
> 
> Please create staging patches against the staging-next branch of the
> staging.git tree on git.kernel.org so that I can apply them.

Ah, nevermind, things moved around here, I figured this out, sorry for
the noise...

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


Re: [PATCH] staging: android: Cleanup style issues

2014-07-12 Thread Greg KH
On Sat, Jul 12, 2014 at 09:55:56PM +0200, Peter Senna Tschudin wrote:
> This patch fixes the following checkpatch warnings:
>  - Remove else after return
>  - Add space after declaration
> 
> Tested by compilation only.
> 
> Signed-off-by: Peter Senna Tschudin 
> ---
>  drivers/staging/android/sync_debug.c | 11 ---
>  1 file changed, 8 insertions(+), 3 deletions(-)

This file is no longer in my kernel tree, what tree did you make it
against?

Please create staging patches against the staging-next branch of the
staging.git tree on git.kernel.org so that I can apply them.

thanks,

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


[PATCH] staging: android: Cleanup style issues

2014-07-12 Thread Peter Senna Tschudin
This patch fixes the following checkpatch warnings:
 - Remove else after return
 - Add space after declaration

Tested by compilation only.

Signed-off-by: Peter Senna Tschudin 
---
 drivers/staging/android/sync_debug.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/android/sync_debug.c 
b/drivers/staging/android/sync_debug.c
index a9f7fd5..257fc91 100644
--- a/drivers/staging/android/sync_debug.c
+++ b/drivers/staging/android/sync_debug.c
@@ -74,10 +74,11 @@ static const char *sync_status_str(int status)
 {
if (status == 0)
return "signaled";
-   else if (status > 0)
+
+   if (status > 0)
return "active";
-   else
-   return "error";
+
+   return "error";
 }
 
 static void sync_print_pt(struct seq_file *s, struct sync_pt *pt, bool fence)
@@ -95,12 +96,14 @@ static void sync_print_pt(struct seq_file *s, struct 
sync_pt *pt, bool fence)
 
if (status <= 0) {
struct timeval tv = ktime_to_timeval(pt->base.timestamp);
+
seq_printf(s, "@%ld.%06ld", tv.tv_sec, tv.tv_usec);
}
 
if (parent->ops->timeline_value_str &&
parent->ops->pt_value_str) {
char value[64];
+
parent->ops->pt_value_str(pt, value, sizeof(value));
seq_printf(s, ": %s", value);
if (fence) {
@@ -122,6 +125,7 @@ static void sync_print_obj(struct seq_file *s, struct 
sync_timeline *obj)
 
if (obj->ops->timeline_value_str) {
char value[64];
+
obj->ops->timeline_value_str(obj, value, sizeof(value));
seq_printf(s, ": %s", value);
}
@@ -234,6 +238,7 @@ void sync_dump(void)
for (i = 0; i < s.count; i += DUMP_CHUNK) {
if ((s.count - i) > DUMP_CHUNK) {
char c = s.buf[i + DUMP_CHUNK];
+
s.buf[i + DUMP_CHUNK] = 0;
pr_cont("%s", s.buf + i);
s.buf[i + DUMP_CHUNK] = c;
-- 
1.9.3

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


Re: [PATCH] reformat_with_checkpatch: Add automation to checkpatch

2014-07-12 Thread Greg KH
On Sat, Jul 12, 2014 at 11:29:37AM -0700, Joe Perches wrote:
> On Sat, 2014-07-12 at 10:55 -0700, Greg KH wrote:
> > Yes, the warnings are all due to line-length, but Joe, you shouldn't add
> > a patch that causes more checkpatch warnings than before :)
> 
> Yeah, that was intentional though.
> 
> This script does a series of relatively discrete changes.
> 
> Lindent would more or less work, but it's _horrible_ at
> wrapping overlong lines and merges all types of changes
> together.

Oh I agree, I don't want to see Lindent, but maybe, if the patch adds
checkpatch warnings, it should be at least "flagged" as maybe a problem?

> > While I always want to see more developers get involved with kernel
> > development, there should be a minimum barrier to entry.  And that
> > barrier is the knowledge of the C language, and knowledge of how to edit
> > a text file, and use git.  This script takes that barrier away, for
> > whitespace cleanups, with not much real use overall.
> > 
> > So, I'll keep my local copy of this script now, just to have fun with at
> > times when I'm bored.  But I don't think it should be merged, as-is.
> 
> Dunno, I still think it's useful.

For you, and me, but the world?

Would you want to be on the receiving end of this patch script?  I
don't, and I'm willing to take almost any patch cleanup for staging
code.  I think that says something :)

> Maybe when you get new code, you might run it through a
> script like this before committing it.

I will keep it for me, like I said.

thanks,

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


[PATCH] staging: iio: adc: ad7192: fix coding style

2014-07-12 Thread Marcus Folkesson
Line over 80 characters. This is for Eudyptula Challenge.

Signed-off-by: Marcus Folkesson 
---
 drivers/staging/iio/adc/ad7192.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index 83bb44b..c25c9ab 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -223,7 +223,8 @@ static int ad7192_setup(struct ad7192_state *st,
id &= AD7192_ID_MASK;
 
if (id != st->devid)
-   dev_warn(&st->sd.spi->dev, "device ID query failed (0x%X)\n", 
id);
+   dev_warn(&st->sd.spi->dev,
+   "device ID query failed (0x%X)\n", id);
 
switch (pdata->clock_source_sel) {
case AD7192_CLK_EXT_MCLK1_2:
-- 
2.0.0.rc0

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


Re: [PATCH] reformat_with_checkpatch: Add automation to checkpatch

2014-07-12 Thread Joe Perches
On Sat, 2014-07-12 at 10:55 -0700, Greg KH wrote:
> Yes, the warnings are all due to line-length, but Joe, you shouldn't add
> a patch that causes more checkpatch warnings than before :)

Yeah, that was intentional though.

This script does a series of relatively discrete changes.

Lindent would more or less work, but it's _horrible_ at
wrapping overlong lines and merges all types of changes
together.

For now, people are probably better at line wrapping in
an acceptable way.

> While I always want to see more developers get involved with kernel
> development, there should be a minimum barrier to entry.  And that
> barrier is the knowledge of the C language, and knowledge of how to edit
> a text file, and use git.  This script takes that barrier away, for
> whitespace cleanups, with not much real use overall.
> 
> So, I'll keep my local copy of this script now, just to have fun with at
> times when I'm bored.  But I don't think it should be merged, as-is.

Dunno, I still think it's useful.

Maybe when you get new code, you might run it through a
script like this before committing it.


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


Re: [PATCH] reformat_with_checkpatch: Add automation to checkpatch

2014-07-12 Thread Greg KH
On Sat, Jul 12, 2014 at 12:30:43PM +0300, Dan Carpenter wrote:
> On Fri, Jul 11, 2014 at 06:40:16PM -0700, Joe Perches wrote:
> > On Fri, 2014-07-11 at 18:34 -0700, Greg KH wrote:
> > > On Fri, Jul 11, 2014 at 06:21:27PM -0700, Joe Perches wrote:
> > > > A simple script to run checkpatch --fix for various types of
> > > > of cleanups.
> > > > 
> > > > This script is useful primarily for staging.
> > > > 
> > > > This reformats code to a more CodingStyle conforming style,
> > > > compiles it, verifies that the object code hasn't changed,
> > > > and git commits it too.
> > > 
> > > And 'git commits' it?
> > 
> > The thought I had was to made it easier to
> > submit "my first kernel patch" correctly.
> > like that tuxradar article you wrote a few
> > years ago.
> > 
> > http://www.tuxradar.com/content/newbies-guide-hacking-linux-kernel
> > 
> > > Heh, I should just run this myself to clean up
> > > staging and beat everyone else to it...
> > 
> > At least for the whitespace noise, you could
> > but I hope it'll encourage a few more people
> > to try kernel patching instead.
> 
> I have always hate the idea of automated patches from random people
> because I don't trust them to not be malicious so I have to review them
> manually.  There is a story that back in the day the US government paid
> someone to send tons of checkpatch style patches to BSD.  The guy
> thought he was "cleaning up the code" but actually he was part of a
> larger scheme to flood the maintainers with patches so another person
> could slip in some malicious code.

Based on some of the patches that I get sent, I wouldn't be surprised if
that's already happening :(

> It's better if someone just ran this on all new staging code before
> adding it to the tree.

I spent some time messing with this script today, and while it is "fun"
to run, I don't think it's all that useful.

One example, before running the script:

~/linux/work/staging $ ./scripts/checkpatch.pl --terse --file 
drivers/staging/android/binder.c | tail -n 1
total: 0 errors, 103 warnings, 3670 lines checked

After running it:

~/linux/work/staging $ ./scripts/checkpatch.pl --terse --file 
drivers/staging/android/binder.c | tail -n 1
total: 0 errors, 125 warnings, 3670 lines checked

And that was after the script created two patches, with the resulting
diffstat of:

 drivers/staging/android/binder.c |  124 +++
 1 file changed, 62 insertions(+), 62 deletions(-)

So 2 patches, 60+ lines to review, and 22 more warnings from checkpatch
as the end result?

Yes, the warnings are all due to line-length, but Joe, you shouldn't add
a patch that causes more checkpatch warnings than before :)


I know people have scripts like this of their own, and while it might be
nice to "standardize" them, I am really reluctant to put this script in
the kernel tree itself.  There's a barrier of entry to write your own
type of script here that honestly, I like.

We already have the example of someone who obviously does not know the C
language at all, running through the kernel tree at the moment, creating
horrible patches that are flat-out wrong and annoying maintainers with
their result.  I've had to kill-file them for now, as it was just too
annoying and maintainer time is what we have the least of.

While I always want to see more developers get involved with kernel
development, there should be a minimum barrier to entry.  And that
barrier is the knowledge of the C language, and knowledge of how to edit
a text file, and use git.  This script takes that barrier away, for
whitespace cleanups, with not much real use overall.

So, I'll keep my local copy of this script now, just to have fun with at
times when I'm bored.  But I don't think it should be merged, as-is.

thanks,

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


RE: [PATCH 6/8] Drivers: scsi: storvsc: Implement an abort handler

2014-07-12 Thread KY Srinivasan


> -Original Message-
> From: Richard Weinberger [mailto:richard.weinber...@gmail.com]
> Sent: Saturday, July 12, 2014 9:17 AM
> To: KY Srinivasan
> Cc: Christoph Hellwig; linux-ker...@vger.kernel.org;
> de...@linuxdriverproject.org; oher...@suse.com;
> jbottom...@parallels.com; jasow...@redhat.com; a...@canonical.com;
> linux-s...@vger.kernel.org
> Subject: Re: [PATCH 6/8] Drivers: scsi: storvsc: Implement an abort handler
> 
> On Thu, Jul 10, 2014 at 12:33 PM, Richard Weinberger
>  wrote:
> > On Wed, Jul 9, 2014 at 8:51 PM, KY Srinivasan  wrote:
> >>
> >>
> >>> -Original Message-
> >>> From: Christoph Hellwig [mailto:h...@infradead.org]
> >>> Sent: Wednesday, July 9, 2014 1:44 AM
> >>> To: KY Srinivasan
> >>> Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org;
> >>> oher...@suse.com; jbottom...@parallels.com; jasow...@redhat.com;
> >>> a...@canonical.com; linux-s...@vger.kernel.org
> >>> Subject: Re: [PATCH 6/8] Drivers: scsi: storvsc: Implement an abort
> >>> handler
> >>>
> >>> On Tue, Jul 08, 2014 at 05:46:50PM -0700, K. Y. Srinivasan wrote:
> >>> > Implement a simple abort handler. The host does not support
> >>> > "Abort"; just ensure that all inflight I/Os have been accounted for.
> >>>
> >>> The abort handler should abort a single command, not wait for all of
> them.
> >>> What issue do you see that this tries to address?
> >>
> >> On Azure, we sometimes have unbounded I/O latencies and some
> >> distributions (such as SLES12) based on recent kernels are invoking the
> "Abort Handler". Unfortunately, our scsi emulation on the host does not
> support aborting a command.
> >> The issue I have seen is that the upper level scsi code attempts error
> recovery when the command times out and finally frees up the command.
> >> The host subsequently responds to the command that has timed out and
> >> since the memory has been freed up, we end up touching freed memory
> >> in this driver. Since the host is also doing error recovery, by just 
> >> delaying
> the error handler in the guest until we can account for all the in-flight
> commands, we can get around the problem.
> >
> > I see strange issues in Azure and maybe they are related to this.
> > Some Linux machines crash in a way that no disk IO is possible (thus,
> > no SSH for me) but they still respond to ping. It happens rather
> > seldom (every few weeks).
> >
> > Do you see similar symptoms?
> 
> ping?

Sorry for the delayed response. Yes we have seen resets and potentially the 
file system mounted
Read-only because of the I/O timeouts. We have increased the standard scsi 
timeouts. Implementing the
Timedout handler as we have done now should solve this problem.

K. Y
> 
> --
> Thanks,
> //richard
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 6/8] Drivers: scsi: storvsc: Implement an abort handler

2014-07-12 Thread Richard Weinberger
On Thu, Jul 10, 2014 at 12:33 PM, Richard Weinberger
 wrote:
> On Wed, Jul 9, 2014 at 8:51 PM, KY Srinivasan  wrote:
>>
>>
>>> -Original Message-
>>> From: Christoph Hellwig [mailto:h...@infradead.org]
>>> Sent: Wednesday, July 9, 2014 1:44 AM
>>> To: KY Srinivasan
>>> Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org;
>>> oher...@suse.com; jbottom...@parallels.com; jasow...@redhat.com;
>>> a...@canonical.com; linux-s...@vger.kernel.org
>>> Subject: Re: [PATCH 6/8] Drivers: scsi: storvsc: Implement an abort handler
>>>
>>> On Tue, Jul 08, 2014 at 05:46:50PM -0700, K. Y. Srinivasan wrote:
>>> > Implement a simple abort handler. The host does not support "Abort";
>>> > just ensure that all inflight I/Os have been accounted for.
>>>
>>> The abort handler should abort a single command, not wait for all of them.
>>> What issue do you see that this tries to address?
>>
>> On Azure, we sometimes have unbounded I/O latencies and some distributions 
>> (such as SLES12) based on recent kernels are invoking
>> the "Abort Handler". Unfortunately, our scsi emulation on the host does not 
>> support aborting a command.
>> The issue I have seen is that the upper level scsi code attempts error 
>> recovery when the command times out and finally frees up the command.
>> The host subsequently responds to the command that has timed out and since 
>> the memory has been freed up, we end up touching freed memory
>> in this driver. Since the host is also doing error recovery, by just 
>> delaying the error handler in the guest until we can account for all the 
>> in-flight commands,
>> we can get around the problem.
>
> I see strange issues in Azure and maybe they are related to this.
> Some Linux machines crash in a way that no disk IO is possible (thus,
> no SSH for me) but they still respond to
> ping. It happens rather seldom (every few weeks).
>
> Do you see similar symptoms?

ping?

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


[PATCH V3 3/7] Drivers: scsi: storvsc: Filter commands based on the storage protocol version

2014-07-12 Thread K. Y. Srinivasan
Going forward it is possible that some of the commands that are not currently
implemented will be implemented on future Windows hosts. Even if they are not
implemented, we are told the host will corrrectly handle unsupported
commands (by returning appropriate return code and sense information).
Make command filtering depend on the host version.

In this version of the patch I have addressed comments from
Christoph Hellwig 

Signed-off-by: K. Y. Srinivasan 
Cc: 
---
 drivers/scsi/storvsc_drv.c |   16 +---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index cebcef7..8f8847e 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1553,9 +1553,19 @@ static int storvsc_queuecommand(struct Scsi_Host *host, 
struct scsi_cmnd *scmnd)
struct vmscsi_request *vm_srb;
struct stor_mem_pools *memp = scmnd->device->hostdata;
 
-   if (!storvsc_scsi_cmd_ok(scmnd)) {
-   scmnd->scsi_done(scmnd);
-   return 0;
+   if (vmstor_current_major <= VMSTOR_WIN8_MAJOR) {
+   /*
+* On legacy hosts filter unimplemented commands.
+* Future hosts are expected to correctly handle
+* unsupported commands. Furthermore, it is
+* possible that some of the currently
+* unsupported commands maybe supported in
+* future versions of the host.
+*/
+   if (!storvsc_scsi_cmd_ok(scmnd)) {
+   scmnd->scsi_done(scmnd);
+   return 0;
+   }
}
 
request_size = sizeof(struct storvsc_cmd_request);
-- 
1.7.4.1

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


[PATCH V3 2/7] Drivers: scsi: storvsc: Set cmd_per_lun to reflect value supported by the Host

2014-07-12 Thread K. Y. Srinivasan
Set cmd_per_lun to reflect value supported by the Host.
In this version of the patch I have addressed comments from
Christoph Hellwig 

Signed-off-by: K. Y. Srinivasan 
Cc: 
---
 drivers/scsi/storvsc_drv.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 8938b13..cebcef7 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1690,7 +1690,7 @@ static struct scsi_host_template scsi_driver = {
.slave_alloc =  storvsc_device_alloc,
.slave_destroy =storvsc_device_destroy,
.slave_configure =  storvsc_device_configure,
-   .cmd_per_lun =  1,
+   .cmd_per_lun =  255,
.can_queue =STORVSC_MAX_IO_REQUESTS*STORVSC_MAX_TARGETS,
.this_id =  -1,
/* no use setting to 0 since ll_blk_rw reset it to 1 */
-- 
1.7.4.1

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


[PATCH V3 4/7] Drivers: scsi: storvsc: Fix a bug in handling VMBUS protocol version

2014-07-12 Thread K. Y. Srinivasan
Based on the negotiated VMBUS protocol version, we adjust the size of the 
storage
protocol messages. The two sizes we currently handle are pre-win8 and post-win8.
In WS2012 R2, we are negotiating higher VMBUS protocol version than the win8
version. Make adjustments to correctly handle this.

In this version of the patch I have addressed comments from
Christoph Hellwig 

Signed-off-by: K. Y. Srinivasan 
Cc: 
---
 drivers/scsi/storvsc_drv.c |   17 ++---
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 8f8847e..7e8a642 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1752,19 +1752,22 @@ static int storvsc_probe(struct hv_device *device,
 * set state to properly communicate with the host.
 */
 
-   if (vmbus_proto_version == VERSION_WIN8) {
-   sense_buffer_size = POST_WIN7_STORVSC_SENSE_BUFFER_SIZE;
-   vmscsi_size_delta = 0;
-   vmstor_current_major = VMSTOR_WIN8_MAJOR;
-   vmstor_current_minor = VMSTOR_WIN8_MINOR;
-   } else {
+   switch (vmbus_proto_version) {
+   case VERSION_WS2008:
+   case VERSION_WIN7:
sense_buffer_size = PRE_WIN8_STORVSC_SENSE_BUFFER_SIZE;
vmscsi_size_delta = sizeof(struct vmscsi_win8_extension);
vmstor_current_major = VMSTOR_WIN7_MAJOR;
vmstor_current_minor = VMSTOR_WIN7_MINOR;
+   break;
+   default:
+   sense_buffer_size = POST_WIN7_STORVSC_SENSE_BUFFER_SIZE;
+   vmscsi_size_delta = 0;
+   vmstor_current_major = VMSTOR_WIN8_MAJOR;
+   vmstor_current_minor = VMSTOR_WIN8_MINOR;
+   break;
}
 
-
if (dev_id->driver_data == SFC_GUID)
scsi_driver.can_queue = (STORVSC_MAX_IO_REQUESTS *
 STORVSC_FC_MAX_TARGETS);
-- 
1.7.4.1

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


[PATCH 7/7] drivers: scsi: storvsc: Correctly handle TEST_UNIT_READY failure

2014-07-12 Thread K. Y. Srinivasan
On some Windows hosts on FC SANs, TEST_UNIT_READY can return SRB_STATUS_ERROR.
Correctly handle this. Note that there is sufficient sense information to
support scsi error handling even in this case.

In this version of the patch I have addressed comments from
Christoph Hellwig 

Signed-off-by: K. Y. Srinivasan 
Cc: 
---
 drivers/scsi/storvsc_drv.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 9342ba4..29d0329 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1018,6 +1018,13 @@ static void storvsc_handle_error(struct vmscsi_request 
*vm_srb,
case ATA_12:
set_host_byte(scmnd, DID_PASSTHROUGH);
break;
+   /*
+* On Some Windows hosts TEST_UNIT_READY command can return
+* SRB_STATUS_ERROR, let the upper level code deal with it
+* based on the sense information.
+*/
+   case TEST_UNIT_READY:
+   break;
default:
set_host_byte(scmnd, DID_TARGET_FAILURE);
}
-- 
1.7.4.1

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


[PATCH V3 1/7] Drivers: scsi: storvsc: Change the limits to reflect the values on the host

2014-07-12 Thread K. Y. Srinivasan
Hyper-V hosts can support multiple targets and multiple channels and larger 
number of
LUNs per target. Update the code to reflect this. With this patch we can 
correctly
enumerate all the paths in a multi-path storage environment.

In this version of the patch I have addressed comments from
Christoph Hellwig 

Signed-off-by: K. Y. Srinivasan 
Cc: 
---
 drivers/scsi/storvsc_drv.c |   47 +---
 1 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 9969fa1..8938b13 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -330,17 +330,17 @@ static int storvsc_timeout = 180;
 
 static void storvsc_on_channel_callback(void *context);
 
-/*
- * In Hyper-V, each port/path/target maps to 1 scsi host adapter.  In
- * reality, the path/target is not used (ie always set to 0) so our
- * scsi host adapter essentially has 1 bus with 1 target that contains
- * up to 256 luns.
- */
-#define STORVSC_MAX_LUNS_PER_TARGET64
-#define STORVSC_MAX_TARGETS1
-#define STORVSC_MAX_CHANNELS   1
+#define STORVSC_MAX_LUNS_PER_TARGET255
+#define STORVSC_MAX_TARGETS2
+#define STORVSC_MAX_CHANNELS   8
 
+#define STORVSC_FC_MAX_LUNS_PER_TARGET 255
+#define STORVSC_FC_MAX_TARGETS 128
+#define STORVSC_FC_MAX_CHANNELS8
 
+#define STORVSC_IDE_MAX_LUNS_PER_TARGET64
+#define STORVSC_IDE_MAX_TARGETS1
+#define STORVSC_IDE_MAX_CHANNELS   1
 
 struct storvsc_cmd_request {
struct list_head entry;
@@ -1691,7 +1691,6 @@ static struct scsi_host_template scsi_driver = {
.slave_destroy =storvsc_device_destroy,
.slave_configure =  storvsc_device_configure,
.cmd_per_lun =  1,
-   /* 64 max_queue * 1 target */
.can_queue =STORVSC_MAX_IO_REQUESTS*STORVSC_MAX_TARGETS,
.this_id =  -1,
/* no use setting to 0 since ll_blk_rw reset it to 1 */
@@ -1756,6 +1755,9 @@ static int storvsc_probe(struct hv_device *device,
}
 
 
+   if (dev_id->driver_data == SFC_GUID)
+   scsi_driver.can_queue = (STORVSC_MAX_IO_REQUESTS *
+STORVSC_FC_MAX_TARGETS);
host = scsi_host_alloc(&scsi_driver,
   sizeof(struct hv_host_device));
if (!host)
@@ -1789,12 +1791,25 @@ static int storvsc_probe(struct hv_device *device,
host_dev->path = stor_device->path_id;
host_dev->target = stor_device->target_id;
 
-   /* max # of devices per target */
-   host->max_lun = STORVSC_MAX_LUNS_PER_TARGET;
-   /* max # of targets per channel */
-   host->max_id = STORVSC_MAX_TARGETS;
-   /* max # of channels */
-   host->max_channel = STORVSC_MAX_CHANNELS - 1;
+   switch (dev_id->driver_data) {
+   case SFC_GUID:
+   host->max_lun = STORVSC_FC_MAX_LUNS_PER_TARGET;
+   host->max_id = STORVSC_FC_MAX_TARGETS;
+   host->max_channel = STORVSC_FC_MAX_CHANNELS - 1;
+   break;
+
+   case SCSI_GUID:
+   host->max_lun = STORVSC_MAX_LUNS_PER_TARGET;
+   host->max_id = STORVSC_MAX_TARGETS;
+   host->max_channel = STORVSC_MAX_CHANNELS - 1;
+   break;
+
+   default:
+   host->max_lun = STORVSC_IDE_MAX_LUNS_PER_TARGET;
+   host->max_id = STORVSC_IDE_MAX_TARGETS;
+   host->max_channel = STORVSC_IDE_MAX_CHANNELS - 1;
+   break;
+   }
/* max cmd length */
host->max_cmd_len = STORVSC_MAX_CMD_LEN;
 
-- 
1.7.4.1

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


[PATCH 6/7] drivers: scsi: storvsc: Set srb_flags in all cases

2014-07-12 Thread K. Y. Srinivasan
Correctly set SRB flags for all valid I/O directions. Some IHV drivers on the
Windows host require this. The host validates the command and SRB flags
prior to passing the command down to native driver stack.

Signed-off-by: K. Y. Srinivasan 
Cc: 
---
 drivers/scsi/storvsc_drv.c |   12 +---
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 3516761..9342ba4 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1599,26 +1599,24 @@ static int storvsc_queuecommand(struct Scsi_Host *host, 
struct scsi_cmnd *scmnd)
vm_srb = &cmd_request->vstor_packet.vm_srb;
vm_srb->win8_extension.time_out_value = 60;
 
+   vm_srb->win8_extension.srb_flags |=
+   (SRB_FLAGS_QUEUE_ACTION_ENABLE |
+   SRB_FLAGS_DISABLE_SYNCH_TRANSFER);
 
/* Build the SRB */
switch (scmnd->sc_data_direction) {
case DMA_TO_DEVICE:
vm_srb->data_in = WRITE_TYPE;
vm_srb->win8_extension.srb_flags |= SRB_FLAGS_DATA_OUT;
-   vm_srb->win8_extension.srb_flags |=
-   (SRB_FLAGS_QUEUE_ACTION_ENABLE |
-   SRB_FLAGS_DISABLE_SYNCH_TRANSFER);
break;
case DMA_FROM_DEVICE:
vm_srb->data_in = READ_TYPE;
vm_srb->win8_extension.srb_flags |= SRB_FLAGS_DATA_IN;
-   vm_srb->win8_extension.srb_flags |=
-   (SRB_FLAGS_QUEUE_ACTION_ENABLE |
-   SRB_FLAGS_DISABLE_SYNCH_TRANSFER);
break;
default:
vm_srb->data_in = UNKNOWN_TYPE;
-   vm_srb->win8_extension.srb_flags = 0;
+   vm_srb->win8_extension.srb_flags |= (SRB_FLAGS_DATA_IN |
+SRB_FLAGS_DATA_OUT);
break;
}
 
-- 
1.7.4.1

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


[PATCH 5/7] Drivers: scsi: storvsc: Implement a timedout handler

2014-07-12 Thread K. Y. Srinivasan
On Azure, we have seen instances of unbounded I/O latencies. To deal with
this issue, implement handler that can reset the timeout. Note that the
host gaurantees that it will respond to each command that has been issued.


Signed-off-by: K. Y. Srinivasan 
Cc: 
---
 drivers/scsi/storvsc_drv.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 7e8a642..3516761 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1518,6 +1519,14 @@ static int storvsc_host_reset_handler(struct scsi_cmnd 
*scmnd)
return SUCCESS;
 }
 
+static enum blk_eh_timer_return storvsc_timeout_handler(struct scsi_cmnd 
*scmnd)
+{
+   /*
+* The host will respond; ask for more time.
+*/
+   return BLK_EH_RESET_TIMER;
+}
+
 static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd)
 {
bool allowed = true;
@@ -1697,6 +1706,7 @@ static struct scsi_host_template scsi_driver = {
.bios_param =   storvsc_get_chs,
.queuecommand = storvsc_queuecommand,
.eh_host_reset_handler =storvsc_host_reset_handler,
+   .eh_timed_out = storvsc_timeout_handler,
.slave_alloc =  storvsc_device_alloc,
.slave_destroy =storvsc_device_destroy,
.slave_configure =  storvsc_device_configure,
-- 
1.7.4.1

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


[PATCH V3 0/7] Drivers: scsi: storvsc: Bug fixes and improvements

2014-07-12 Thread K. Y. Srinivasan
In this patch set I have fixed a few bugs and implemented some enhancements.

In this version of the patch I have addressed comments from
Christoph Hellwig 

K. Y. Srinivasan (7):
  Drivers: scsi: storvsc: Change the limits to reflect the values on
the host
  Drivers: scsi: storvsc: Set cmd_per_lun to reflect value supported by
the Host
  Drivers: scsi: storvsc: Filter commands based on the storage protocol
version
  Drivers: scsi: storvsc: Fix a bug in handling VMBUS protocol version
  Drivers: scsi: storvsc: Implement a timedout handler
  drivers: scsi: storvsc: Set srb_flags in all cases
  drivers: scsi: storvsc: Correctly handle TEST_UNIT_READY failure

 drivers/scsi/storvsc_drv.c |  111 ++-
 1 files changed, 77 insertions(+), 34 deletions(-)

-- 
1.7.4.1

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


Re: [PATCH] reformat_with_checkpatch: Add automation to checkpatch

2014-07-12 Thread Joe Perches
On Sat, 2014-07-12 at 01:18 -0700, Greg KH wrote:
> On Fri, Jul 11, 2014 at 06:21:27PM -0700, Joe Perches wrote:
> > A simple script to run checkpatch --fix for various types of
> > of cleanups.
[]
> I did the following:
> 
> $ scripts/reformat_with_checkpatch.sh drivers/base/bus.c
> 
> Ignore the first set of things it tries to commit by answering N to the
> "Would you like to commit these changes".
> 
> Then the second thing it tries to change in the file says that there is
> a .o file difference.
> 
> Yet the diff is below, I don't see how this happens.  Is this due to
> there being some old temp file around because I did not accept the first
> set of changes?

[]

> What the script complained about:
> 
> Comparing objects...
> --- drivers/base/bus.o.new2014-07-12 01:16:32.984755945 -0700
> +++ drivers/base/bus.o.old2014-07-12 01:16:31.924755967 -0700
> @@ -2449,13 +2449,13 @@
>  
>   :
>   ...
> -:bf 03 00 00 00  mov$0x3,%edi
> +:be 03 00 00 00  mov$0x3,%esi
>  :00 00   add%al,(%rax)
>   ...
>  
>  0028 :
>   ...
> -:a2 03 00 00 00 00 00movabs %al,0x3
> +:a1 03 00 00 00 00 00movabs 0x3,%eax
>  :00 00 
>  
>  0050 :
> @@ -2468,7 +2468,7 @@
>  
>  0078 :
>   ...
> -:56  push   %rsi
> +:57  push   %rdi
>  :00 00   add%al,(%rax)
>  :00 00   add%al,(%rax)
>  :00 00   add%al,(%rax)
> Object differences exist! - Verify changes before commit!
> 
> 

I've no real idea, but this looks more like
non-repeatable gcc compilation output to me.

Here's my script output from that sequence.

$ gcc --version
gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ scripts/reformat_with_checkpatch.sh drivers/base/bus.c
file:  description:  
types:
total: 0 errors, 0 warnings, 0 checks, 1272 lines checked

NOTE: Used message types: BRACKET_SPACE POINTER_LOCATION SPACE_BEFORE_TAB 
SPACING TRAILING_WHITESPACE

drivers/base/bus.c has no obvious style problems and is ready for submission.
file:  description:  
types:
total: 0 errors, 0 warnings, 0 checks, 1272 lines checked

NOTE: Used message types: SPACE_BEFORE_TAB

drivers/base/bus.c has no obvious style problems and is ready for submission.
file:  description:  
types:
total: 0 errors, 0 warnings, 0 checks, 1272 lines checked

NOTE: Used message types: INDENTED_LABEL

drivers/base/bus.c has no obvious style problems and is ready for submission.
file:  description:  
types:
CHECK: Alignment should match open parenthesis
#37: FILE: drivers/base/bus.c:37:
+static int __must_check bus_rescan_devices_helper(struct device *dev,
+   void *data);

CHECK: Alignment should match open parenthesis
#518: FILE: drivers/base/bus.c:518:
+   error = sysfs_create_link(&bus->p->devices_kset->kobj,
+   &dev->kobj, dev_name(dev));

CHECK: Alignment should match open parenthesis
#522: FILE: drivers/base/bus.c:522:
+   error = sysfs_create_link(&dev->kobj,
+   &dev->bus->p->subsys.kobj, "subsystem");

CHECK: Alignment should match open parenthesis
#701: FILE: drivers/base/bus.c:701:
+   printk(KERN_ERR "%s: uevent attr (%s) failed\n",
+   __func__, drv->name);

CHECK: Alignment should match open parenthesis
#707: FILE: drivers/base/bus.c:707:
+   printk(KERN_ERR "%s: driver_create_groups(%s) failed\n",
+   __func__, drv->name);

CHECK: Alignment should match open parenthesis
#715: FILE: drivers/base/bus.c:715:
+   printk(KERN_ERR "%s: add_bind_files(%s) failed\n",
+   __func__, drv->name);

CHECK: Alignment should match open parenthesis
#1003: FILE: drivers/base/bus.c:1003:
+   int (*compare)(const struct device *a,
+   const struct device *b))

total: 0 errors, 0 warnings, 7 checks, 1272 lines checked

NOTE: Used message types: PARENTHESIS_ALIGNMENT

Wrote EXPERIMENTAL --fix correction(s) to 'drivers/base/bus.c'

Do _NOT_ trust the results written to this file.
Do _NOT_ submit these changes without inspecting them for correctness.

This EXPERIMENTAL file is simply a convenience to help rewrite patches.
No warranties, expressed or implied...

drivers/base/bus.c has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
Compiling original version...
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  

[PATCH 1/3] Staging: bcm: Transmit.c: Replaced member accessing with variable

2014-07-12 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/Transmit.c | 22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/bcm/Transmit.c b/drivers/staging/bcm/Transmit.c
index cd27bd8..346c55d 100644
--- a/drivers/staging/bcm/Transmit.c
+++ b/drivers/staging/bcm/Transmit.c
@@ -89,6 +89,8 @@ int SetupNextSend(struct bcm_mini_adapter *Adapter,  struct 
sk_buff *Packet, USH
boolbHeaderSupressionEnabled = false;
B_UINT16 uiClassifierRuleID;
u16 QueueIndex = skb_get_queue_mapping(Packet);
+   struct bcm_packet_info *curr_packet_info =
+   &Adapter->PackInfo[QueueIndex];
struct bcm_leader Leader = {0};
 
if (Packet->len > MAX_DEVICE_DESC_SIZE) {
@@ -99,7 +101,7 @@ int SetupNextSend(struct bcm_mini_adapter *Adapter,  struct 
sk_buff *Packet, USH
/* Get the Classifier Rule ID */
uiClassifierRuleID = *((UINT32 *) (Packet->cb) + 
SKB_CB_CLASSIFICATION_OFFSET);
 
-   bHeaderSupressionEnabled = 
Adapter->PackInfo[QueueIndex].bHeaderSuppressionEnabled
+   bHeaderSupressionEnabled = curr_packet_info->bHeaderSuppressionEnabled
& Adapter->bPHSEnabled;
 
if (Adapter->device_removed) {
@@ -108,7 +110,7 @@ int SetupNextSend(struct bcm_mini_adapter *Adapter,  struct 
sk_buff *Packet, USH
}
 
status = PHSTransmit(Adapter, &Packet, Vcid, uiClassifierRuleID, 
bHeaderSupressionEnabled,
-   (UINT *)&Packet->len, 
Adapter->PackInfo[QueueIndex].bEthCSSupport);
+   (UINT *)&Packet->len, curr_packet_info->bEthCSSupport);
 
if (status != STATUS_SUCCESS) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, NEXT_SEND, DBG_LVL_ALL,
@@ -123,7 +125,7 @@ int SetupNextSend(struct bcm_mini_adapter *Adapter,  struct 
sk_buff *Packet, USH
else
Leader.Status = LEADER_STATUS;
 
-   if (Adapter->PackInfo[QueueIndex].bEthCSSupport) {
+   if (curr_packet_info->bEthCSSupport) {
Leader.PLength = Packet->len;
if (skb_headroom(Packet) < LEADER_SIZE) {
status = skb_cow(Packet, LEADER_SIZE);
@@ -149,18 +151,18 @@ int SetupNextSend(struct bcm_mini_adapter *Adapter,  
struct sk_buff *Packet, USH
} else {
struct net_device_stats *netstats = &Adapter->dev->stats;
 
-   Adapter->PackInfo[QueueIndex].uiTotalTxBytes += Leader.PLength;
+   curr_packet_info->uiTotalTxBytes += Leader.PLength;
 
netstats->tx_bytes += Leader.PLength;
++netstats->tx_packets;
 
-   Adapter->PackInfo[QueueIndex].uiCurrentTokenCount -= 
Leader.PLength << 3;
-   Adapter->PackInfo[QueueIndex].uiSentBytes += (Packet->len);
-   Adapter->PackInfo[QueueIndex].uiSentPackets++;
-   Adapter->PackInfo[QueueIndex].NumOfPacketsSent++;
+   curr_packet_info->uiCurrentTokenCount -= Leader.PLength << 3;
+   curr_packet_info->uiSentBytes += (Packet->len);
+   curr_packet_info->uiSentPackets++;
+   curr_packet_info->NumOfPacketsSent++;
 
-   
atomic_dec(&Adapter->PackInfo[QueueIndex].uiPerSFTxResourceCount);
-   Adapter->PackInfo[QueueIndex].uiThisPeriodSentBytes += 
Leader.PLength;
+   atomic_dec(&curr_packet_info->uiPerSFTxResourceCount);
+   curr_packet_info->uiThisPeriodSentBytes += Leader.PLength;
}
 
atomic_dec(&Adapter->CurrNumFreeTxDesc);
-- 
2.0.1

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


[PATCH 3/3] Staging: bcm: Transmit.c: Removed obvious comment

2014-07-12 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/Transmit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/bcm/Transmit.c b/drivers/staging/bcm/Transmit.c
index 3dd3603..05fae92 100644
--- a/drivers/staging/bcm/Transmit.c
+++ b/drivers/staging/bcm/Transmit.c
@@ -200,7 +200,7 @@ static int tx_pending(struct bcm_mini_adapter *Adapter)
  * @ingroup tx_functions
  * Transmit thread
  */
-int tx_pkt_handler(struct bcm_mini_adapter *Adapter /**< pointer to adapter 
object*/)
+int tx_pkt_handler(struct bcm_mini_adapter *Adapter)
 {
int status = 0;
 
-- 
2.0.1

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


[PATCH 2/3] Staging: bcm: Transmit.c: Line length / Whitespace cleanup

2014-07-12 Thread Matthias Beyer
Signed-off-by: Matthias Beyer 
---
 drivers/staging/bcm/Transmit.c | 57 --
 1 file changed, 38 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/bcm/Transmit.c b/drivers/staging/bcm/Transmit.c
index 346c55d..3dd3603 100644
--- a/drivers/staging/bcm/Transmit.c
+++ b/drivers/staging/bcm/Transmit.c
@@ -59,21 +59,27 @@ int SendControlPacket(struct bcm_mini_adapter *Adapter, 
char *pControlPacket)
 
/* Update the netdevice statistics */
/* Dump Packet  */
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Leader 
Status: %x", PLeader->Status);
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Leader 
VCID: %x", PLeader->Vcid);
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, "Leader 
Length: %x", PLeader->PLength);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL,
+   "Leader Status: %x", PLeader->Status);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL,
+   "Leader VCID: %x", PLeader->Vcid);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL,
+   "Leader Length: %x", PLeader->PLength);
if (Adapter->device_removed)
return 0;
 
if (netif_msg_pktdata(Adapter))
print_hex_dump(KERN_DEBUG, PFX "tx control: ", DUMP_PREFIX_NONE,
-   16, 1, pControlPacket, PLeader->PLength + LEADER_SIZE, 
0);
+  16, 1, pControlPacket,
+  PLeader->PLength + LEADER_SIZE, 0);
 
Adapter->interface_transmit(Adapter->pvInterfaceAdapter,
-   pControlPacket, (PLeader->PLength + 
LEADER_SIZE));
+   pControlPacket,
+   (PLeader->PLength + LEADER_SIZE));
 
atomic_dec(&Adapter->CurrNumFreeTxDesc);
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL, 
"<=");
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, TX_CONTROL, DBG_LVL_ALL,
+   "<=");
return STATUS_SUCCESS;
 }
 
@@ -99,18 +105,21 @@ int SetupNextSend(struct bcm_mini_adapter *Adapter,  
struct sk_buff *Packet, USH
}
 
/* Get the Classifier Rule ID */
-   uiClassifierRuleID = *((UINT32 *) (Packet->cb) + 
SKB_CB_CLASSIFICATION_OFFSET);
+   uiClassifierRuleID = *((UINT32 *) (Packet->cb) +
+  SKB_CB_CLASSIFICATION_OFFSET);
 
-   bHeaderSupressionEnabled = curr_packet_info->bHeaderSuppressionEnabled
-   & Adapter->bPHSEnabled;
+   bHeaderSupressionEnabled = curr_packet_info->bHeaderSuppressionEnabled &
+   Adapter->bPHSEnabled;
 
if (Adapter->device_removed) {
status = STATUS_FAILURE;
goto errExit;
}
 
-   status = PHSTransmit(Adapter, &Packet, Vcid, uiClassifierRuleID, 
bHeaderSupressionEnabled,
-   (UINT *)&Packet->len, curr_packet_info->bEthCSSupport);
+   status = PHSTransmit(Adapter, &Packet, Vcid, uiClassifierRuleID,
+bHeaderSupressionEnabled,
+(UINT *)&Packet->len,
+curr_packet_info->bEthCSSupport);
 
if (status != STATUS_SUCCESS) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, NEXT_SEND, DBG_LVL_ALL,
@@ -130,7 +139,9 @@ int SetupNextSend(struct bcm_mini_adapter *Adapter,  struct 
sk_buff *Packet, USH
if (skb_headroom(Packet) < LEADER_SIZE) {
status = skb_cow(Packet, LEADER_SIZE);
if (status) {
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, 
NEXT_SEND, DBG_LVL_ALL, "bcm_transmit : Failed To Increase headRoom\n");
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, NEXT_SEND,
+   DBG_LVL_ALL,
+   "bcm_transmit : Failed To 
Increase headRoom\n");
goto errExit;
}
}
@@ -138,15 +149,20 @@ int SetupNextSend(struct bcm_mini_adapter *Adapter,  
struct sk_buff *Packet, USH
memcpy(Packet->data, &Leader, LEADER_SIZE);
} else {
Leader.PLength = Packet->len - ETH_HLEN;
-   memcpy((struct bcm_leader *)skb_pull(Packet, (ETH_HLEN - 
LEADER_SIZE)), &Leader, LEADER_SIZE);
+   memcpy((struct bcm_leader *)skb_pull(Packet,
+(ETH_HLEN - LEADER_SIZE)),
+   &Leader,
+   LEADER_SIZE);
}
 
status = Adapter->interface_transmit(Adapter->pvInterfaceAdapter,
-   Packet->data, (Leader.PLength + 
LEADER_SIZE));
+Packet->data,

[PATCH 0/3] drivers/staging/bcm/Transmit.c cleanup patches

2014-07-12 Thread Matthias Beyer
Hi,

this is my next patch set, this time for the

drivers/staging/bcm/Transmit.c

file.

If you want me to, I can send the Line length patch split up into one patch per
function.

Note: I'm not able to test these patches as I do not have the appropriate
hardware, I compiled them at least.

Kind regards,
Matthias Beyer

Matthias Beyer (3):
  Staging: bcm: Transmit.c: Replaced member accessing with variable
  Staging: bcm: Transmit.c: Line length / Whitespace cleanup
  Staging: bcm: Transmit.c: Removed obvious comment

 drivers/staging/bcm/Transmit.c | 77 +++---
 1 file changed, 49 insertions(+), 28 deletions(-)

-- 
2.0.1

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


Re: [PATCH] reformat_with_checkpatch: Add automation to checkpatch

2014-07-12 Thread Dan Carpenter
On Fri, Jul 11, 2014 at 06:40:16PM -0700, Joe Perches wrote:
> On Fri, 2014-07-11 at 18:34 -0700, Greg KH wrote:
> > On Fri, Jul 11, 2014 at 06:21:27PM -0700, Joe Perches wrote:
> > > A simple script to run checkpatch --fix for various types of
> > > of cleanups.
> > > 
> > > This script is useful primarily for staging.
> > > 
> > > This reformats code to a more CodingStyle conforming style,
> > > compiles it, verifies that the object code hasn't changed,
> > > and git commits it too.
> > 
> > And 'git commits' it?
> 
> The thought I had was to made it easier to
> submit "my first kernel patch" correctly.
> like that tuxradar article you wrote a few
> years ago.
> 
> http://www.tuxradar.com/content/newbies-guide-hacking-linux-kernel
> 
> > Heh, I should just run this myself to clean up
> > staging and beat everyone else to it...
> 
> At least for the whitespace noise, you could
> but I hope it'll encourage a few more people
> to try kernel patching instead.

I have always hate the idea of automated patches from random people
because I don't trust them to not be malicious so I have to review them
manually.  There is a story that back in the day the US government paid
someone to send tons of checkpatch style patches to BSD.  The guy
thought he was "cleaning up the code" but actually he was part of a
larger scheme to flood the maintainers with patches so another person
could slip in some malicious code.

It's better if someone just ran this on all new staging code before
adding it to the tree.

regards,
dan carpenter

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


Confirm Your Address

2014-07-12 Thread biblioteca . pub



I work with One Tracking limited, we are conducting a standard investigation
involving a client who shares the same name with you. Kindly confirm if this
address is valid so I can
brief further.

Contact My Private Email: one.tracking_limi...@outlook.com

Thank you for accommodating our inquiry.

Yours Sincerely,
Mr. Timothy Hary.


Acesse http://www.pmpf.rs.gov.br

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


Re: [PATCH] reformat_with_checkpatch: Add automation to checkpatch

2014-07-12 Thread Greg KH
On Fri, Jul 11, 2014 at 06:21:27PM -0700, Joe Perches wrote:
> A simple script to run checkpatch --fix for various types of
> of cleanups.
> 
> This script is useful primarily for staging.
> 
> This reformats code to a more CodingStyle conforming style,
> compiles it, verifies that the object code hasn't changed,
> and git commits it too.
> 
> You must have the necessary development tools, git, and a
> recent git tree.  Ideally use Greg KH's staging-next, which
> can be retrieved via these commands:
> 
> git clone git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
> git checkout staging-next
> 
> To use this script try a sequence of commands like:
> 
>   cd 
>   git checkout -b 
>   make allyesconfig
>   mkdir patches
>   ./scripts/reformat_with_checkpatch.sh drivers/staging//*.[ch]
>   git format-patch --cover-letter -o patches/ staging-next
>   git send-email patches/

When running this on drivers/base/bus.c, it says that the .o files are
different, when the diffstat for what makes them different is only
whitespace.

I did the following:

$ scripts/reformat_with_checkpatch.sh drivers/base/bus.c

Ignore the first set of things it tries to commit by answering N to the
"Would you like to commit these changes".

Then the second thing it tries to change in the file says that there is
a .o file difference.

Yet the diff is below, I don't see how this happens.  Is this due to
there being some old temp file around because I did not accept the first
set of changes?

thanks,

greg k-h

-
diff:

 drivers/base/bus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 83e910a57563..3546d02b46f0 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -32,7 +32,6 @@ static struct kset *system_kset;
 
 #define to_drv_attr(_attr) container_of(_attr, struct driver_attribute, attr)
 
-
 static int __must_check bus_rescan_devices_helper(struct device *dev,
void *data);
 
@@ -128,6 +127,7 @@ static const struct sysfs_ops bus_sysfs_ops = {
 int bus_create_file(struct bus_type *bus, struct bus_attribute *attr)
 {
int error;
+
if (bus_get(bus)) {
error = sysfs_create_file(&bus->p->subsys.kobj, &attr->attr);
bus_put(bus);
@@ -817,6 +817,7 @@ EXPORT_SYMBOL_GPL(device_reprobe);
 struct bus_type *find_bus(char *name)
 {
struct kobject *k = kset_find_obj(bus_kset, name);
+
return k ? to_bus(k) : NULL;
 }
 #endif  /*  0  */

--


What the script complained about:

Comparing objects...
--- drivers/base/bus.o.new  2014-07-12 01:16:32.984755945 -0700
+++ drivers/base/bus.o.old  2014-07-12 01:16:31.924755967 -0700
@@ -2449,13 +2449,13 @@
 
  :
...
-:  bf 03 00 00 00  mov$0x3,%edi
+:  be 03 00 00 00  mov$0x3,%esi
 :  00 00   add%al,(%rax)
...
 
 0028 :
...
-:  a2 03 00 00 00 00 00movabs %al,0x3
+:  a1 03 00 00 00 00 00movabs 0x3,%eax
 :  00 00 
 
 0050 :
@@ -2468,7 +2468,7 @@
 
 0078 :
...
-:  56  push   %rsi
+:  57  push   %rdi
 :  00 00   add%al,(%rax)
 :  00 00   add%al,(%rax)
 :  00 00   add%al,(%rax)
Object differences exist! - Verify changes before commit!


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


Re: [PATCH] staging: unisys: added virtpci info entry

2014-07-12 Thread Dan Carpenter
On Fri, Jul 11, 2014 at 07:11:45PM -0400, Erik Arfvidson wrote:
> +static int print_vbus(struct device *vbus, void *data)
> +{
> + struct print_vbus_info *p = (struct print_vbus_info *)data;
> +
> + *p->length += sprintf(p->buf + *p->length, "bus_id:%s\n",
> +   dev_name(vbus));

This sprintf() can corrupt memory if you pass too short a "len".

> + return 0;
> +}

regards,
dan carpenter

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


Re: [PATCH] reformat_with_checkpatch: Add automation to checkpatch

2014-07-12 Thread Greg KH
On Fri, Jul 11, 2014 at 06:57:24PM -0700, Joe Perches wrote:
> On Fri, 2014-07-11 at 18:53 -0700, Greg KH wrote:
> > On Fri, Jul 11, 2014 at 06:21:27PM -0700, Joe Perches wrote:
> > > A simple script to run checkpatch --fix for various types of
> > > of cleanups.
> []
> > Anyway, try running this script on
> > drivers/staging/lustre/lnet/lnet/acceptor.c to see how this build fails.
> 
> lustre doesn't use "normal" kernel makefiles.

Ok, I've fixed all of the lustre Makefile crud up and checked it into my
staging-next branch.  In doing so, it exposed just what a horrid mess
the lustre include files are, which is good, hopefully people will
notice and start fixing it up.

And with the fixes, this script now properly can build and test lustre
files.

thanks,

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