[PATCH RESEND v2 3/3] PCI: hv: New paravirtual PCI front-end for Hyper-V VMs

2016-02-09 Thread jakeo
From: Jake Oshins 

This patch introduces a new driver which exposes a root PCI bus whenever a
PCI Express device is passed through to a guest VM under Hyper-V. The
device can be single- or multi-function. The interrupts for the devices
are managed by an IRQ domain, implemented within the driver.

Signed-off-by: Jake Oshins 
---
 MAINTAINERS   |1 +
 drivers/pci/Kconfig   |7 +
 drivers/pci/host/Makefile |1 +
 drivers/pci/host/pci-hyperv.c | 2373 +
 4 files changed, 2382 insertions(+)
 create mode 100644 drivers/pci/host/pci-hyperv.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 30aca4a..b68c015 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5193,6 +5193,7 @@ F:arch/x86/kernel/cpu/mshyperv.c
 F: drivers/hid/hid-hyperv.c
 F: drivers/hv/
 F: drivers/input/serio/hyperv-keyboard.c
+F: drivers/pci/host/pci-hyperv.c
 F: drivers/net/hyperv/
 F: drivers/scsi/storvsc_drv.c
 F: drivers/video/fbdev/hyperv_fb.c
diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index 73de4ef..54a5441 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -118,4 +118,11 @@ config PCI_LABEL
def_bool y if (DMI || ACPI)
select NLS
 
+config PCI_HYPERV
+tristate "Hyper-V PCI Frontend"
+depends on PCI && X86 && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && 
X86_64
+help
+  The PCI device frontend driver allows the kernel to import arbitrary
+  PCI devices from a PCI backend to support PCI driver domains.
+
 source "drivers/pci/host/Kconfig"
diff --git a/drivers/pci/host/Makefile b/drivers/pci/host/Makefile
index 7b2f20c..152daf9 100644
--- a/drivers/pci/host/Makefile
+++ b/drivers/pci/host/Makefile
@@ -2,6 +2,7 @@ obj-$(CONFIG_PCIE_DW) += pcie-designware.o
 obj-$(CONFIG_PCI_DRA7XX) += pci-dra7xx.o
 obj-$(CONFIG_PCI_EXYNOS) += pci-exynos.o
 obj-$(CONFIG_PCI_IMX6) += pci-imx6.o
+obj-$(CONFIG_PCI_HYPERV) += pci-hyperv.o
 obj-$(CONFIG_PCI_MVEBU) += pci-mvebu.o
 obj-$(CONFIG_PCI_TEGRA) += pci-tegra.o
 obj-$(CONFIG_PCI_RCAR_GEN2) += pci-rcar-gen2.o
diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
new file mode 100644
index 000..2ca43f1
--- /dev/null
+++ b/drivers/pci/host/pci-hyperv.c
@@ -0,0 +1,2373 @@
+/*
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Author:
+ *   Jake Oshins 
+ *
+ * This driver acts as a paravirtual front-end for PCI Express root buses.
+ * When a PCI Express function (either an entire device or an SR-IOV
+ * Virtual Function) is being passed through to the VM, this driver exposes
+ * a new bus to the guest VM.  This is modeled as a root PCI bus because
+ * no bridges are being exposed to the VM.  In fact, with a "Generation 2"
+ * VM within Hyper-V, there may seem to be no PCI bus at all in the VM
+ * until a device as been exposed using this driver.
+ *
+ * Each root PCI bus has its own PCI domain, which is called "Segment" in
+ * the PCI Firmware Specifications.  Thus while each device passed through
+ * to the VM using this front-end will appear at "device 0", the domain will
+ * be unique.  Typically, each bus will have one PCI function on it, though
+ * this driver does support more than one.
+ *
+ * In order to map the interrupts from the device through to the guest VM,
+ * this driver also implements an IRQ Domain, which handles interrupts (either
+ * MSI or MSI-X) associated with the functions on the bus.  As interrupts are
+ * set up, torn down, or reaffined, this driver communicates with the
+ * underlying hypervisor to adjust the mappings in the I/O MMU so that each
+ * interrupt will be delivered to the correct virtual processor at the right
+ * vector.  This driver does not support level-triggered (line-based)
+ * interrupts, and will report that the Interrupt Line register in the
+ * function's configuration space is zero.
+ *
+ * The rest of this driver mostly maps PCI concepts onto underlying Hyper-V
+ * facilities.  For instance, the configuration space of a function exposed
+ * by Hyper-V is mapped into a single page of memory space, and the
+ * read and write handlers for config space must be aware of this mechanism.
+ * Similarly, device setup and teardown involves messages sent to and from
+ * the PCI back-end driver in Hyper-V.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ * 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, GOOD TITLE or
+ * NON INFRINGEMENT.  See the GNU General Public License for more
+ * details.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/*
+ * 

re: staging/android: remove struct sync_pt

2016-02-09 Thread Dan Carpenter
Hello Gustavo Padovan,

This is a semi-automatic email about new static checker warnings.

The patch b55b54b5db33: "staging/android: remove struct sync_pt" from 
Jan 21, 2016, leads to the following Smatch complaint:

drivers/staging/android/sync_debug.c:108 sync_print_fence()
 warn: variable dereferenced before check 'fence' (see line 91)

drivers/staging/android/sync_debug.c
90  int status = 1;
91  struct sync_timeline *parent = fence_parent(fence);
   ^^^
New dereference inside function call (or possibly not, but effectively
yes).

92  
93  if (fence_is_signaled_locked(fence))
94  status = fence->status;
95  
96  seq_printf(s, "  %s%sfence %s",
97 show ? parent->name : "",
98 show ? "_" : "",
99 sync_status_str(status));
   100  
   101  if (status <= 0) {
   102  struct timespec64 ts64 =
   103  ktime_to_timespec64(fence->timestamp);
   104  
   105  seq_printf(s, "@%lld.%09ld", (s64)ts64.tv_sec, 
ts64.tv_nsec);
   106  }
   107  
   108  if ((!fence || fence->ops->timeline_value_str) &&
 ^^
Checked to late.

   109  fence->ops->fence_value_str) {
   110  char value[64];

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


[PATCH RESEND v2 1/3] PCI: Add fwnode_handle to pci_sysdata

2016-02-09 Thread jakeo
From: Jake Oshins 

This patch adds an fwnode_handle to struct pci_sysdata, which is
used by the next patch in the series when trying to locate an
IRQ domain associated with a root PCI bus.

Signed-off-by: Jake Oshins 
---
 arch/x86/include/asm/pci.h | 15 +++
 include/linux/pci.h|  4 
 2 files changed, 19 insertions(+)

diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 4625943..6fc3c7c 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -20,6 +20,9 @@ struct pci_sysdata {
 #ifdef CONFIG_X86_64
void*iommu; /* IOMMU private data */
 #endif
+#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
+   void*fwnode;/* IRQ domain for MSI assignment */
+#endif
 };
 
 extern int pci_routeirq;
@@ -32,6 +35,7 @@ extern int noioapicreroute;
 static inline int pci_domain_nr(struct pci_bus *bus)
 {
struct pci_sysdata *sd = bus->sysdata;
+
return sd->domain;
 }
 
@@ -41,6 +45,17 @@ static inline int pci_proc_domain(struct pci_bus *bus)
 }
 #endif
 
+#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
+static inline void *_pci_root_bus_fwnode(struct pci_bus *bus)
+{
+   struct pci_sysdata *sd = bus->sysdata;
+
+   return sd->fwnode;
+}
+
+#define pci_root_bus_fwnode_pci_root_bus_fwnode
+#endif
+
 /* Can be used to override the logic in pci_scan_bus for skipping
already-configured bus numbers - to be used for buggy BIOSes
or architectures with incomplete PCI setup by the loader */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 27df4a6..1bb44af 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1515,6 +1515,10 @@ static inline int pci_get_new_domain_nr(void) { return 
-ENOSYS; }
 
 #include 
 
+#ifndef pci_root_bus_fwnode
+#define pci_root_bus_fwnode(bus)   NULL
+#endif
+
 /* these helpers provide future and backwards compatibility
  * for accessing popular PCI BAR info */
 #define pci_resource_start(dev, bar)   ((dev)->resource[(bar)].start)
-- 
1.9.1

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


RE: [PATCH v3 7/8] staging: fsl-mc: update TODO and README for restool driver

2016-02-09 Thread Stuart Yoder


> -Original Message-
> From: Lijun Pan [mailto:lijun@freescale.com]
> Sent: Monday, February 08, 2016 5:40 PM
> To: gre...@linuxfoundation.org; a...@arndb.de; de...@driverdev.osuosl.org; 
> linux-
> ker...@vger.kernel.org
> Cc: stuart.yo...@freescale.com; itai.k...@freescale.com; 
> german.riv...@freescale.com;
> le...@freescale.com; scottw...@freescale.com; ag...@suse.de; 
> bhamc...@freescale.com;
> r89...@freescale.com; bhupesh.sha...@freescale.com; nir.e...@freescale.com;
> richard.schm...@freescale.com; dan.carpen...@oracle.com; 
> lijun.pan2...@gmail.com; Lijun
> Pan 
> Subject: [PATCH v3 7/8] staging: fsl-mc: update TODO and README for restool 
> driver
> 
> Add more introduction of restool driver and state why
> restool driver is needed in helping moving fsl-mc bus
> out of staging tree.
> 
> Signed-off-by: Lijun Pan 
> ---
>  drivers/staging/fsl-mc/README.txt |   11 ++-
>  drivers/staging/fsl-mc/TODO   |   18 --
>  2 files changed, 26 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/fsl-mc/README.txt 
> b/drivers/staging/fsl-mc/README.txt
> index 8214102..e9ec507 100644
> --- a/drivers/staging/fsl-mc/README.txt
> +++ b/drivers/staging/fsl-mc/README.txt
> @@ -130,7 +130,16 @@ the objects involved in creating a network interfaces.
>  via a config file passed to the MC when firmware starts
>  it.  There is also a Linux user space tool called "restool"
>  that can be used to create/destroy containers and objects
> -dynamically.
> +dynamically. The kernel side restool driver communicates with
> +user space restool via ioctl. Restool relies on allocator driver
> +to allocate dpmcp resources, enumerates fsl-mc bus to find root dprc
> +objects of interest. When the user space restool program sends a request
> +to restool driver to create a dp* objects in MC firmware, an interrupt
> +will be triggered by MC firmware and the dprc driver's interrupt handler
> +shall process the interrupt (synchronizing the objects in MC firmware and
> +objects in Linux kernel). Though small, restool driver helps verify all
> +the functionality of fsl-mc bus, dprc driver, allocator driver,
> +and MC flib API.
> 
>  -DPAA2 Objects for an Ethernet Network Interface
> 
> diff --git a/drivers/staging/fsl-mc/TODO b/drivers/staging/fsl-mc/TODO
> index 5065821..4892eb6 100644
> --- a/drivers/staging/fsl-mc/TODO
> +++ b/drivers/staging/fsl-mc/TODO
> @@ -5,10 +5,24 @@
>fsl-mc bus out of staging.
> 
>  * Decide if multiple root fsl-mc buses will be supported per Linux instance,
> -  and if so add support for this.
> +  and if so add support for this. No matter fsl-mc bus support multiple root
> +  dprc or not, restool driver is designed to support multiple root if fsl-mc
> +  bus is ready some day later. If there is only one root dprc, restool driver
> +  works fine.
> +
> +* Add at least one driver utilizing fsl-mc bus. Restool driver is a very
> +  small and simple driver, which interacts with fsl-mc bus, dprc driver,
> +  allocator driver. Restool relies on allocator driver to allocate
> +  dpmcp resources, enumerates fsl-mc bus to find root dprc objects of 
> interest.
> +  When the user space restool program sends a request to restool driver to
> +  create a dp* objects in MC firmware, an interrupt will be triggered by
> +  MC firmware and the dprc driver's interrupt handler shall process the
> +  interrupt. Though small, restool driver helps verify all the functionality
> +  of fsl-mc bus, dprc driver, allocator driver, and MC flib API. Restool
> +  driver helps in moving fsl-mc bus out of staging branch.

I don't agree with expanding the TODO list.  The discussion with Alex Graf
and Greg last year left us with the target of getting a object driver into
staging that uses the fsl-mc bus in a normal way, which is what the current
TODO list reflects.  Now that MSI support is in we are closer to being able
to do that.

The restool driver is a special case that I think can wait.

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


Re: [PATCH net-next] hv_netvsc: Increase delay for RNDIS_STATUS_NETWORK_CHANGE

2016-02-09 Thread David Miller
From: Haiyang Zhang 
Date: Tue,  2 Feb 2016 16:15:56 -0800

> We simulates a link down period for RNDIS_STATUS_NETWORK_CHANGE message to
> trigger DHCP renew. User daemons may need multiple seconds to trigger the
> link down event. (e.g. ifplugd: 5sec, network-manager: 4sec.) So update
> this link down period to 10 sec to properly trigger DHCP renew.
> 
> Signed-off-by: Haiyang Zhang 

Two things look really bad about this to me:

1) Any value you choose is arbitrary.  If some new network configuration daemon
   is slower, you will have to change this value again.

   This is _NOT_ sustainable in the long term.

2) It is completely unclear to me why this driver needs to delay at all or
   wait for anything.  I see no other driver having to deal with this issue.

Until you address both of these points I am not going to apply this patch.

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


[PATCH RESEND 00/70] staging: wilc1000: rebase and resend

2016-02-09 Thread Shevchenko, Andriy
Hi!

Sorry for being a bit late, but since I used to have few clean-ups  to the 
driver I noticed that they mostly not needed anymore which is really good.
Though, I noticed also that patch "staging: wilc1000: replaces PRINT_XXX with 
netdev_xxx" replaced also few open-coded %p-extensions.
That patch nevertheless missed use of %pI to print IP addresses, %ph to print 
hex values of the buffer.

Perhaps you have plans to clean that up as well.

-- 
Andy Shevchenko 


-
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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


[PATCH 0/5] staging: comedi: comedi.h: kernel-doc and remove cruft

2016-02-09 Thread Ian Abbott
Add some kernel-doc comments to the common enums and structs in
"comedi.h", and remove the cruft related to the non-functional and
obsolete COMEDI_TRIG ioctl.

1) staging: comedi: comedi.h: tweak start of header comment
2) staging: comedi: comedi.h: add kernel-doc to common enums
3) staging: comedi: comedi.h: add kernel-doc comments to struct types
4) staging: comedi: comedi.h: remove struct comedi_trig
5) staging: comedi: comedi.h: remove SDF_MODE0 etc.

 drivers/staging/comedi/comedi.h | 587 +---
 1 file changed, 482 insertions(+), 105 deletions(-)
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3 13/14] staging: unisys: fix else statement in visornic_main.c

2016-02-09 Thread Ben Romer
On Mon, 2016-02-08 at 22:39 +0530, Sudip Mukherjee wrote:
> maybe this is better where you have single exit point and so only one
> spin_unlock_irqrestore().


We discussed this before. I don't want to put any of the goto messes
back in because I don't think it shortens the code or makes it any
simpler.

[snip]
> +
> +exit_unlock:
> + spin_unlock_irqrestore(>priv_lock, flags);
>   return 0;

This should be returning ret. 

It's less likely that someone will accidentally overwrite or throw away
the status later, if the code just returns directly at the point of
error.

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


RE: [PATCH net-next] hv_netvsc: Increase delay for RNDIS_STATUS_NETWORK_CHANGE

2016-02-09 Thread Haiyang Zhang


> -Original Message-
> From: David Miller [mailto:da...@davemloft.net]
> Sent: Tuesday, February 9, 2016 5:05 AM
> To: Haiyang Zhang 
> Cc: net...@vger.kernel.org; KY Srinivasan ;
> o...@aepfle.de; vkuzn...@redhat.com; linux-ker...@vger.kernel.org;
> driverdev-devel@linuxdriverproject.org
> Subject: Re: [PATCH net-next] hv_netvsc: Increase delay for
> RNDIS_STATUS_NETWORK_CHANGE
> 
> From: Haiyang Zhang 
> Date: Tue,  2 Feb 2016 16:15:56 -0800
> 
> > We simulates a link down period for RNDIS_STATUS_NETWORK_CHANGE
> > message to trigger DHCP renew. User daemons may need multiple seconds
> > to trigger the link down event. (e.g. ifplugd: 5sec, network-manager:
> > 4sec.) So update this link down period to 10 sec to properly trigger DHCP
> renew.
> >
> > Signed-off-by: Haiyang Zhang 
> 
> Two things look really bad about this to me:
> 
> 1) Any value you choose is arbitrary.  If some new network configuration
> daemon
>is slower, you will have to change this value again.
> 
>This is _NOT_ sustainable in the long term.
> 
> 2) It is completely unclear to me why this driver needs to delay at all or
>wait for anything.  I see no other driver having to deal with this issue.
> 
> Until you address both of these points I am not going to apply this patch.

1) I share your concern as well. Is there a universal way to immediately 
trigger 
DHCP renew of all current and future daemons with a single event from kernel? 
If not, can we put the delay (RNDIS_STATUS_NETWORK_CHANGE only) into a 
tunable variable of this driver?

2) We used to have the call_usermodehelper "/etc/init.d/network restart" to 
trigger DHCP renew. In commit 27a70af3f4, Vitaly has replaced it with the 
current 
code that updates the link status with at least 2 seconds interval, so that the 
"link_watch infrastructure" can send notification out. link_watch 
infrastructure 
only sends one notification per second.

Thanks,
- Haiyang

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


[PATCH 1/5] staging: comedi: comedi.h: tweak start of header comment

2016-02-09 Thread Ian Abbott
The wording at the start of the header comment is a bit misleading,
particularly the part in parentheses: "(installed as
/usr/include/comedi.h)".  This version of "comedi.h" certainly won't be
installed as that pathname.  Fix it.

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/comedi.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/comedi.h b/drivers/staging/comedi/comedi.h
index f0d1b15..c157c41 100644
--- a/drivers/staging/comedi/comedi.h
+++ b/drivers/staging/comedi/comedi.h
@@ -1,6 +1,6 @@
 /*
- * include/comedi.h (installed as /usr/include/comedi.h)
- * header file for comedi
+ * comedi.h
+ * header file for COMEDI user API
  *
  * COMEDI - Linux Control and Measurement Device Interface
  * Copyright (C) 1998-2001 David A. Schleef 
-- 
2.7.0

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


[PATCH 2/5] staging: comedi: comedi.h: add kernel-doc to common enums

2016-02-09 Thread Ian Abbott
Add "kernel-doc"-formatted comments to COMEDI's general-purpose `enum`
type declarations.  Don't bother documenting the low-level
driver-specific ones for now.

Move the declaration of `enum comedi_counter_status_flags` next to the
other general-purpose `enum` types.

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/comedi.h | 225 
 1 file changed, 160 insertions(+), 65 deletions(-)

diff --git a/drivers/staging/comedi/comedi.h b/drivers/staging/comedi/comedi.h
index c157c41..9ef0963 100644
--- a/drivers/staging/comedi/comedi.h
+++ b/drivers/staging/comedi/comedi.h
@@ -223,24 +223,91 @@
 
 /* subdevice types */
 
+/**
+ * enum comedi_subdevice_type - COMEDI subdevice types
+ * @COMEDI_SUBD_UNUSED:Unused subdevice.
+ * @COMEDI_SUBD_AI:Analog input.
+ * @COMEDI_SUBD_AO:Analog output.
+ * @COMEDI_SUBD_DI:Digital input.
+ * @COMEDI_SUBD_DO:Digital output.
+ * @COMEDI_SUBD_DIO:   Digital input/output.
+ * @COMEDI_SUBD_COUNTER:   Counter.
+ * @COMEDI_SUBD_TIMER: Timer.
+ * @COMEDI_SUBD_MEMORY:Memory, EEPROM, DPRAM.
+ * @COMEDI_SUBD_CALIB: Calibration DACs.
+ * @COMEDI_SUBD_PROC:  Processor, DSP.
+ * @COMEDI_SUBD_SERIAL:Serial I/O.
+ * @COMEDI_SUBD_PWM:   Pulse-Width Modulation output.
+ */
 enum comedi_subdevice_type {
-   COMEDI_SUBD_UNUSED, /* unused by driver */
-   COMEDI_SUBD_AI, /* analog input */
-   COMEDI_SUBD_AO, /* analog output */
-   COMEDI_SUBD_DI, /* digital input */
-   COMEDI_SUBD_DO, /* digital output */
-   COMEDI_SUBD_DIO,/* digital input/output */
-   COMEDI_SUBD_COUNTER,/* counter */
-   COMEDI_SUBD_TIMER,  /* timer */
-   COMEDI_SUBD_MEMORY, /* memory, EEPROM, DPRAM */
-   COMEDI_SUBD_CALIB,  /* calibration DACs */
-   COMEDI_SUBD_PROC,   /* processor, DSP */
-   COMEDI_SUBD_SERIAL, /* serial IO */
-   COMEDI_SUBD_PWM /* PWM */
+   COMEDI_SUBD_UNUSED,
+   COMEDI_SUBD_AI,
+   COMEDI_SUBD_AO,
+   COMEDI_SUBD_DI,
+   COMEDI_SUBD_DO,
+   COMEDI_SUBD_DIO,
+   COMEDI_SUBD_COUNTER,
+   COMEDI_SUBD_TIMER,
+   COMEDI_SUBD_MEMORY,
+   COMEDI_SUBD_CALIB,
+   COMEDI_SUBD_PROC,
+   COMEDI_SUBD_SERIAL,
+   COMEDI_SUBD_PWM
 };
 
 /* configuration instructions */
 
+/**
+ * enum configuration_ids - COMEDI configuration instruction codes
+ * @INSN_CONFIG_DIO_INPUT: Configure digital I/O as input.
+ * @INSN_CONFIG_DIO_OUTPUT:Configure digital I/O as output.
+ * @INSN_CONFIG_DIO_OPENDRAIN: Configure digital I/O as open-drain (or open
+ * collector) output.
+ * @INSN_CONFIG_ANALOG_TRIG:   Configure analog trigger.
+ * @INSN_CONFIG_ALT_SOURCE:Configure alternate input source.
+ * @INSN_CONFIG_DIGITAL_TRIG:  Configure digital trigger.
+ * @INSN_CONFIG_BLOCK_SIZE:Configure block size for DMA transfers.
+ * @INSN_CONFIG_TIMER_1:   Configure divisor for external clock.
+ * @INSN_CONFIG_FILTER:Configure a filter.
+ * @INSN_CONFIG_CHANGE_NOTIFY: Configure change notification for digital
+ * inputs.  (New drivers should use
+ * %INSN_CONFIG_DIGITAL_TRIG instead.)
+ * @INSN_CONFIG_SERIAL_CLOCK:  Configure clock for serial I/O.
+ * @INSN_CONFIG_BIDIRECTIONAL_DATA: Send and receive byte over serial I/O.
+ * @INSN_CONFIG_DIO_QUERY: Query direction of digital I/O channel.
+ * @INSN_CONFIG_PWM_OUTPUT:Configure pulse-width modulator output.
+ * @INSN_CONFIG_GET_PWM_OUTPUT:Get pulse-width modulator output 
configuration.
+ * @INSN_CONFIG_ARM:   Arm a subdevice or channel.
+ * @INSN_CONFIG_DISARM:Disarm a subdevice or channel.
+ * @INSN_CONFIG_GET_COUNTER_STATUS: Get counter status.
+ * @INSN_CONFIG_RESET: Reset a subdevice or channel.
+ * @INSN_CONFIG_GPCT_SINGLE_PULSE_GENERATOR: Configure counter/timer as
+ * single pulse generator.
+ * @INSN_CONFIG_GPCT_PULSE_TRAIN_GENERATOR: Configure counter/timer as
+ * pulse train generator.
+ * @INSN_CONFIG_GPCT_QUADRATURE_ENCODER: Configure counter as a quadrature
+ * encoder.
+ * @INSN_CONFIG_SET_GATE_SRC:  Set counter/timer gate source.
+ * @INSN_CONFIG_GET_GATE_SRC:  Get counter/timer gate source.
+ * @INSN_CONFIG_SET_CLOCK_SRC: Set counter/timer master clock source.
+ * @INSN_CONFIG_GET_CLOCK_SRC: Get counter/timer master clock source.
+ * @INSN_CONFIG_SET_OTHER_SRC: Set counter/timer "other" source.
+ * @INSN_CONFIG_GET_HARDWARE_BUFFER_SIZE: Get size (in bytes) of subdevice's
+ * on-board FIFOs used during streaming
+ * input/output.
+ * @INSN_CONFIG_SET_COUNTER_MODE: Set counter/timer mode.
+ * 

[PATCH 3/5] staging: comedi: comedi.h: add kernel-doc comments to struct types

2016-02-09 Thread Ian Abbott
Add "kernel-doc"-formatted comments to the COMEDI `struct` declarations
used with ioctls.  Don't bother documenting `struct comedi_trig` as it
is obsolete and not supported.

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/comedi.h | 332 +++-
 1 file changed, 325 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/comedi.h b/drivers/staging/comedi/comedi.h
index 9ef0963..2ab48ce 100644
--- a/drivers/staging/comedi/comedi.h
+++ b/drivers/staging/comedi/comedi.h
@@ -491,6 +491,19 @@ struct comedi_trig {
unsigned int unused[3];
 };
 
+/**
+ * struct comedi_insn - COMEDI instruction
+ * @insn:  COMEDI instruction type (%INSN_xxx).
+ * @n: Length of @data[].
+ * @data:  Pointer to data array operated on by the instruction.
+ * @subdev:Subdevice index.
+ * @chanspec:  A packed "chanspec" value consisting of channel number,
+ * analog range index, analog reference type, and flags.
+ * @unused:Reserved for future use.
+ *
+ * This is used with the %COMEDI_INSN ioctl, and indirectly with the
+ * %COMEDI_INSNLIST ioctl.
+ */
 struct comedi_insn {
unsigned int insn;
unsigned int n;
@@ -500,11 +513,95 @@ struct comedi_insn {
unsigned int unused[3];
 };
 
+/**
+ * struct comedi_insnlist - list of COMEDI instructions
+ * @n_insns:   Number of COMEDI instructions.
+ * @insns: Pointer to array COMEDI instructions.
+ *
+ * This is used with the %COMEDI_INSNLIST ioctl.
+ */
 struct comedi_insnlist {
unsigned int n_insns;
struct comedi_insn __user *insns;
 };
 
+/**
+ * struct comedi_cmd - COMEDI asynchronous acquisition command details
+ * @subdev:Subdevice index.
+ * @flags: Command flags (%CMDF_xxx).
+ * @start_src: "Start acquisition" trigger source (%TRIG_xxx).
+ * @start_arg: "Start acquisition" trigger argument.
+ * @scan_begin_src:"Scan begin" trigger source.
+ * @scan_begin_arg:"Scan begin" trigger argument.
+ * @convert_src:   "Convert" trigger source.
+ * @convert_arg:   "Convert" trigger argument.
+ * @scan_end_src:  "Scan end" trigger source.
+ * @scan_end_arg:  "Scan end" trigger argument.
+ * @stop_src:  "Stop acquisition" trigger source.
+ * @stop_arg:  "Stop acquisition" trigger argument.
+ * @chanlist:  Pointer to array of "chanspec" values, containing a
+ * sequence of channel numbers packed with analog range
+ * index, etc.
+ * @chanlist_len:  Number of channels in sequence.
+ * @data:  Pointer to miscellaneous set-up data (not used).
+ * @data_len:  Length of miscellaneous set-up data.
+ *
+ * This is used with the %COMEDI_CMD or %COMEDI_CMDTEST ioctl to set-up
+ * or validate an asynchronous acquisition command.  The ioctl may modify
+ * the  comedi_cmd and copy it back to the caller.
+ *
+ * Optional command @flags values that can be ORed together...
+ *
+ * %CMDF_BOGUS - makes %COMEDI_CMD ioctl return error %EAGAIN instead of
+ * starting the command.
+ *
+ * %CMDF_PRIORITY - requests "hard real-time" processing (which is not
+ * supported in this version of COMEDI).
+ *
+ * %CMDF_WAKE_EOS - requests the command makes data available for reading
+ * after every "scan" period.
+ *
+ * %CMDF_WRITE - marks the command as being in the "write" (to device)
+ * direction.  This does not need to be specified by the caller unless the
+ * subdevice supports commands in either direction.
+ *
+ * %CMDF_RAWDATA - prevents the command from "munging" the data between the
+ * COMEDI sample format and the raw hardware sample format.
+ *
+ * %CMDF_ROUND_NEAREST - requests timing periods to be rounded to nearest
+ * supported values.
+ *
+ * %CMDF_ROUND_DOWN - requests timing periods to be rounded down to supported
+ * values (frequencies rounded up).
+ *
+ * %CMDF_ROUND_UP - requests timing periods to be rounded up to supported
+ * values (frequencies rounded down).
+ *
+ * Trigger source values for @start_src, @scan_begin_src, @convert_src,
+ * @scan_end_src, and @stop_src...
+ *
+ * %TRIG_ANY - "all ones" value used to test which trigger sources are
+ * supported.
+ *
+ * %TRIG_INVALID - "all zeroes" value used to indicate that all requested
+ * trigger sources are invalid.
+ *
+ * %TRIG_NONE - never trigger (often used as a @stop_src value).
+ *
+ * %TRIG_NOW - trigger after '_arg' nanoseconds.
+ *
+ * %TRIG_FOLLOW - trigger follows another event.
+ *
+ * %TRIG_TIMER - trigger every '_arg' nanoseconds.
+ *
+ * %TRIG_COUNT - trigger when count '_arg' is reached.
+ *
+ * %TRIG_EXT - trigger on external signal specified by '_arg'.
+ *
+ * %TRIG_INT - trigger on internal, software trigger specified by '_arg'.
+ *
+ * %TRIG_OTHER - trigger on other, driver-defined signal specified by '_arg'.
+ */
 struct comedi_cmd {
unsigned int subdev;
unsigned int flags;
@@ -524,13 +621,31 @@ struct 

[PATCH 4/5] staging: comedi: comedi.h: remove struct comedi_trig

2016-02-09 Thread Ian Abbott
Remove `struct comedi_trig` and some associated macros, `TRIG_DITHER`,
`TRIG_DEGLITCH`, `TRIG_CONFIG`, and ioctl code `COMEDI_TRIG`.  These
have been obsolete since COMEDI release 0.7.61 back in November 2001.

The userspace COMEDILIB library still has some deprecated code that
may attempt to use these, but it uses its own, compatible version of
"comedi.h", so isn't affected by their removal from the kernel copy.

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/comedi.h | 24 +---
 1 file changed, 1 insertion(+), 23 deletions(-)

diff --git a/drivers/staging/comedi/comedi.h b/drivers/staging/comedi/comedi.h
index 2ab48ce..c562be8 100644
--- a/drivers/staging/comedi/comedi.h
+++ b/drivers/staging/comedi/comedi.h
@@ -120,13 +120,6 @@
 #define INSN_WAIT  (5 | INSN_MASK_WRITE | INSN_MASK_SPECIAL)
 #define INSN_INTTRIG   (6 | INSN_MASK_WRITE | INSN_MASK_SPECIAL)
 
-/* trigger flags */
-/* These flags are used in comedi_trig structures */
-
-#define TRIG_DITHER0x0002  /* enable dithering */
-#define TRIG_DEGLITCH  0x0004  /* enable deglitching */
-#define TRIG_CONFIG0x0010  /* perform configuration, not triggering */
-
 /* command flags */
 /* These flags are used in comedi_cmd structures */
 
@@ -459,7 +452,7 @@ enum comedi_counter_status_flags {
 #define COMEDI_DEVINFO _IOR(CIO, 1, struct comedi_devinfo)
 #define COMEDI_SUBDINFO _IOR(CIO, 2, struct comedi_subdinfo)
 #define COMEDI_CHANINFO _IOR(CIO, 3, struct comedi_chaninfo)
-#define COMEDI_TRIG _IOWR(CIO, 4, comedi_trig)
+/* _IOWR(CIO, 4, ...) is reserved */
 #define COMEDI_LOCK _IO(CIO, 5)
 #define COMEDI_UNLOCK _IO(CIO, 6)
 #define COMEDI_CANCEL _IO(CIO, 7)
@@ -476,21 +469,6 @@ enum comedi_counter_status_flags {
 
 /* structures */
 
-struct comedi_trig {
-   unsigned int subdev;/* subdevice */
-   unsigned int mode;  /* mode */
-   unsigned int flags;
-   unsigned int n_chan;/* number of channels */
-   unsigned int *chanlist; /* channel/range list */
-   short *data;/* data list, size depends on subd flags */
-   unsigned int n; /* number of scans */
-   unsigned int trigsrc;
-   unsigned int trigvar;
-   unsigned int trigvar1;
-   unsigned int data_len;
-   unsigned int unused[3];
-};
-
 /**
  * struct comedi_insn - COMEDI instruction
  * @insn:  COMEDI instruction type (%INSN_xxx).
-- 
2.7.0

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


[PATCH 5/5] staging: comedi: comedi.h: remove SDF_MODE0 etc.

2016-02-09 Thread Ian Abbott
The macros `SDF_MODE0`, `SDF_MODE1`, `SDF_MODE2`, `SDF_MODE3`, and
`SDF_MODE4` are COMEDI subdevice flags originally associated with the
obsolete (and no longer present) COMEDI "trigger" functionality.  They
have been of no use since COMEDI release 0.7.61 back in November 2001.
Since they were going spare, a couple of them have been aliased as
`SDF_PWM_COUNTER` and `SDF_PWM_HBRIDGE` to mean other things.  Remove
the obsolete macros and redefine `SDF_PWM_COUNTER` and `SDF_PWM_HBRIDGE`
as equivalent numeric values.

Some code distributed with the userspace COMEDILIB library uses the
`SDF_MODE0` etc. flags to display the fact that they are set, but
COMEDILIB uses and installs its own, compatible version of "comedi.h"
anyway so isn't affected by their removal from the kernel copy.

Signed-off-by: Ian Abbott 
---
 drivers/staging/comedi/comedi.h | 22 --
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/comedi/comedi.h b/drivers/staging/comedi/comedi.h
index c562be8..aa7263c 100644
--- a/drivers/staging/comedi/comedi.h
+++ b/drivers/staging/comedi/comedi.h
@@ -183,11 +183,8 @@
 #define SDF_MAXDATA0x0010  /* maxdata depends on channel */
 #define SDF_FLAGS  0x0020  /* flags depend on channel */
 #define SDF_RANGETYPE  0x0040  /* range type depends on channel */
-#define SDF_MODE0  0x0080  /* can do mode 0 */
-#define SDF_MODE1  0x0100  /* can do mode 1 */
-#define SDF_MODE2  0x0200  /* can do mode 2 */
-#define SDF_MODE3  0x0400  /* can do mode 3 */
-#define SDF_MODE4  0x0800  /* can do mode 4 */
+#define SDF_PWM_COUNTER 0x0080 /* PWM can automatically switch off */
+#define SDF_PWM_HBRIDGE 0x0100 /* PWM is signed (H-bridge) */
 #define SDF_CMD0x1000  /* can do commands (deprecated) */
 #define SDF_SOFT_CALIBRATED0x2000 /* subdevice uses software calibration */
 #define SDF_CMD_WRITE  0x4000 /* can do output commands */
@@ -210,9 +207,6 @@
 #define SDF_RUNNING0x0800  /* subdevice is acquiring data */
 #define SDF_LSAMPL 0x1000  /* subdevice uses 32-bit samples */
 #define SDF_PACKED 0x2000  /* subdevice can do packed DIO */
-/* re recycle these flags for PWM */
-#define SDF_PWM_COUNTER SDF_MODE0  /* PWM can automatically switch off */
-#define SDF_PWM_HBRIDGE SDF_MODE1  /* PWM is signed (H-bridge) */
 
 /* subdevice types */
 
@@ -730,17 +724,9 @@ struct comedi_krange {
  *
  * %SDF_RANGETYPE - range types are channel-specific.
  *
- * %SDF_MODE0 (aliased as %SDF_PWM_COUNTER) - the subdevice can do mode 0 (?)
- * or PWM can switch off automatically.
+ * %SDF_PWM_COUNTER - PWM can switch off automatically.
  *
- * %SDF_MODE1 (aliased as %SDF_PWM_HBRIDGE) - the subdevice can do mode 1 (?)
- * or PWM is signed (H-bridge).
- *
- * %SDF_MODE2 - the subdevice can do mode 2 (?).
- *
- * %SDF_MODE3 - the subdevice can do mode 3 (?).
- *
- * %SDF_MODE4 - the subdevice can do mode 4 (?).
+ * %SDF_PWM_HBRIDGE - or PWM is signed (H-bridge).
  *
  * %SDF_CMD - the subdevice supports asynchronous commands.
  *
-- 
2.7.0

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


FBI LETTER[CODE:210]p

2016-02-09 Thread JAMES COMEY
JAMES BRIEN COMEY
EXECUTIVE DIRECTOR FBI
FEDERAL BUREAU OF INVESTIGATION FBI.WASHINGTON D.C
FEDERAL BUREAU OF INVESTIGATION SEEKING TO WIRETAP

The Federal bureau of investigation (FBI) Washington,D.C
in conjunction with some other relevant Investigations Agencies
have recently been informed through our Global intelligence
monitoring network that your over-due contract payment
which was fully endorsed in your favor accordingly by the
Central bank of Malaysia(Bank Negara Malaysia) has not been claimed.

It might interest you to know that we have taken out time
in screening through this project as stipulated on our
protocol of operation and have finally
confirmed that your contract payment is 100% genuine and
hitch free from all facet and of which you have the lawful
right to claim your fund without any further delay.
We further advise that you go ahead in dealing with the
Central Bank office accordingly as we will be monitoring all
their services with you as well as your correspondence at
all level.

We were also made to understand that a lady with name Mrs.
Joan C.Bailey from OHIO has already contacted them and also
presented to them all the necessary documentation evidencing your
claim purported to have been signed personally by you prior to
the release of your contract fund valued at about $25million us dollars
only
but the Central Bank office did the wise thing by insisting on
hearing from you personally before they go ahead on wiring
your fund to the Bank information which was forwarded to
them by the above named Lady so that the main reason why they
contacted us so as to assist them in making the investigation.

Contact immediately the office of the Central Bank of Malaysia
(Bank Negara Malaysia) via email with the below information accordingly:

NAME: Dr. Zeti Akhtar Aziz.
OFFICE ADDRESS: Bank Negara Malaysia,
Jalan Kuching, Kuala Lumpur,
Wilayah Persekutuan,Kuala Lumpur,
Selangor,Malaysia
Email: azizak...@aim.com


Meanwhile, we will advise that you  contact the office
of the Governor of the Central Bank immediately with
the above email address and request that they attend
to your payment file as directed,
so as to enable you receive your contract fund accordingly.

To this effect, you are required to reconfirm and
authenticate your given particulars below for certainty
and onward processing and release of you funds
as we may not be held liable for any wrong payment.

FULL NAMES: __
CITY: _
STATE: __
ZIP: __
COUNTRY
SEX: ___
AGE: __
TELEPHONE NUMBER: _
FAX: __

Ensure you follow all their procedure as may be required by
them as that will further help hasten up the whole procedure
as regard to the transfer of your fund to you as designated.
Also have in mind that the Central Bank of Malaysia
equally have their own protocol of operation as stipulated
on their banking terms, so delay could be very dangerous.

Thank you very much for your anticipated co-operation in
advance as we earnestly await your urgent response to this matter.

Best Regards,

James Brien Comey
Federal Bureau of Investigation
J. Edgar Hoover Building
935 Pennsylvania Avenue,
NW Washington, D.C.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


FBI LETTER[CODE:210]p

2016-02-09 Thread JAMES COMEY
JAMES BRIEN COMEY
EXECUTIVE DIRECTOR FBI
FEDERAL BUREAU OF INVESTIGATION FBI.WASHINGTON D.C
FEDERAL BUREAU OF INVESTIGATION SEEKING TO WIRETAP

The Federal bureau of investigation (FBI) Washington,D.C
in conjunction with some other relevant Investigations Agencies
have recently been informed through our Global intelligence
monitoring network that your over-due contract payment
which was fully endorsed in your favor accordingly by the
Central bank of Malaysia(Bank Negara Malaysia) has not been claimed.

It might interest you to know that we have taken out time
in screening through this project as stipulated on our
protocol of operation and have finally
confirmed that your contract payment is 100% genuine and
hitch free from all facet and of which you have the lawful
right to claim your fund without any further delay.
We further advise that you go ahead in dealing with the
Central Bank office accordingly as we will be monitoring all
their services with you as well as your correspondence at
all level.

We were also made to understand that a lady with name Mrs.
Joan C.Bailey from OHIO has already contacted them and also
presented to them all the necessary documentation evidencing your
claim purported to have been signed personally by you prior to
the release of your contract fund valued at about $25million us dollars
only
but the Central Bank office did the wise thing by insisting on
hearing from you personally before they go ahead on wiring
your fund to the Bank information which was forwarded to
them by the above named Lady so that the main reason why they
contacted us so as to assist them in making the investigation.

Contact immediately the office of the Central Bank of Malaysia
(Bank Negara Malaysia) via email with the below information accordingly:

NAME: Dr. Zeti Akhtar Aziz.
OFFICE ADDRESS: Bank Negara Malaysia,
Jalan Kuching, Kuala Lumpur,
Wilayah Persekutuan,Kuala Lumpur,
Selangor,Malaysia
Email: azizak...@aim.com


Meanwhile, we will advise that you  contact the office
of the Governor of the Central Bank immediately with
the above email address and request that they attend
to your payment file as directed,
so as to enable you receive your contract fund accordingly.

To this effect, you are required to reconfirm and
authenticate your given particulars below for certainty
and onward processing and release of you funds
as we may not be held liable for any wrong payment.

FULL NAMES: __
CITY: _
STATE: __
ZIP: __
COUNTRY
SEX: ___
AGE: __
TELEPHONE NUMBER: _
FAX: __

Ensure you follow all their procedure as may be required by
them as that will further help hasten up the whole procedure
as regard to the transfer of your fund to you as designated.
Also have in mind that the Central Bank of Malaysia
equally have their own protocol of operation as stipulated
on their banking terms, so delay could be very dangerous.

Thank you very much for your anticipated co-operation in
advance as we earnestly await your urgent response to this matter.

Best Regards,

James Brien Comey
Federal Bureau of Investigation
J. Edgar Hoover Building
935 Pennsylvania Avenue,
NW Washington, D.C.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/5] iio: hmc5843: Add attribute for available measurement config

2016-02-09 Thread Jonathan Cameron
On 07/02/16 22:21, Cristina Moraru wrote:
> Add static attribute meas_conf_available to show available
> configurations for the bias current.
> 
> API for setting bias measurement configuration:
> 
> 0 - Normal measurement configuration (default): In normal measurement
> configuration the device follows normal measurement flow. Pins BP
> and BN are left floating and high impedance.
> 
> 1 - Positive bias configuration: In positive bias configuration, a
> positive current is forced across the resistive load on pins BP
> and BN.
> 
> 2 - Negative bias configuration. In negative bias configuration, a
> negative current is forced across the resistive load on pins BP
> and BN.
> 
> 3 - Only available on HMC5983. Magnetic sensor is disabled.
> Temperature sensor is enabled.
> 
> Signed-off-by: Cristina Moraru 
I'd much prefer to see this done using the iio_enum magic, giving
something like.

cat meas_conf_available 
normal, positivebias, negativebias, disabled

then have meas_conf read as one of these strings and take one as a write.

This abi is never going to make all that much sense to someone who
hasn't read the datasheet / docs, but if possible it is nice to
give them a hint by using informative strings as the values.

Jonathan
> ---
>  drivers/staging/iio/magnetometer/hmc5843_core.c | 83 
> +++--
>  1 file changed, 65 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/staging/iio/magnetometer/hmc5843_core.c 
> b/drivers/staging/iio/magnetometer/hmc5843_core.c
> index 4aab022..4e2a7ec 100644
> --- a/drivers/staging/iio/magnetometer/hmc5843_core.c
> +++ b/drivers/staging/iio/magnetometer/hmc5843_core.c
> @@ -66,6 +66,34 @@
>  #define HMC5843_MEAS_CONF_NEGATIVE_BIAS  0x02
>  #define HMC5843_MEAS_CONF_MASK   0x03
>  
> +/*
> + * API for setting the measurement configuration to
> + * Normal, Positive bias and Negative bias
> + *
> + * From the datasheet:
> + * 0 - Normal measurement configuration (default): In normal measurement
> + * configuration the device follows normal measurement flow. Pins BP
> + * and BN are left floating and high impedance.
> + *
> + * 1 - Positive bias configuration: In positive bias configuration, a
> + * positive current is forced across the resistive load on pins BP
> + * and BN.
> + *
> + * 2 - Negative bias configuration. In negative bias configuration, a
> + * negative current is forced across the resistive load on pins BP
> + * and BN.
> + *
> + * 3 - Only available on HMC5983. Magnetic sensor is disabled.
> + * Temperature sensor is enabled.
> + */
> +static const int hmc5843_regval_to_meas_conf[] = {
> + 0, 1, 2
> +};
> +
> +static const int hmc5983_regval_to_meas_conf[] = {
> + 0, 1, 2, 3
> +};
> +
>  /* Scaling factors: 1000/Gain */
>  static const int hmc5843_regval_to_nanoscale[] = {
>   6173, 7692, 10309, 12821, 18868, 21739, 25641, 35714
> @@ -109,6 +137,8 @@ static const int hmc5983_regval_to_samp_freq[][2] = {
>  /* Describe chip variants */
>  struct hmc5843_chip_info {
>   const struct iio_chan_spec *channels;
> + const int *regval_to_meas_conf;
> + const int n_regval_to_meas_conf;
>   const int (*regval_to_samp_freq)[2];
>   const int n_regval_to_samp_freq;
>   const int *regval_to_nanoscale;
> @@ -174,24 +204,6 @@ static int hmc5843_read_measurement(struct hmc5843_data 
> *data,
>   return IIO_VAL_INT;
>  }
>  
> -/*
> - * API for setting the measurement configuration to
> - * Normal, Positive bias and Negative bias
> - *
> - * From the datasheet:
> - * 0 - Normal measurement configuration (default): In normal measurement
> - * configuration the device follows normal measurement flow. Pins BP
> - * and BN are left floating and high impedance.
> - *
> - * 1 - Positive bias configuration: In positive bias configuration, a
> - * positive current is forced across the resistive load on pins BP
> - * and BN.
> - *
> - * 2 - Negative bias configuration. In negative bias configuration, a
> - * negative current is forced across the resistive load on pins BP
> - * and BN.
> - *
> - */
>  static int hmc5843_set_meas_conf(struct hmc5843_data *data, u8 meas_conf)
>  {
>   int ret;
> @@ -248,6 +260,28 @@ static IIO_DEVICE_ATTR(meas_conf,
>   hmc5843_set_measurement_configuration,
>   0);
>  
> +static ssize_t hmc5843_show_meas_conf_avail(struct device *dev,
> + struct device_attribute *attr,
> + char *buf)
> +{
> + struct hmc5843_data *data = iio_priv(dev_to_iio_dev(dev));
> +
> + size_t len = 0;
> + int i;
> +
> + for (i = 0; i < data->variant->n_regval_to_meas_conf; i++)
> + len += scnprintf(buf + len, PAGE_SIZE - len,
> + "%d ", data->variant->regval_to_meas_conf[i]);
> +
> + /* replace 

Re: [PATCH 2/5] iio: hmc5843: Swap suspend and resume implementations

2016-02-09 Thread Jonathan Cameron
On 07/02/16 22:21, Cristina Moraru wrote:
> Swap implementations of hmc5843_common_suspend and
> hmc5843_common_resume functions for they have been
> inversed. Device should go on SLEEP mode on suspend
> and on CONTINUOUS mode on resume.
> 
> Signed-off-by: Cristina Moraru 
I'd normally apply this as a fix, but to keep things simple with
the move out of staging I've just applied it to the togreg branch
of iio.git - initially pushed out as testing for the autobuilders
to play with it.

It's been there a long time an no one has noticed, so I'm guessing
any hardware platforms with this on aren't going in for power management!

Jonathan
> ---
>  drivers/staging/iio/magnetometer/hmc5843_core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/iio/magnetometer/hmc5843_core.c 
> b/drivers/staging/iio/magnetometer/hmc5843_core.c
> index 4e2a7ec..dca8d64 100644
> --- a/drivers/staging/iio/magnetometer/hmc5843_core.c
> +++ b/drivers/staging/iio/magnetometer/hmc5843_core.c
> @@ -612,14 +612,14 @@ static const unsigned long hmc5843_scan_masks[] = {0x7, 
> 0};
>  int hmc5843_common_suspend(struct device *dev)
>  {
>   return hmc5843_set_mode(iio_priv(dev_get_drvdata(dev)),
> - HMC5843_MODE_CONVERSION_CONTINUOUS);
> + HMC5843_MODE_SLEEP);
>  }
>  EXPORT_SYMBOL(hmc5843_common_suspend);
>  
>  int hmc5843_common_resume(struct device *dev)
>  {
>   return hmc5843_set_mode(iio_priv(dev_get_drvdata(dev)),
> - HMC5843_MODE_SLEEP);
> + HMC5843_MODE_CONVERSION_CONTINUOUS);
>  }
>  EXPORT_SYMBOL(hmc5843_common_resume);
>  
> 

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


Re: [PATCH 4/5] iio: hmc5843: Fix comment style warnings

2016-02-09 Thread Jonathan Cameron
On 07/02/16 22:21, Cristina Moraru wrote:
> Fix comment style warnings in order to comply with Coding Style
> standard provided by Documentation/CodingStyle.
> 
> This patch solves following issue found with checkpatch:
> WARNING: Block comments use a trailing */ on a separate line
> 
> Signed-off-by: Cristina Moraru 
I've applied this, but with a few additions... see inline.
> ---
>  drivers/staging/iio/magnetometer/hmc5843.h | 4 ++--
>  drivers/staging/iio/magnetometer/hmc5843_i2c.c | 2 +-
>  drivers/staging/iio/magnetometer/hmc5843_spi.c | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/iio/magnetometer/hmc5843.h 
> b/drivers/staging/iio/magnetometer/hmc5843.h
> index 06f35d3..cb284cf 100644
> --- a/drivers/staging/iio/magnetometer/hmc5843.h
> +++ b/drivers/staging/iio/magnetometer/hmc5843.h
> @@ -8,7 +8,7 @@
>   * it under the terms of the GNU General Public License version 2 as
>   * published by the Free Software Foundation.
>   *
Dropped the unwanted empty comment line as it doesn't add anything and we
might as well clean it up whilst here.
> - * */
> + */
>  
>  #ifndef HMC5843_CORE_H
>  #define HMC5843_CORE_H
> @@ -38,7 +38,7 @@ enum hmc5843_ids {
>   * @regmap:  hardware access register maps
>   * @variant: describe chip variants
>   * @buffer:  3x 16-bit channels + padding + 64-bit timestamp
> - **/
> + */
>  struct hmc5843_data {
>   struct device *dev;
>   struct mutex lock;
> diff --git a/drivers/staging/iio/magnetometer/hmc5843_i2c.c 
> b/drivers/staging/iio/magnetometer/hmc5843_i2c.c
> index 3e06ceb..6f7b8fb 100644
> --- a/drivers/staging/iio/magnetometer/hmc5843_i2c.c
> +++ b/drivers/staging/iio/magnetometer/hmc5843_i2c.c
> @@ -8,7 +8,7 @@
>   * it under the terms of the GNU General Public License version 2 as
>   * published by the Free Software Foundation.
>   *
snap
> - * */
> + */
>  
>  #include 
>  #include 
> diff --git a/drivers/staging/iio/magnetometer/hmc5843_spi.c 
> b/drivers/staging/iio/magnetometer/hmc5843_spi.c
> index 1549192..85adcdd 100644
> --- a/drivers/staging/iio/magnetometer/hmc5843_spi.c
> +++ b/drivers/staging/iio/magnetometer/hmc5843_spi.c
> @@ -7,7 +7,7 @@
>   * it under the terms of the GNU General Public License version 2 as
>   * published by the Free Software Foundation.
>   *
snap.
> - * */
> + */
>  
>  #include 
>  #include 
> 

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


[PATCH RESEND v2 0/3] PCI: hv: New paravirtual PCI front-end driver

2016-02-09 Thread jakeo
From: Jake Oshins 

This version incorporates feedback from Bjorn Helgaas and fixes a build
break reported by the kbuild test robot.

This is a resend of patches that enable PCI pass-through within Hyper-V
VMs.  This patch series only includes those which were deemed appropriate
for being incorportated via the PCI tree.  All other patches in previous
patch series have gone through other trees and are now in mainline.

The first two patches modify PCI so that new root PCI buses can be marked with
an associated fwnode_handle, and so that root PCI buses can look up their
associated IRQ domain by that handle.

The last patch, introduces a new driver, hv_pcifront, which exposes root PCI
buses in a Hyper-V VM.  These root PCI buses expose real PCIe devices, or PCI
Virtual Functions.

Jake Oshins (3):
  PCI: Add fwnode_handle to pci_sysdata
  PCI: irqdomain: Look up IRQ domain by fwnode_handle
  PCI: hv: New paravirtual PCI front-end for Hyper-V VMs

 MAINTAINERS   |1 +
 arch/x86/include/asm/pci.h|   15 +
 drivers/pci/Kconfig   |7 +
 drivers/pci/host/Makefile |1 +
 drivers/pci/host/pci-hyperv.c | 2373 +
 drivers/pci/probe.c   |   15 +
 include/linux/pci.h   |4 +
 7 files changed, 2416 insertions(+)
 create mode 100644 drivers/pci/host/pci-hyperv.c

--
1.9.1

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


[PATCH RESEND v2 2/3] PCI: irqdomain: Look up IRQ domain by fwnode_handle

2016-02-09 Thread jakeo
From: Jake Oshins 

This patch adds a second way of finding an IRQ domain associated with
a root PCI bus.  After looking to see if one can be found through
the OF tree, it attempts to look up the IRQ domain through an
fwnode_handle stored in the pci_sysdata struct.

Signed-off-by: Jake Oshins 
---
 drivers/pci/probe.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 6d7ab9b..1e34d21 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "pci.h"
 
@@ -675,6 +676,20 @@ static struct irq_domain 
*pci_host_bridge_msi_domain(struct pci_bus *bus)
if (!d)
d = pci_host_bridge_acpi_msi_domain(bus);
 
+#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
+   /*
+* If no IRQ domain was found via the OF tree, try looking it up
+* directly through the fwnode_handle.
+*/
+   if (!d) {
+   struct fwnode_handle *fwnode = pci_root_bus_fwnode(bus);
+
+   if (fwnode)
+   d = irq_find_matching_fwnode(fwnode,
+DOMAIN_BUS_PCI_MSI);
+   }
+#endif
+
return d;
 }
 
-- 
1.9.1

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


Re: [PATCH v3 1/9] Staging: rts5208: rtsx_transport.c: Cleanup comments

2016-02-09 Thread Joshua Clayton
Hi Shaun.
These comments now reflect common kernel style.
Thanks for addressing my comments.

Just one minor note below. It seems the word SCSI
SCSI got duplicated in one comment. (Noted below).

The rest look great to me.

On Tuesday, February 09, 2016 06:45:20 PM Shaun Ren wrote:
> This patch fixes all multiline comments to conform to the coding style,
> which states that multiline comments should start with "/*" and end
> with "*/" on a separate line.
> 
> Also cleans up some comments to make them more clear and/or reflect what
> the code is doing.
> 
> Signed-off-by: Shaun Ren 
> ---
> Changes since v2
>  * Cleaned up comments as per Joshua Clayton's suggestions
>  
>  drivers/staging/rts5208/rtsx_transport.c | 53 
> 
>  1 file changed, 27 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/staging/rts5208/rtsx_transport.c 
> b/drivers/staging/rts5208/rtsx_transport.c
> index f27491e..5de8913 100644
> --- a/drivers/staging/rts5208/rtsx_transport.c
> +++ b/drivers/staging/rts5208/rtsx_transport.c
> @@ -1,4 +1,5 @@
> -/* Driver for Realtek PCI-Express card reader
> +/*
> + * Driver for Realtek PCI-Express card reader
>   *
>   * Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved.
>   *
> @@ -30,13 +31,15 @@
>   * Scatter-gather transfer buffer access routines
>   ***/
>  
> -/* Copy a buffer of length buflen to/from the srb's transfer buffer.
> +/*
> + * Copy a buffer of length buflen to/from the srb's transfer buffer.
>   * (Note: for scatter-gather transfers (srb->use_sg > 0), srb->request_buffer
>   * points to a list of s-g entries and we ignore srb->request_bufflen.
>   * For non-scatter-gather transfers, srb->request_buffer points to the
>   * transfer buffer itself and srb->request_bufflen is the buffer's length.)
>   * Update the *index and *offset variables so that the next copy will
> - * pick up from where this one left off. */
> + * pick up from where this one left off.
> + */
>  
>  unsigned int rtsx_stor_access_xfer_buf(unsigned char *buffer,
>   unsigned int buflen, struct scsi_cmnd *srb, unsigned int *index,
> @@ -44,8 +47,7 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char 
> *buffer,
>  {
>   unsigned int cnt;
>  
> - /* If not using scatter-gather, just transfer the data directly.
> -  * Make certain it will fit in the available buffer space. */
> + /* If not using scatter-gather, just transfer the data directly. */
>   if (scsi_sg_count(srb) == 0) {
>   if (*offset >= scsi_bufflen(srb))
>   return 0;
> @@ -58,22 +60,22 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char 
> *buffer,
>   *offset, cnt);
>   *offset += cnt;
>  
> - /* Using scatter-gather.  We have to go through the list one entry
> + /*
> +  * Using scatter-gather.  We have to go through the list one entry
>* at a time.  Each s-g entry contains some number of pages, and
> -  * each page has to be kmap()'ed separately.  If the page is already
> -  * in kernel-addressable memory then kmap() will return its address.
> -  * If the page is not directly accessible -- such as a user buffer
> -  * located in high memory -- then kmap() will map it to a temporary
> -  * position in the kernel's virtual address space. */
> +  * each page has to be kmap()'ed separately.
> +  */
>   } else {
>   struct scatterlist *sg =
>   (struct scatterlist *) scsi_sglist(srb)
>   + *index;
>  
> - /* This loop handles a single s-g list entry, which may
> + /*
> +  * This loop handles a single s-g list entry, which may
>* include multiple pages.  Find the initial page structure
>* and the starting offset within the page, and update
> -  * the *offset and *index values for the next loop. */
> +  * the *offset and *index values for the next loop.
> +  */
>   cnt = 0;
>   while (cnt < buflen && *index < scsi_sg_count(srb)) {
>   struct page *page = sg_page(sg) +
> @@ -95,9 +97,6 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char 
> *buffer,
>   ++sg;
>   }
>  
> - /* Transfer the data for all the pages in this
> -  * s-g entry.  For each page: call kmap(), do the
> -  * transfer, and call kunmap() immediately after. */
>   while (sglen > 0) {
>   unsigned int plen = min(sglen, (unsigned int)
>   PAGE_SIZE - poff);
> @@ -122,8 +121,10 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char 
> *buffer,
>   return cnt;
>  }
>  
> 

Re: [PATCH v2] staging: unisys: use common return path

2016-02-09 Thread Sudip Mukherjee
On Mon, Feb 08, 2016 at 10:46:57PM +0530, Sudip Mukherjee wrote:
> On Sun, Feb 07, 2016 at 02:04:21PM -0800, Greg Kroah-Hartman wrote:
> > On Tue, Dec 01, 2015 at 04:22:33PM +0530, Sudip Mukherjee wrote:
> > > The success path and the error path both are first doing
> > > spin_unlock_irqrestore() before returning. Use that in the common path
> > > and return the success/error value.
> > > 
> > > Signed-off-by: Sudip Mukherjee 
> > > ---
> > > 
> > > v2: changed label name
> > > 
> > > It is dependent on the patch series sent by Benjamin (Nov 30th).
> > 
> > Which didn't get applied, so can you resend this after that does get
> > accepted?
> 
> oops, i dont think i have the patch anymore. But looking at the commit
> message, i think i just sent the same suggestion to Benjamin for his
> [PATCH v3 13/14] staging: unisys: fix else statement in visornic_main.c
> 
> If he is not changing then I will create the patch and send you.

Hi Greg,
I will not be resending this patch as Ben is against to using goto.

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


Re: [PATCH v2 2/9] Staging: rts5208: rtsx_transport.c: Align to open parenthesis

2016-02-09 Thread Sudip Mukherjee
On Mon, Feb 08, 2016 at 05:31:18PM -0800, Shaun Ren wrote:
> This patch fixes the alignment issue reported by checkpatch.pl:
> 
> CHECK: Alignment should match open parenthesis
> 
> Signed-off-by: Shaun Ren 
> ---
>  drivers/staging/rts5208/rtsx_transport.c | 61 
> ++--
>  1 file changed, 35 insertions(+), 26 deletions(-)
> 

>  
> @@ -732,11 +739,13 @@ int rtsx_transfer_data_partial(struct rtsx_chip *chip, 
> u8 card,
>   if (rtsx_chk_stat(chip, RTSX_STAT_ABORT))
>   return -EIO;
>  
> - if (use_sg)
> - err = rtsx_transfer_sglist_adma_partial(chip, card,
> - (struct scatterlist *)buf, use_sg,
> - index, offset, (int)len, dma_dir, timeout);
> - else
> + if (use_sg) {
> + struct scatterlist *sg = (struct scatterlist *)buf;

this change is not documented in commit message.
> +
> + err = rtsx_transfer_sglist_adma_partial(chip, card, sg, use_sg,
> + index, offset, (int)len,
> + dma_dir, timeout);
> + } else

This will introduce new checkpatch warning. If you are giving braces in
the if block then you need to have braces in the else part also.

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


[PATCH v3 1/9] Staging: rts5208: rtsx_transport.c: Cleanup comments

2016-02-09 Thread Shaun Ren
This patch fixes all multiline comments to conform to the coding style,
which states that multiline comments should start with "/*" and end
with "*/" on a separate line.

Also cleans up some comments to make them more clear and/or reflect what
the code is doing.

Signed-off-by: Shaun Ren 
---
Changes since v2
 * Cleaned up comments as per Joshua Clayton's suggestions
 
 drivers/staging/rts5208/rtsx_transport.c | 53 
 1 file changed, 27 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx_transport.c 
b/drivers/staging/rts5208/rtsx_transport.c
index f27491e..5de8913 100644
--- a/drivers/staging/rts5208/rtsx_transport.c
+++ b/drivers/staging/rts5208/rtsx_transport.c
@@ -1,4 +1,5 @@
-/* Driver for Realtek PCI-Express card reader
+/*
+ * Driver for Realtek PCI-Express card reader
  *
  * Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved.
  *
@@ -30,13 +31,15 @@
  * Scatter-gather transfer buffer access routines
  ***/
 
-/* Copy a buffer of length buflen to/from the srb's transfer buffer.
+/*
+ * Copy a buffer of length buflen to/from the srb's transfer buffer.
  * (Note: for scatter-gather transfers (srb->use_sg > 0), srb->request_buffer
  * points to a list of s-g entries and we ignore srb->request_bufflen.
  * For non-scatter-gather transfers, srb->request_buffer points to the
  * transfer buffer itself and srb->request_bufflen is the buffer's length.)
  * Update the *index and *offset variables so that the next copy will
- * pick up from where this one left off. */
+ * pick up from where this one left off.
+ */
 
 unsigned int rtsx_stor_access_xfer_buf(unsigned char *buffer,
unsigned int buflen, struct scsi_cmnd *srb, unsigned int *index,
@@ -44,8 +47,7 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char *buffer,
 {
unsigned int cnt;
 
-   /* If not using scatter-gather, just transfer the data directly.
-* Make certain it will fit in the available buffer space. */
+   /* If not using scatter-gather, just transfer the data directly. */
if (scsi_sg_count(srb) == 0) {
if (*offset >= scsi_bufflen(srb))
return 0;
@@ -58,22 +60,22 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char 
*buffer,
*offset, cnt);
*offset += cnt;
 
-   /* Using scatter-gather.  We have to go through the list one entry
+   /*
+* Using scatter-gather.  We have to go through the list one entry
 * at a time.  Each s-g entry contains some number of pages, and
-* each page has to be kmap()'ed separately.  If the page is already
-* in kernel-addressable memory then kmap() will return its address.
-* If the page is not directly accessible -- such as a user buffer
-* located in high memory -- then kmap() will map it to a temporary
-* position in the kernel's virtual address space. */
+* each page has to be kmap()'ed separately.
+*/
} else {
struct scatterlist *sg =
(struct scatterlist *) scsi_sglist(srb)
+ *index;
 
-   /* This loop handles a single s-g list entry, which may
+   /*
+* This loop handles a single s-g list entry, which may
 * include multiple pages.  Find the initial page structure
 * and the starting offset within the page, and update
-* the *offset and *index values for the next loop. */
+* the *offset and *index values for the next loop.
+*/
cnt = 0;
while (cnt < buflen && *index < scsi_sg_count(srb)) {
struct page *page = sg_page(sg) +
@@ -95,9 +97,6 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char *buffer,
++sg;
}
 
-   /* Transfer the data for all the pages in this
-* s-g entry.  For each page: call kmap(), do the
-* transfer, and call kunmap() immediately after. */
while (sglen > 0) {
unsigned int plen = min(sglen, (unsigned int)
PAGE_SIZE - poff);
@@ -122,8 +121,10 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char 
*buffer,
return cnt;
 }
 
-/* Store the contents of buffer into srb's transfer buffer and set the
-* SCSI residue. */
+/*
+ * Store the contents of buffer into srb's transfer buffer and set the SCSI
+ * SCSI residue.
+ */
 void rtsx_stor_set_xfer_buf(unsigned char *buffer,
unsigned int buflen, struct scsi_cmnd *srb)
 {
@@ -151,7 +152,8 @@ void rtsx_stor_get_xfer_buf(unsigned char *buffer,
  * Transport routines
  

[PATCH v3 0/9] Staging: rts5208: Coding style and dma mapping fixes

2016-02-09 Thread Shaun Ren
This set of patches fixes the coding style issues in rtsx_transport.c, and
dds a missing call dma_mapping_error() after dma_map_single().

Changes since v2
 * Incorporated Joshua Clayton's suggestions regarding the block comments

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


[PATCH v3 3/9] Staging: rts5208: rtsx_transport.c: Remove spaces after casts

2016-02-09 Thread Shaun Ren
This patch removes all spaces after casts in rtsx_transport.c, as reported
by checkpatch.pl:

CHECK: No space is necessary after a cast

Signed-off-by: Shaun Ren 
---
 drivers/staging/rts5208/rtsx_transport.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx_transport.c 
b/drivers/staging/rts5208/rtsx_transport.c
index 17bea8a..57b1f46 100644
--- a/drivers/staging/rts5208/rtsx_transport.c
+++ b/drivers/staging/rts5208/rtsx_transport.c
@@ -56,10 +56,10 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char 
*buffer,
return 0;
cnt = min(buflen, scsi_bufflen(srb) - *offset);
if (dir == TO_XFER_BUF)
-   memcpy((unsigned char *) scsi_sglist(srb) + *offset,
+   memcpy((unsigned char *)scsi_sglist(srb) + *offset,
   buffer, cnt);
else
-   memcpy(buffer, (unsigned char *) scsi_sglist(srb) +
+   memcpy(buffer, (unsigned char *)scsi_sglist(srb) +
   *offset, cnt);
*offset += cnt;
 
@@ -70,7 +70,7 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char *buffer,
 */
} else {
struct scatterlist *sg =
-   (struct scatterlist *) scsi_sglist(srb)
+   (struct scatterlist *)scsi_sglist(srb)
+ *index;
 
/*
-- 
2.7.0

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


[PATCH v3 5/9] Staging: rts5208: rtsx_transport.c: Remove extra newlines

2016-02-09 Thread Shaun Ren
This patch fixes the following issues in rtsx_transport.c as reported by
checkpatch.pl:

CHECK: Blank lines aren't necessary after an open brace '{'
CHECK: Please don't use multiple blank lines

Signed-off-by: Shaun Ren 
---
 drivers/staging/rts5208/rtsx_transport.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx_transport.c 
b/drivers/staging/rts5208/rtsx_transport.c
index b137aca..14321c0 100644
--- a/drivers/staging/rts5208/rtsx_transport.c
+++ b/drivers/staging/rts5208/rtsx_transport.c
@@ -88,12 +88,10 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char 
*buffer,
unsigned int sglen = sg->length - *offset;
 
if (sglen > buflen - cnt) {
-
/* Transfer ends within this s-g entry */
sglen = buflen - cnt;
*offset += sglen;
} else {
-
/* Transfer continues to next s-g entry */
*offset = 0;
++*index;
@@ -150,7 +148,6 @@ void rtsx_stor_get_xfer_buf(unsigned char *buffer,
scsi_set_resid(srb, scsi_bufflen(srb) - buflen);
 }
 
-
 /***
  * Transport routines
  ***/
-- 
2.7.0

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


[PATCH v3 9/9] Staging: rts5208: Add missing dma_mapping_error

2016-02-09 Thread Shaun Ren
This patch adds a dma_mapping_error call to debug potential DMA mapping
errors after the dma_map_single call in rtsx_transport.c.

Signed-off-by: Shaun Ren 
---
 drivers/staging/rts5208/rtsx_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rts5208/rtsx_transport.c 
b/drivers/staging/rts5208/rtsx_transport.c
index 46fc8c2..2b38de7 100644
--- a/drivers/staging/rts5208/rtsx_transport.c
+++ b/drivers/staging/rts5208/rtsx_transport.c
@@ -658,7 +658,7 @@ static int rtsx_transfer_buf(struct rtsx_chip *chip, u8 
card, void *buf,
return -ENXIO;
 
addr = dma_map_single(>pci->dev, buf, len, dma_dir);
-   if (!addr)
+   if (dma_mapping_error(>pci->dev, addr))
return -ENOMEM;
 
if (card == SD_CARD)
-- 
2.7.0

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


[PATCH v3 7/9] Staging: rts5208: rtsx_transport.c: Remove unnecessary parentheses

2016-02-09 Thread Shaun Ren
This patch removes all unnecessary parentheses found by checkpatch.pl.

Signed-off-by: Shaun Ren 
---
 drivers/staging/rts5208/rtsx_transport.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx_transport.c 
b/drivers/staging/rts5208/rtsx_transport.c
index ea00347..c956072 100644
--- a/drivers/staging/rts5208/rtsx_transport.c
+++ b/drivers/staging/rts5208/rtsx_transport.c
@@ -191,7 +191,7 @@ void rtsx_invoke_transport(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
/* set the result so the higher layers expect this data */
srb->result = SAM_STAT_CHECK_CONDITION;
memcpy(srb->sense_buffer,
-  (unsigned char *)&(chip->sense_buffer[SCSI_LUN(srb)]),
+  (unsigned char *)>sense_buffer[SCSI_LUN(srb)],
   sizeof(struct sense_data_t));
}
 
@@ -365,7 +365,7 @@ static int rtsx_transfer_sglist_adma_partial(struct 
rtsx_chip *chip, u8 card,
 
spin_unlock_irq(>reg_lock);
 
-   sg_cnt = dma_map_sg(&(rtsx->pci->dev), sg, num_sg, dma_dir);
+   sg_cnt = dma_map_sg(>pci->dev, sg, num_sg, dma_dir);
 
resid = size;
sg_ptr = sg;
@@ -479,7 +479,7 @@ static int rtsx_transfer_sglist_adma_partial(struct 
rtsx_chip *chip, u8 card,
 out:
rtsx->done = NULL;
rtsx->trans_state = STATE_TRANS_NONE;
-   dma_unmap_sg(&(rtsx->pci->dev), sg, num_sg, dma_dir);
+   dma_unmap_sg(>pci->dev, sg, num_sg, dma_dir);
 
if (err < 0)
rtsx_stop_cmd(chip, card);
@@ -529,7 +529,7 @@ static int rtsx_transfer_sglist_adma(struct rtsx_chip 
*chip, u8 card,
 
spin_unlock_irq(>reg_lock);
 
-   buf_cnt = dma_map_sg(&(rtsx->pci->dev), sg, num_sg, dma_dir);
+   buf_cnt = dma_map_sg(>pci->dev, sg, num_sg, dma_dir);
 
sg_ptr = sg;
 
@@ -627,7 +627,7 @@ static int rtsx_transfer_sglist_adma(struct rtsx_chip 
*chip, u8 card,
 out:
rtsx->done = NULL;
rtsx->trans_state = STATE_TRANS_NONE;
-   dma_unmap_sg(&(rtsx->pci->dev), sg, num_sg, dma_dir);
+   dma_unmap_sg(>pci->dev, sg, num_sg, dma_dir);
 
if (err < 0)
rtsx_stop_cmd(chip, card);
@@ -657,7 +657,7 @@ static int rtsx_transfer_buf(struct rtsx_chip *chip, u8 
card, void *buf,
else
return -ENXIO;
 
-   addr = dma_map_single(&(rtsx->pci->dev), buf, len, dma_dir);
+   addr = dma_map_single(>pci->dev, buf, len, dma_dir);
if (!addr)
return -ENOMEM;
 
@@ -711,7 +711,7 @@ static int rtsx_transfer_buf(struct rtsx_chip *chip, u8 
card, void *buf,
 out:
rtsx->done = NULL;
rtsx->trans_state = STATE_TRANS_NONE;
-   dma_unmap_single(&(rtsx->pci->dev), addr, len, dma_dir);
+   dma_unmap_single(>pci->dev, addr, len, dma_dir);
 
if (err < 0)
rtsx_stop_cmd(chip, card);
-- 
2.7.0

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


[PATCH v3 2/9] Staging: rts5208: rtsx_transport.c: Align to open parenthesis

2016-02-09 Thread Shaun Ren
This patch fixes the alignment issue reported by checkpatch.pl:

CHECK: Alignment should match open parenthesis

Signed-off-by: Shaun Ren 
---
 drivers/staging/rts5208/rtsx_transport.c | 61 ++--
 1 file changed, 35 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx_transport.c 
b/drivers/staging/rts5208/rtsx_transport.c
index 5de8913..17bea8a 100644
--- a/drivers/staging/rts5208/rtsx_transport.c
+++ b/drivers/staging/rts5208/rtsx_transport.c
@@ -42,8 +42,11 @@
  */
 
 unsigned int rtsx_stor_access_xfer_buf(unsigned char *buffer,
-   unsigned int buflen, struct scsi_cmnd *srb, unsigned int *index,
-   unsigned int *offset, enum xfer_buf_dir dir)
+  unsigned int buflen,
+  struct scsi_cmnd *srb,
+  unsigned int *index,
+  unsigned int *offset,
+enum xfer_buf_dir dir)
 {
unsigned int cnt;
 
@@ -54,10 +57,10 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char 
*buffer,
cnt = min(buflen, scsi_bufflen(srb) - *offset);
if (dir == TO_XFER_BUF)
memcpy((unsigned char *) scsi_sglist(srb) + *offset,
-   buffer, cnt);
+  buffer, cnt);
else
memcpy(buffer, (unsigned char *) scsi_sglist(srb) +
-   *offset, cnt);
+  *offset, cnt);
*offset += cnt;
 
/*
@@ -126,7 +129,7 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char 
*buffer,
  * SCSI residue.
  */
 void rtsx_stor_set_xfer_buf(unsigned char *buffer,
-   unsigned int buflen, struct scsi_cmnd *srb)
+   unsigned int buflen, struct scsi_cmnd *srb)
 {
unsigned int index = 0, offset = 0;
 
@@ -137,7 +140,7 @@ void rtsx_stor_set_xfer_buf(unsigned char *buffer,
 }
 
 void rtsx_stor_get_xfer_buf(unsigned char *buffer,
-   unsigned int buflen, struct scsi_cmnd *srb)
+   unsigned int buflen, struct scsi_cmnd *srb)
 {
unsigned int index = 0, offset = 0;
 
@@ -191,8 +194,8 @@ void rtsx_invoke_transport(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
/* set the result so the higher layers expect this data */
srb->result = SAM_STAT_CHECK_CONDITION;
memcpy(srb->sense_buffer,
-   (unsigned char *)&(chip->sense_buffer[SCSI_LUN(srb)]),
-   sizeof(struct sense_data_t));
+  (unsigned char *)&(chip->sense_buffer[SCSI_LUN(srb)]),
+  sizeof(struct sense_data_t));
}
 
return;
@@ -202,7 +205,7 @@ Handle_Errors:
 }
 
 void rtsx_add_cmd(struct rtsx_chip *chip,
-   u8 cmd_type, u16 reg_addr, u8 mask, u8 data)
+ u8 cmd_type, u16 reg_addr, u8 mask, u8 data)
 {
u32 *cb = (u32 *)(chip->host_cmds_ptr);
u32 val = 0;
@@ -321,9 +324,11 @@ static inline void rtsx_add_sg_tbl(
 }
 
 static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card,
-   struct scatterlist *sg, int num_sg, unsigned int *index,
-   unsigned int *offset, int size,
-   enum dma_data_direction dma_dir, int timeout)
+struct scatterlist *sg, int num_sg,
+unsigned int *index,
+unsigned int *offset, int size,
+enum dma_data_direction dma_dir,
+int timeout)
 {
struct rtsx_dev *rtsx = chip->rtsx;
struct completion trans_done;
@@ -486,8 +491,9 @@ out:
 }
 
 static int rtsx_transfer_sglist_adma(struct rtsx_chip *chip, u8 card,
-   struct scatterlist *sg, int num_sg,
-   enum dma_data_direction dma_dir, int timeout)
+struct scatterlist *sg, int num_sg,
+enum dma_data_direction dma_dir,
+int timeout)
 {
struct rtsx_dev *rtsx = chip->rtsx;
struct completion trans_done;
@@ -633,7 +639,8 @@ out:
 }
 
 static int rtsx_transfer_buf(struct rtsx_chip *chip, u8 card, void *buf,
-   size_t len, enum dma_data_direction dma_dir, int timeout)
+size_t len, enum dma_data_direction dma_dir,
+int timeout)
 {
struct rtsx_dev *rtsx = chip->rtsx;
struct completion trans_done;
@@ -716,9 +723,9 @@ out:
 }
 
 int rtsx_transfer_data_partial(struct rtsx_chip *chip, u8 card,
-   void *buf, size_t len, int use_sg, unsigned int *index,
-   unsigned int *offset, enum 

[PATCH v3 4/9] Staging: rts5208: rtsx_transport.c: Add spaces around -

2016-02-09 Thread Shaun Ren
This patch fixes the following styling issue in rtsx_transport.c
as reported by checkpatch.pl:

CHECK: spaces preferred around that '-' (ctx:VxV)

Signed-off-by: Shaun Ren 
---
 drivers/staging/rts5208/rtsx_transport.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx_transport.c 
b/drivers/staging/rts5208/rtsx_transport.c
index 57b1f46..b137aca 100644
--- a/drivers/staging/rts5208/rtsx_transport.c
+++ b/drivers/staging/rts5208/rtsx_transport.c
@@ -83,8 +83,8 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char *buffer,
while (cnt < buflen && *index < scsi_sg_count(srb)) {
struct page *page = sg_page(sg) +
((sg->offset + *offset) >> PAGE_SHIFT);
-   unsigned int poff =
-   (sg->offset + *offset) & (PAGE_SIZE-1);
+   unsigned int poff = (sg->offset + *offset) &
+   (PAGE_SIZE - 1);
unsigned int sglen = sg->length - *offset;
 
if (sglen > buflen - cnt) {
-- 
2.7.0

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


[PATCH v3 6/9] Staging: rts5208: rtsx_transport.c: Fix label naming convention

2016-02-09 Thread Shaun Ren
This patch fixes the following naming convention issue in rtsx_transport.c,
as reported by checkpatch.pl:

CHECK: Avoid CamelCase: 

Signed-off-by: Shaun Ren 
---
Changes since v2
 * Update patch to reflect the changes made in PATCH 1/9 (block comments)

 drivers/staging/rts5208/rtsx_transport.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx_transport.c 
b/drivers/staging/rts5208/rtsx_transport.c
index 14321c0..ea00347 100644
--- a/drivers/staging/rts5208/rtsx_transport.c
+++ b/drivers/staging/rts5208/rtsx_transport.c
@@ -170,14 +170,14 @@ void rtsx_invoke_transport(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
if (rtsx_chk_stat(chip, RTSX_STAT_ABORT)) {
dev_dbg(rtsx_dev(chip), "-- command was aborted\n");
srb->result = DID_ABORT << 16;
-   goto Handle_Errors;
+   goto handle_errors;
}
 
/* if there is a transport error, reset and don't auto-sense */
if (result == TRANSPORT_ERROR) {
dev_dbg(rtsx_dev(chip), "-- transport indicates error, 
resetting\n");
srb->result = DID_ERROR << 16;
-   goto Handle_Errors;
+   goto handle_errors;
}
 
srb->result = SAM_STAT_GOOD;
@@ -197,7 +197,7 @@ void rtsx_invoke_transport(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
 
return;
 
-Handle_Errors:
+handle_errors:
return;
 }
 
-- 
2.7.0

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


[PATCH v3 8/9] Staging: rts5208: rtsx_transport.c: Fix comparisons to NULL

2016-02-09 Thread Shaun Ren
This patch changes all comparsions to NULL with !..., as reported by
checkpatch.pl.

Signed-off-by: Shaun Ren 
---
 drivers/staging/rts5208/rtsx_transport.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx_transport.c 
b/drivers/staging/rts5208/rtsx_transport.c
index c956072..46fc8c2 100644
--- a/drivers/staging/rts5208/rtsx_transport.c
+++ b/drivers/staging/rts5208/rtsx_transport.c
@@ -336,7 +336,7 @@ static int rtsx_transfer_sglist_adma_partial(struct 
rtsx_chip *chip, u8 card,
struct scatterlist *sg_ptr;
u32 val = TRIG_DMA;
 
-   if ((sg == NULL) || (num_sg <= 0) || !offset || !index)
+   if (!sg || (num_sg <= 0) || !offset || !index)
return -EIO;
 
if (dma_dir == DMA_TO_DEVICE)
@@ -500,7 +500,7 @@ static int rtsx_transfer_sglist_adma(struct rtsx_chip 
*chip, u8 card,
long timeleft;
struct scatterlist *sg_ptr;
 
-   if ((sg == NULL) || (num_sg <= 0))
+   if (!sg || (num_sg <= 0))
return -EIO;
 
if (dma_dir == DMA_TO_DEVICE)
@@ -647,7 +647,7 @@ static int rtsx_transfer_buf(struct rtsx_chip *chip, u8 
card, void *buf,
u32 val = 1 << 31;
long timeleft;
 
-   if ((buf == NULL) || (len <= 0))
+   if (!buf || (len <= 0))
return -EIO;
 
if (dma_dir == DMA_TO_DEVICE)
-- 
2.7.0

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


Re: [PATCH v3 2/9] Staging: rts5208: rtsx_transport.c: Align to open parenthesis

2016-02-09 Thread Joe Perches
On Tue, 2016-02-09 at 18:45 -0800, Shaun Ren wrote:
> This patch fixes the alignment issue reported by checkpatch.pl:
> 
> CHECK: Alignment should match open parenthesis
> 
> Signed-off-by: Shaun Ren 
> ---
>  drivers/staging/rts5208/rtsx_transport.c | 61 
> ++--
>  1 file changed, 35 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/staging/rts5208/rtsx_transport.c 
> b/drivers/staging/rts5208/rtsx_transport.c
> index 5de8913..17bea8a 100644
> --- a/drivers/staging/rts5208/rtsx_transport.c
> +++ b/drivers/staging/rts5208/rtsx_transport.c
> @@ -42,8 +42,11 @@
>   */
>  
>  unsigned int rtsx_stor_access_xfer_buf(unsigned char *buffer,
> - unsigned int buflen, struct scsi_cmnd *srb, unsigned int *index,
> - unsigned int *offset, enum xfer_buf_dir dir)
> +    unsigned int buflen,
> +    struct scsi_cmnd *srb,
> +    unsigned int *index,
> +    unsigned int *offset,
> +  enum xfer_buf_dir dir)

Doesn't this look odd to you?

>  {
>   unsigned int cnt;
>  
> @@ -54,10 +57,10 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char 
> *buffer,
>   cnt = min(buflen, scsi_bufflen(srb) - *offset);
>   if (dir == TO_XFER_BUF)
>   memcpy((unsigned char *) scsi_sglist(srb) + *offset,
> - buffer, cnt);
> +    buffer, cnt);
>   else
>   memcpy(buffer, (unsigned char *) scsi_sglist(srb) +
> - *offset, cnt);
> +    *offset, cnt);

If you really want to make this look nicer and more
intelligible, it's probably be better to use a more
symmetric form like:

if (dir == TO_XFER_BUF)
memcpy((unsigned char *)scsi_sglist(srb) + *offset,
   buffer,
   cnt);
else
memcpy(buffer,
   (unsigned char *)scsi_sglist(srb) + *offset,
   cnt);
or maybe

void *to;
void *from;

[...]

if (dir == TO_XFER_BUF) {
to = (unsigned char *)scsi_sglist(srb) + *offset;
from = buffer;
} else {
to = buffer;
from = (unsigned char *)scsi_sglist(srb) +
*offset;
}
memcpy(to, from, cnt);

or maybe

void *to;
void *from;

[...]

to = (unsigned char *)scsi_sglist(srb) + *offset;
from = buffer;
if (dir != TO_XFER_BUF)
swap(to, from);

memcpy(to, from, cnt);

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


RE: [PATCH V2 06/13] Drivers: hv: vmbus: define the new offer type for Hyper-V socket (hvsock)

2016-02-09 Thread Dexuan Cui
> From: Greg KH [mailto:gre...@linuxfoundation.org]
> Sent: Monday, February 8, 2016 13:34
> To: KY Srinivasan 
> Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; 
> o...@aepfle.de;
> a...@canonical.com; vkuzn...@redhat.com; jasow...@redhat.com; Dexuan
> Cui 
> Subject: Re: [PATCH V2 06/13] Drivers: hv: vmbus: define the new offer type 
> for
> Hyper-V socket (hvsock)
> 
> On Wed, Jan 27, 2016 at 10:29:38PM -0800, K. Y. Srinivasan wrote:
> > From: Dexuan Cui 
> >
> > A helper function is also added.
> >
> > Signed-off-by: Dexuan Cui 
> > Signed-off-by: K. Y. Srinivasan 
> > ---
> >  include/linux/hyperv.h |7 +++
> >  1 files changed, 7 insertions(+), 0 deletions(-)
> >
> > diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
> > index 4af51a3..79c4aa7 100644
> > --- a/include/linux/hyperv.h
> > +++ b/include/linux/hyperv.h
> > @@ -235,6 +235,7 @@ struct vmbus_channel_offer {
> >  #define VMBUS_CHANNEL_LOOPBACK_OFFER   0x100
> >  #define VMBUS_CHANNEL_PARENT_OFFER 0x200
> >  #define VMBUS_CHANNEL_REQUEST_MONITORED_NOTIFICATION   0x400
> > +#define VMBUS_CHANNEL_TLNPI_PROVIDER_OFFER 0x2000
> 
> In the future the BIT() macro might be good here...
Hi Greg,
Thanks for the reminder!
In the future, before introducing a new flag, we'll remember to make a clean-up
patch to make these replaced with BIT(). :-)

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


Re: [PATCH v2 7/9] Staging: rts5208: rtsx_transport.c: Remove unnecessary parentheses

2016-02-09 Thread Sudip Mukherjee
On Mon, Feb 08, 2016 at 05:31:23PM -0800, Shaun Ren wrote:
> This patch removes all unnecessary parentheses found by checkpatch.pl.
> 
> Signed-off-by: Shaun Ren 

This will not apply anymore because of some other changes done by:
9a66d05d82db ("Staging: rts5208: fix check for dma mapping error")

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


Re: [PATCH v3 13/14] staging: unisys: fix else statement in visornic_main.c

2016-02-09 Thread Sudip Mukherjee
On Tue, Feb 09, 2016 at 10:16:12AM -0500, Ben Romer wrote:
> On Mon, 2016-02-08 at 22:39 +0530, Sudip Mukherjee wrote:
> > maybe this is better where you have single exit point and so only one
> > spin_unlock_irqrestore().
> 
> 
> We discussed this before. I don't want to put any of the goto messes
> back in because I don't think it shortens the code or makes it any
> simpler.

yes, now i remember. Sorry for suggesting the same thing again.
Documentation/CodingStyle says:
"The goto statement comes in handy when a function exits from multiple
locations and some common work such as cleanup has to be done.  If there
is no cleanup needed then just return directly."

IMHO, the patch I posted or this suggestion does not go against that.
But anyway, since you are opposed to it I will not send the patch again.

> 
> [snip]
> > +
> > +exit_unlock:
> > +   spin_unlock_irqrestore(>priv_lock, flags);
> > return 0;
> 
> This should be returning ret.

yes, ofcourse. my mistake.

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


Re: [PATCH] iio: adc: Move mxs-lradc out of staging

2016-02-09 Thread Torokhov
On Mon, Feb 08, 2016 at 06:33:37PM +, Jonathan Cameron wrote:
> On 06/02/16 22:23, Ksenija Stanojevic wrote:
> > Move mxs-lradc driver from drivers/staging/iio/adc to drivers/iio/adc.
> > 
> > Signed-off-by: Ksenija Stanojevic 
> Given the input elements in here, cc'ing linux-input and Dmitry.

Input parts look reasonable to me, but please set INPUT_PROP_DIRECT to
indicate that it is a touchscreen on the device to help userspace
classify it. Can be a separate patch though.

Thanks.

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