[PATCH] Staging: nvec: Modify the nvec_write_sync method to return the received message in a variable (and return the error code)

2016-02-14 Thread Tomás Tormo
Signed-off-by: Tomás Tormo 
---
 drivers/staging/nvec/TODO   |  2 --
 drivers/staging/nvec/nvec.c | 34 +++---
 drivers/staging/nvec/nvec.h |  5 +++--
 3 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/nvec/TODO b/drivers/staging/nvec/TODO
index e5ae42a..e4d85d9 100644
--- a/drivers/staging/nvec/TODO
+++ b/drivers/staging/nvec/TODO
@@ -3,6 +3,4 @@ ToDo list (incomplete, unordered)
- move half of the nvec init stuff to i2c-tegra.c
- move event handling to nvec_events
- finish suspend/resume support
-   - modifiy the sync_write method to return the received
- message in a variable (and return the error code).
- add support for more device implementations
diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 4ae44a5..c7dbba5 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -288,28 +288,30 @@ EXPORT_SYMBOL(nvec_write_async);
  * @nvec: An &struct nvec_chip
  * @data: The data to write
  * @size: The size of @data
+ * @msg:  The response message received
  *
  * This is similar to nvec_write_async(), but waits for the
  * request to be answered before returning. This function
  * uses a mutex and can thus not be called from e.g.
  * interrupt handlers.
  *
- * Returns: A pointer to the response message on success,
- * %NULL on failure. Free with nvec_msg_free() once no longer
- * used.
+ * Returns: 0 on success, a negative error code on failure.
+ * The response message is returned in @msg. Shall be freed with
+ * with nvec_msg_free() once no longer used.
+ *
  */
-struct nvec_msg *nvec_write_sync(struct nvec_chip *nvec,
-   const unsigned char *data, short size)
+int nvec_write_sync(struct nvec_chip *nvec,
+   const unsigned char *data, short size,
+   struct nvec_msg **msg)
 {
-   struct nvec_msg *msg;
-
mutex_lock(&nvec->sync_write_mutex);
 
+   *msg = NULL;
nvec->sync_write_pending = (data[1] << 8) + data[0];
 
if (nvec_write_async(nvec, data, size) < 0) {
mutex_unlock(&nvec->sync_write_mutex);
-   return NULL;
+   return -ENOMEM;
}
 
dev_dbg(nvec->dev, "nvec_sync_write: 0x%04x\n",
@@ -318,16 +320,16 @@ struct nvec_msg *nvec_write_sync(struct nvec_chip *nvec,
msecs_to_jiffies(2000 {
dev_warn(nvec->dev, "timeout waiting for sync write to 
complete\n");
mutex_unlock(&nvec->sync_write_mutex);
-   return NULL;
+   return -ETIMEDOUT;
}
 
dev_dbg(nvec->dev, "nvec_sync_write: pong!\n");
 
-   msg = nvec->last_sync_msg;
+   *msg = nvec->last_sync_msg;
 
mutex_unlock(&nvec->sync_write_mutex);
 
-   return msg;
+   return 0;
 }
 EXPORT_SYMBOL(nvec_write_sync);
 
@@ -878,9 +880,9 @@ static int tegra_nvec_probe(struct platform_device *pdev)
pm_power_off = nvec_power_off;
 
/* Get Firmware Version */
-   msg = nvec_write_sync(nvec, get_firmware_version, 2);
+   err = nvec_write_sync(nvec, get_firmware_version, 2, &msg);
 
-   if (msg) {
+   if (!err) {
dev_warn(nvec->dev, "ec firmware version %02x.%02x.%02x / 
%02x\n",
msg->data[4], msg->data[5], msg->data[6], msg->data[7]);
 
@@ -924,6 +926,7 @@ static int tegra_nvec_remove(struct platform_device *pdev)
 #ifdef CONFIG_PM_SLEEP
 static int nvec_suspend(struct device *dev)
 {
+   int err;
struct platform_device *pdev = to_platform_device(dev);
struct nvec_chip *nvec = platform_get_drvdata(pdev);
struct nvec_msg *msg;
@@ -934,8 +937,9 @@ static int nvec_suspend(struct device *dev)
/* keep these sync or you'll break suspend */
nvec_toggle_global_events(nvec, false);
 
-   msg = nvec_write_sync(nvec, ap_suspend, sizeof(ap_suspend));
-   nvec_msg_free(nvec, msg);
+   err = nvec_write_sync(nvec, ap_suspend, sizeof(ap_suspend), &msg);
+   if (!err)
+   nvec_msg_free(nvec, msg);
 
nvec_disable_i2c_slave(nvec);
 
diff --git a/drivers/staging/nvec/nvec.h b/drivers/staging/nvec/nvec.h
index 2ec9de9..74184ef 100644
--- a/drivers/staging/nvec/nvec.h
+++ b/drivers/staging/nvec/nvec.h
@@ -168,8 +168,9 @@ struct nvec_chip {
 int nvec_write_async(struct nvec_chip *nvec, const unsigned char *data,
 short size);
 
-struct nvec_msg *nvec_write_sync(struct nvec_chip *nvec,
-const unsigned char *data, short size);
+int nvec_write_sync(struct nvec_chip *nvec,
+   const unsigned char *data, short size,
+   struct nvec_msg **msg);
 
 int nvec_register_notifier(struct nvec_chip *nvec,
   struct notifier_block *nb,
-- 
2.5.0

___
devel mailing list
de...@linuxdriverproject.org
http://driv

Re: [PATCH] Staging: nvec: Modify the nvec_write_sync method to return the received message in a variable (and return the error code)

2016-02-14 Thread Greg KH
On Sun, Feb 14, 2016 at 12:29:37PM +0100, Tomás Tormo wrote:
> Signed-off-by: Tomás Tormo 

You forgot to include a changelog here, I can't accept patches that
don't take the time to at least describe why the patch is needed :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: nvec: Modify the nvec_write_sync method to return the error code

2016-02-14 Thread Tomás Tormo
Modify the nvec_write_sync function to return the error code
instead of the received message.

The received message is now returned as an output parameter.

Signed-off-by: Tomás Tormo 
---
 drivers/staging/nvec/TODO   |  2 --
 drivers/staging/nvec/nvec.c | 34 +++---
 drivers/staging/nvec/nvec.h |  5 +++--
 3 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/nvec/TODO b/drivers/staging/nvec/TODO
index e5ae42a..e4d85d9 100644
--- a/drivers/staging/nvec/TODO
+++ b/drivers/staging/nvec/TODO
@@ -3,6 +3,4 @@ ToDo list (incomplete, unordered)
- move half of the nvec init stuff to i2c-tegra.c
- move event handling to nvec_events
- finish suspend/resume support
-   - modifiy the sync_write method to return the received
- message in a variable (and return the error code).
- add support for more device implementations
diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 4ae44a5..c7dbba5 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -288,28 +288,30 @@ EXPORT_SYMBOL(nvec_write_async);
  * @nvec: An &struct nvec_chip
  * @data: The data to write
  * @size: The size of @data
+ * @msg:  The response message received
  *
  * This is similar to nvec_write_async(), but waits for the
  * request to be answered before returning. This function
  * uses a mutex and can thus not be called from e.g.
  * interrupt handlers.
  *
- * Returns: A pointer to the response message on success,
- * %NULL on failure. Free with nvec_msg_free() once no longer
- * used.
+ * Returns: 0 on success, a negative error code on failure.
+ * The response message is returned in @msg. Shall be freed with
+ * with nvec_msg_free() once no longer used.
+ *
  */
-struct nvec_msg *nvec_write_sync(struct nvec_chip *nvec,
-   const unsigned char *data, short size)
+int nvec_write_sync(struct nvec_chip *nvec,
+   const unsigned char *data, short size,
+   struct nvec_msg **msg)
 {
-   struct nvec_msg *msg;
-
mutex_lock(&nvec->sync_write_mutex);
 
+   *msg = NULL;
nvec->sync_write_pending = (data[1] << 8) + data[0];
 
if (nvec_write_async(nvec, data, size) < 0) {
mutex_unlock(&nvec->sync_write_mutex);
-   return NULL;
+   return -ENOMEM;
}
 
dev_dbg(nvec->dev, "nvec_sync_write: 0x%04x\n",
@@ -318,16 +320,16 @@ struct nvec_msg *nvec_write_sync(struct nvec_chip *nvec,
msecs_to_jiffies(2000 {
dev_warn(nvec->dev, "timeout waiting for sync write to 
complete\n");
mutex_unlock(&nvec->sync_write_mutex);
-   return NULL;
+   return -ETIMEDOUT;
}
 
dev_dbg(nvec->dev, "nvec_sync_write: pong!\n");
 
-   msg = nvec->last_sync_msg;
+   *msg = nvec->last_sync_msg;
 
mutex_unlock(&nvec->sync_write_mutex);
 
-   return msg;
+   return 0;
 }
 EXPORT_SYMBOL(nvec_write_sync);
 
@@ -878,9 +880,9 @@ static int tegra_nvec_probe(struct platform_device *pdev)
pm_power_off = nvec_power_off;
 
/* Get Firmware Version */
-   msg = nvec_write_sync(nvec, get_firmware_version, 2);
+   err = nvec_write_sync(nvec, get_firmware_version, 2, &msg);
 
-   if (msg) {
+   if (!err) {
dev_warn(nvec->dev, "ec firmware version %02x.%02x.%02x / 
%02x\n",
msg->data[4], msg->data[5], msg->data[6], msg->data[7]);
 
@@ -924,6 +926,7 @@ static int tegra_nvec_remove(struct platform_device *pdev)
 #ifdef CONFIG_PM_SLEEP
 static int nvec_suspend(struct device *dev)
 {
+   int err;
struct platform_device *pdev = to_platform_device(dev);
struct nvec_chip *nvec = platform_get_drvdata(pdev);
struct nvec_msg *msg;
@@ -934,8 +937,9 @@ static int nvec_suspend(struct device *dev)
/* keep these sync or you'll break suspend */
nvec_toggle_global_events(nvec, false);
 
-   msg = nvec_write_sync(nvec, ap_suspend, sizeof(ap_suspend));
-   nvec_msg_free(nvec, msg);
+   err = nvec_write_sync(nvec, ap_suspend, sizeof(ap_suspend), &msg);
+   if (!err)
+   nvec_msg_free(nvec, msg);
 
nvec_disable_i2c_slave(nvec);
 
diff --git a/drivers/staging/nvec/nvec.h b/drivers/staging/nvec/nvec.h
index 2ec9de9..74184ef 100644
--- a/drivers/staging/nvec/nvec.h
+++ b/drivers/staging/nvec/nvec.h
@@ -168,8 +168,9 @@ struct nvec_chip {
 int nvec_write_async(struct nvec_chip *nvec, const unsigned char *data,
 short size);
 
-struct nvec_msg *nvec_write_sync(struct nvec_chip *nvec,
-const unsigned char *data, short size);
+int nvec_write_sync(struct nvec_chip *nvec,
+   const unsigned char *data, short size,
+   struct nvec_msg **msg);
 
 int nvec_register_notifier(struct nvec_chip *nvec,
   

HELLO...

2016-02-14 Thread Marcelline Adala
Hi Dear,

I'm Marcelline Adala, I am a National of France and I live in Abidjan, Cote 
d’Ivoire. I’m contacting because I want to be your friend and confide in you 
because I have in my possession now 186.13 Kilograms of Gold Dust, Quality: 23 
carat, purity 92% that I inherited from my late mother which I want to ship to 
your country and sell for investment in your country because I want to leave 
Cote d'Ivoire and relocate to your country to continue my education in your 
country. I want you to stand by me as my tutor and ship this Gold Dust to your 
country and sell for investment in your  country.

Note that I am writing you this email purely on the ground of trust because I 
don’t know you and we have not met before. I found you here and my mind 
convinced me that I can trust you. Waiting to hear from you.

My best regards to you.

Yours Truly,

Marcelline Adala

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


[PATCH] staging: rtl8712: Remove unnecessary ret variable

2016-02-14 Thread Joseph Bisch
I am forwarding this patch that I previously sent to the three people
listed in drivers/staging/rtl8712/TODO.
--
Since the variable ret is set at the beginning of the function and
never changes its value, we can just return the value it was set to.

Found using coccinelle with misc/returnvar.cocci.

Signed-off-by: Joseph Bisch 
---
 drivers/staging/rtl8712/os_intfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8712/os_intfs.c 
b/drivers/staging/rtl8712/os_intfs.c
index b89e2d3..ab19112 100644
--- a/drivers/staging/rtl8712/os_intfs.c
+++ b/drivers/staging/rtl8712/os_intfs.c
@@ -269,7 +269,6 @@ void r8712_stop_drv_timers(struct _adapter *padapter)
 
 static u8 init_default_value(struct _adapter *padapter)
 {
-   u8 ret  = _SUCCESS;
struct registry_priv *pregistrypriv = &padapter->registrypriv;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@@ -302,7 +301,7 @@ static u8 init_default_value(struct _adapter *padapter)
r8712_init_registrypriv_dev_network(padapter);
r8712_update_registrypriv_dev_network(padapter);
/*misc.*/
-   return ret;
+   return _SUCCESS;
 }
 
 u8 r8712_init_drv_sw(struct _adapter *padapter)
-- 
2.7.0


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


Re: [PATCH] staging: rtl8712: Remove unnecessary ret variable

2016-02-14 Thread Greg KH
On Sun, Feb 14, 2016 at 04:34:17PM -0500, Joseph Bisch wrote:
> I am forwarding this patch that I previously sent to the three people
> listed in drivers/staging/rtl8712/TODO.
> --

Why is the above here in the body of the patch?  Please remove it, I
don't want to have to hand-edit the patch in order to apply it :(

thanks,

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


[PATCH] staging: rtl8712: Remove unnecessary ret variable

2016-02-14 Thread Joseph Bisch
Since the variable ret is set at the beginning of the function and
never changes its value, we can just return the value it was set to.

Found using coccinelle with misc/returnvar.cocci.

Signed-off-by: Joseph Bisch 
---
 drivers/staging/rtl8712/os_intfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8712/os_intfs.c 
b/drivers/staging/rtl8712/os_intfs.c
index b89e2d3..ab19112 100644
--- a/drivers/staging/rtl8712/os_intfs.c
+++ b/drivers/staging/rtl8712/os_intfs.c
@@ -269,7 +269,6 @@ void r8712_stop_drv_timers(struct _adapter *padapter)
 
 static u8 init_default_value(struct _adapter *padapter)
 {
-   u8 ret  = _SUCCESS;
struct registry_priv *pregistrypriv = &padapter->registrypriv;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@@ -302,7 +301,7 @@ static u8 init_default_value(struct _adapter *padapter)
r8712_init_registrypriv_dev_network(padapter);
r8712_update_registrypriv_dev_network(padapter);
/*misc.*/
-   return ret;
+   return _SUCCESS;
 }
 
 u8 r8712_init_drv_sw(struct _adapter *padapter)
-- 
2.7.0


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


[PATCH v2 0/3] iio: hmc5843: Fix issues and move out of staging

2016-02-14 Thread Cristina Moraru
Fix driver issues and add completions.
Add custom attribute to display available values for bias
current, changed implementation to iio_enum in order to make
it more suggestive to the user, add documentation for undocumented
custom attributes and move the driver from the staging directory to
drivers/iio/magnetometer updating corresponding Makefile and Kconfig
files.

Cristina Moraru (3):
  iio: hmc5843: Add attributes for measurement config of bias current
  iio: hmc5843: Add ABI documentation file for hmc5843
  iio: hmc5843: Move hmc5843 out of staging

 .../ABI/testing/sysfs-bus-iio-magnetometer-hmc5843 |  15 +
 drivers/iio/magnetometer/Kconfig   |  33 +
 drivers/iio/magnetometer/Makefile  |   4 +
 drivers/iio/magnetometer/hmc5843.h |  65 ++
 drivers/iio/magnetometer/hmc5843_core.c| 686 +
 drivers/iio/magnetometer/hmc5843_i2c.c | 103 
 drivers/iio/magnetometer/hmc5843_spi.c | 100 +++
 drivers/staging/iio/magnetometer/Kconfig   |  32 -
 drivers/staging/iio/magnetometer/Makefile  |   4 +-
 drivers/staging/iio/magnetometer/hmc5843.h |  65 --
 drivers/staging/iio/magnetometer/hmc5843_core.c| 645 ---
 drivers/staging/iio/magnetometer/hmc5843_i2c.c | 103 
 drivers/staging/iio/magnetometer/hmc5843_spi.c | 100 ---
 13 files changed, 1007 insertions(+), 948 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-magnetometer-hmc5843
 create mode 100644 drivers/iio/magnetometer/hmc5843.h
 create mode 100644 drivers/iio/magnetometer/hmc5843_core.c
 create mode 100644 drivers/iio/magnetometer/hmc5843_i2c.c
 create mode 100644 drivers/iio/magnetometer/hmc5843_spi.c
 delete mode 100644 drivers/staging/iio/magnetometer/hmc5843.h
 delete mode 100644 drivers/staging/iio/magnetometer/hmc5843_core.c
 delete mode 100644 drivers/staging/iio/magnetometer/hmc5843_i2c.c
 delete mode 100644 drivers/staging/iio/magnetometer/hmc5843_spi.c

-- 
1.9.1

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


[PATCH v2 2/3] iio: hmc5843: Add ABI documentation file for hmc5843

2016-02-14 Thread Cristina Moraru
Add ABI file documenting hmc5843 non-standard attributes
meas_conf and meas_conf_available for bias current
configuration.

Signed-off-by: Cristina Moraru 
Cc: Daniel Baluta 
---
Changes since v1:
Changed API from integer values to string values
 .../ABI/testing/sysfs-bus-iio-magnetometer-hmc5843| 15 +++
 1 file changed, 15 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-magnetometer-hmc5843

diff --git a/Documentation/ABI/testing/sysfs-bus-iio-magnetometer-hmc5843 
b/Documentation/ABI/testing/sysfs-bus-iio-magnetometer-hmc5843
new file mode 100644
index 000..6275e9f
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-iio-magnetometer-hmc5843
@@ -0,0 +1,15 @@
+What:   /sys/bus/iio/devices/iio:deviceX/meas_conf
+What:   /sys/bus/iio/devices/iio:deviceX/meas_conf_available
+KernelVersion:  4.5
+Contact:linux-...@vger.kernel.org
+Description:
+Current configuration and available configurations
+   for the bias current.
+   normal  - Normal measurement configurations (default)
+   positivebias- Positive bias configuration
+   negativebias- Negative bias configuration
+   disabled- Only available on HMC5983. Disables magnetic
+ sensor and enables temperature sensor.
+   Note: The effect of this configuration may vary
+   according to the device. For exact documentation
+   check the device's datasheet.
-- 
1.9.1

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


[PATCH v2 1/3] iio: hmc5843: Add attributes for measurement config of bias current

2016-02-14 Thread Cristina Moraru
Change static attribute meas_conf for bias current configuration
to channel attribute in_magn_meas_conf and also add
in_magn_meas_conf_available attribute to view available configurations.

This patch solves functionality bug: driver was using same function
hmc5843_set_measurement_configuration for setting bias current config
for all device types but the function was returning -EINVAL for any
setting >= 0x03 although, for sensor HMC5983, value 3 is valid.

API for setting bias measurement configuration:

normal -Normal measurement configuration (default):
In normal measurement configuration the device
follows normal measurement flow. Pins BP and BN
are left floating and high impedance.

positivebias -  Positive bias configuration: In positive bias
configuration, a positive current is forced across
the resistive load on pins BP and BN.

negativebias -  Negative bias configuration. In negative bias
configuration, a negative current is forced across
the resistive load on pins BP and BN.

disabled -  Only available on HMC5983. Magnetic sensor is disabled.
Temperature sensor is enabled.

Signed-off-by: Cristina Moraru 
Cc: Daniel Baluta 
---
Changes since v1:
Changed user interface for bias configuration from
integer values to string values in order to make it
more suggestive.
Used iio_enum from implementation.
 drivers/staging/iio/magnetometer/hmc5843_core.c | 133 
 1 file changed, 87 insertions(+), 46 deletions(-)

diff --git a/drivers/staging/iio/magnetometer/hmc5843_core.c 
b/drivers/staging/iio/magnetometer/hmc5843_core.c
index e270ea1..77882b4 100644
--- a/drivers/staging/iio/magnetometer/hmc5843_core.c
+++ b/drivers/staging/iio/magnetometer/hmc5843_core.c
@@ -65,6 +65,33 @@
 #define HMC5843_MEAS_CONF_NEGATIVE_BIAS0x02
 #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 char *const hmc5843_meas_conf_modes[] = {"normal", "positivebias",
+ "negativebias"};
+
+static const char *const hmc5983_meas_conf_modes[] = {"normal", "positivebias",
+ "negativebias",
+ "disabled"};
 /* Scaling factors: 1000/Gain */
 static const int hmc5843_regval_to_nanoscale[] = {
6173, 7692, 10309, 12821, 18868, 21739, 25641, 35714
@@ -173,24 +200,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;
@@ -204,48 +213,55 @@ static int hmc5843_set_meas_conf(struct hmc5843_data 
*data, u8 meas_conf)
 }
 
 static
-ssize_t hmc5843_show_measurement_configuration(struct device *dev,
-  struct device_attribute *attr,
-  char *buf)
+int hmc5843_show_measurement_configuration(struct iio_dev *indio_dev,
+  const struct iio_chan_spec *chan)
 {
-   struct hmc5843_data *data = iio_priv(dev_to_iio_dev(dev));
+   struct hmc5843_data *data = iio_priv(indio_dev);
unsigned int val;
int ret;
 
ret = regmap_read(data->regmap, HMC5843_CONFIG_REG_A, &val);
if (ret)
return ret;
-   val &= HMC5843_MEAS_CONF_MASK;
 
-   return sprintf

[PATCH v2 3/3] iio: hmc5843: Move hmc5843 out of staging

2016-02-14 Thread Cristina Moraru
This patch moves hmc5843 driver from staging/iio/magnetometer
to iio/magnetometer, updates the corresponding Makefiles and
moves the hmc5843* entries to the 'Industrial I/O support ->
Magnetometer sensors' menu.

Signed-off-by: Cristina Moraru 
Cc: Daniel Baluta 
---
Changes since v1:
No change since v1
 drivers/iio/magnetometer/Kconfig|  33 ++
 drivers/iio/magnetometer/Makefile   |   4 +
 drivers/iio/magnetometer/hmc5843.h  |  65 +++
 drivers/iio/magnetometer/hmc5843_core.c | 686 
 drivers/iio/magnetometer/hmc5843_i2c.c  | 103 
 drivers/iio/magnetometer/hmc5843_spi.c  | 100 
 drivers/staging/iio/magnetometer/Kconfig|  32 --
 drivers/staging/iio/magnetometer/Makefile   |   4 +-
 drivers/staging/iio/magnetometer/hmc5843.h  |  65 ---
 drivers/staging/iio/magnetometer/hmc5843_core.c | 686 
 drivers/staging/iio/magnetometer/hmc5843_i2c.c  | 103 
 drivers/staging/iio/magnetometer/hmc5843_spi.c  | 100 
 12 files changed, 992 insertions(+), 989 deletions(-)
 create mode 100644 drivers/iio/magnetometer/hmc5843.h
 create mode 100644 drivers/iio/magnetometer/hmc5843_core.c
 create mode 100644 drivers/iio/magnetometer/hmc5843_i2c.c
 create mode 100644 drivers/iio/magnetometer/hmc5843_spi.c
 delete mode 100644 drivers/staging/iio/magnetometer/hmc5843.h
 delete mode 100644 drivers/staging/iio/magnetometer/hmc5843_core.c
 delete mode 100644 drivers/staging/iio/magnetometer/hmc5843_i2c.c
 delete mode 100644 drivers/staging/iio/magnetometer/hmc5843_spi.c

diff --git a/drivers/iio/magnetometer/Kconfig b/drivers/iio/magnetometer/Kconfig
index 868abad..021dc53 100644
--- a/drivers/iio/magnetometer/Kconfig
+++ b/drivers/iio/magnetometer/Kconfig
@@ -105,4 +105,37 @@ config IIO_ST_MAGN_SPI_3AXIS
depends on IIO_ST_MAGN_3AXIS
depends on IIO_ST_SENSORS_SPI
 
+config SENSORS_HMC5843
+   tristate
+   select IIO_BUFFER
+   select IIO_TRIGGERED_BUFFER
+
+config SENSORS_HMC5843_I2C
+   tristate "Honeywell HMC5843/5883/5883L 3-Axis Magnetometer (I2C)"
+   depends on I2C
+   select SENSORS_HMC5843
+   select REGMAP_I2C
+   help
+ Say Y here to add support for the Honeywell HMC5843, HMC5883 and
+ HMC5883L 3-Axis Magnetometer (digital compass).
+
+ This driver can also be compiled as a set of modules.
+ If so, these modules will be created:
+ - hmc5843_core (core functions)
+ - hmc5843_i2c (support for HMC5843, HMC5883, HMC5883L and HMC5983)
+
+config SENSORS_HMC5843_SPI
+   tristate "Honeywell HMC5983 3-Axis Magnetometer (SPI)"
+   depends on SPI_MASTER
+   select SENSORS_HMC5843
+   select REGMAP_SPI
+   help
+ Say Y here to add support for the Honeywell HMC5983 3-Axis 
Magnetometer
+ (digital compass).
+
+ This driver can also be compiled as a set of modules.
+ If so, these modules will be created:
+ - hmc5843_core (core functions)
+ - hmc5843_spi (support for HMC5983)
+
 endmenu
diff --git a/drivers/iio/magnetometer/Makefile 
b/drivers/iio/magnetometer/Makefile
index 2c72df4..dd03fe5 100644
--- a/drivers/iio/magnetometer/Makefile
+++ b/drivers/iio/magnetometer/Makefile
@@ -15,3 +15,7 @@ st_magn-$(CONFIG_IIO_BUFFER) += st_magn_buffer.o
 
 obj-$(CONFIG_IIO_ST_MAGN_I2C_3AXIS) += st_magn_i2c.o
 obj-$(CONFIG_IIO_ST_MAGN_SPI_3AXIS) += st_magn_spi.o
+
+obj-$(CONFIG_SENSORS_HMC5843)  += hmc5843_core.o
+obj-$(CONFIG_SENSORS_HMC5843_I2C)  += hmc5843_i2c.o
+obj-$(CONFIG_SENSORS_HMC5843_SPI)  += hmc5843_spi.o
diff --git a/drivers/iio/magnetometer/hmc5843.h 
b/drivers/iio/magnetometer/hmc5843.h
new file mode 100644
index 000..76a5d74
--- /dev/null
+++ b/drivers/iio/magnetometer/hmc5843.h
@@ -0,0 +1,65 @@
+/*
+ * Header file for hmc5843 driver
+ *
+ * Split from hmc5843.c
+ * Copyright (C) Josef Gajdusek 
+ *
+ * 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.
+ */
+
+#ifndef HMC5843_CORE_H
+#define HMC5843_CORE_H
+
+#include 
+#include 
+
+#define HMC5843_CONFIG_REG_A   0x00
+#define HMC5843_CONFIG_REG_B   0x01
+#define HMC5843_MODE_REG   0x02
+#define HMC5843_DATA_OUT_MSB_REGS  0x03
+#define HMC5843_STATUS_REG 0x09
+#define HMC5843_ID_REG 0x0a
+#define HMC5843_ID_END 0x0c
+
+enum hmc5843_ids {
+   HMC5843_ID,
+   HMC5883_ID,
+   HMC5883L_ID,
+   HMC5983_ID,
+};
+
+/**
+ * struct hcm5843_data - device specific data
+ * @dev:   actual device
+ * @lock:  update and read regmap data
+ * @regmap:hardware access register maps
+ * @variant:   describe chip variants
+ * @buffer:3x 16-bit ch

[PATCH] staging/lustre: proper support of NFS anonymous dentries

2016-02-14 Thread green
From: Dmitry Eremin 

NFS can ask to encode dentries that are not connected to the root.
The fix check for parent is NULL and encode a file handle accordingly.

Reviewed-on: http://review.whamcloud.com/8347
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4231
Reviewed-by: Fan Yong 
Reviewed-by: James Simmons 
Reviewed-by: Jian Yu 
Signed-off-by: Dmitry Eremin 
Signed-off-by: Oleg Drokin 
---
This also happens to fix a crash when you try to use fhandle syscalls
with Lustre.

 drivers/staging/lustre/lustre/llite/llite_nfs.c | 30 ++---
 include/linux/exportfs.h|  6 +
 2 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c 
b/drivers/staging/lustre/lustre/llite/llite_nfs.c
index 9f64dd1..58ee239 100644
--- a/drivers/staging/lustre/lustre/llite/llite_nfs.c
+++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c
@@ -141,10 +141,11 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid 
*fid, struct lu_fid *paren
struct inode  *inode;
struct dentry *result;
 
-   CDEBUG(D_INFO, "Get dentry for fid: "DFID"\n", PFID(fid));
if (!fid_is_sane(fid))
return ERR_PTR(-ESTALE);
 
+   CDEBUG(D_INFO, "Get dentry for fid: " DFID "\n", PFID(fid));
+
inode = search_inode_for_lustre(sb, fid);
if (IS_ERR(inode))
return ERR_CAST(inode);
@@ -160,7 +161,7 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid *fid, 
struct lu_fid *paren
 * We have to find the parent to tell MDS how to init lov objects.
 */
if (S_ISREG(inode->i_mode) && !ll_i2info(inode)->lli_has_smd &&
-   parent != NULL) {
+   parent && !fid_is_zero(parent)) {
struct ll_inode_info *lli = ll_i2info(inode);
 
spin_lock(&lli->lli_lock);
@@ -174,8 +175,6 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid *fid, 
struct lu_fid *paren
return result;
 }
 
-#define LUSTRE_NFS_FID   0x97
-
 /**
  * \a connectable - is nfsd will connect himself or this should be done
  *   at lustre
@@ -188,20 +187,25 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid 
*fid, struct lu_fid *paren
 static int ll_encode_fh(struct inode *inode, __u32 *fh, int *plen,
struct inode *parent)
 {
+   int fileid_len = sizeof(struct lustre_nfs_fid) / 4;
struct lustre_nfs_fid *nfs_fid = (void *)fh;
 
CDEBUG(D_INFO, "encoding for (%lu,"DFID") maxlen=%d minlen=%d\n",
- inode->i_ino, PFID(ll_inode2fid(inode)), *plen,
- (int)sizeof(struct lustre_nfs_fid));
+ inode->i_ino, PFID(ll_inode2fid(inode)), *plen, fileid_len);
 
-   if (*plen < sizeof(struct lustre_nfs_fid) / 4)
-   return 255;
+   if (*plen < fileid_len) {
+   *plen = fileid_len;
+   return FILEID_INVALID;
+   }
 
nfs_fid->lnf_child = *ll_inode2fid(inode);
-   nfs_fid->lnf_parent = *ll_inode2fid(parent);
-   *plen = sizeof(struct lustre_nfs_fid) / 4;
+   if (parent)
+   nfs_fid->lnf_parent = *ll_inode2fid(parent);
+   else
+   fid_zero(&nfs_fid->lnf_parent);
+   *plen = fileid_len;
 
-   return LUSTRE_NFS_FID;
+   return FILEID_LUSTRE;
 }
 
 static int ll_nfs_get_name_filldir(struct dir_context *ctx, const char *name,
@@ -259,7 +263,7 @@ static struct dentry *ll_fh_to_dentry(struct super_block 
*sb, struct fid *fid,
 {
struct lustre_nfs_fid *nfs_fid = (struct lustre_nfs_fid *)fid;
 
-   if (fh_type != LUSTRE_NFS_FID)
+   if (fh_type != FILEID_LUSTRE)
return ERR_PTR(-EPROTO);
 
return ll_iget_for_nfs(sb, &nfs_fid->lnf_child, &nfs_fid->lnf_parent);
@@ -270,7 +274,7 @@ static struct dentry *ll_fh_to_parent(struct super_block 
*sb, struct fid *fid,
 {
struct lustre_nfs_fid *nfs_fid = (struct lustre_nfs_fid *)fid;
 
-   if (fh_type != LUSTRE_NFS_FID)
+   if (fh_type != FILEID_LUSTRE)
return ERR_PTR(-EPROTO);
 
return ll_iget_for_nfs(sb, &nfs_fid->lnf_parent, NULL);
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
index fa05e04..d841450 100644
--- a/include/linux/exportfs.h
+++ b/include/linux/exportfs.h
@@ -97,6 +97,12 @@ enum fid_type {
FILEID_FAT_WITH_PARENT = 0x72,
 
/*
+* 128 bit child FID (struct lu_fid)
+* 128 bit parent FID (struct lu_fid)
+*/
+   FILEID_LUSTRE = 0x97,
+
+   /*
 * Filesystems must not use 0xff file ID.
 */
FILEID_INVALID = 0xff,
-- 
2.1.0

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


Re: [PATCH] staging: wilc1000: codestyle corrections

2016-02-14 Thread Greg KH
On Fri, Feb 12, 2016 at 06:05:03PM -0330, Roger H. Newell wrote:
> This patch removes braces {} for single block statements as prescribed
> by checkpatch.pl
> 
> Signed-off-by: Roger H. Newell 
> ---
>  drivers/staging/wilc1000/wilc_spi.c | 25 +
>  1 file changed, 9 insertions(+), 16 deletions(-)

You sent 2 patches that did different things, yet they had the identical
subject: line, which isn't ok :(

Please fix up and resend them in a series, so I know which to apply
before the other.

thanks,

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


Re: [PATCH] Staging: android: fix brace coding style issue in sync_debug.c

2016-02-14 Thread Greg KH
On Fri, Feb 12, 2016 at 03:52:09AM -0500, Oliver Graff wrote:
> Remove scope braces that were generating a warning in sync_debug.c since
> they were scoping a single statement
> 
> Signed-off-by: Oliver Graff 
> ---
>  drivers/staging/android/sync_debug.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/android/sync_debug.c 
> b/drivers/staging/android/sync_debug.c
> index f45d13c..02a1649 100644
> --- a/drivers/staging/android/sync_debug.c
> +++ b/drivers/staging/android/sync_debug.c
> @@ -158,9 +158,8 @@ static void sync_print_fence(struct seq_file *s, struct 
> sync_fence *fence)
>   seq_printf(s, "[%p] %s: %s\n", fence, fence->name,
>  sync_status_str(atomic_read(&fence->status)));
>  
> - for (i = 0; i < fence->num_fences; ++i) {
> + for (i = 0; i < fence->num_fences; ++i)
>   sync_print_pt(s, fence->cbs[i].sync_pt, true);
> - }
>  
>   spin_lock_irqsave(&fence->wq.lock, flags);
>   list_for_each_entry(pos, &fence->wq.task_list, task_list) {

Doesn't apply to my tree at all :(

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


Re: [PATCH v3 5/5] Staging: rtl8188eu/core: make core more readable

2016-02-14 Thread Greg Kroah-Hartman
On Fri, Feb 12, 2016 at 07:05:53PM +0100, Colin Vidal wrote:
> Signed-off-by: Colin Vidal 
> ---
>  drivers/staging/rtl8188eu/core/rtw_iol.c | 10 +++---
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/core/rtw_iol.c 
> b/drivers/staging/rtl8188eu/core/rtw_iol.c
> index 2e2145c..ba6c492 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_iol.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_iol.c
> @@ -18,11 +18,7 @@
>  
>  bool rtw_IOL_applied(struct adapter *adapter)
>  {
> - if (adapter->registrypriv.fw_iol == 1)
> - return true;
> -
> - if ((adapter->registrypriv.fw_iol == 2) &&
> - (!adapter_to_dvobj(adapter)->ishighspeed))
> - return true;
> - return false;
> + return adapter->registrypriv.fw_iol == 1 ||
> + (adapter->registrypriv.fw_iol == 2 &&
> +  !adapter_to_dvobj(adapter)->ishighspeed);
>  }

I'm sorry, but this patch does not do what you said it does, it's much
harder to read now :(

Also, I can't take a patch without a changelog text :(

thanks,

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


Re: [PATCH v3 1/5] Staging: rtl8188eu/core: remove paragraph which mention FSF address in comment header

2016-02-14 Thread Greg Kroah-Hartman
On Fri, Feb 12, 2016 at 07:05:49PM +0100, Colin Vidal wrote:
> Signed-off-by: Colin Vidal 
> ---

All of these need to be resent with a changelog comment added.

thanks,

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


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

2016-02-14 Thread Greg KH
On Thu, Feb 11, 2016 at 10:56:08PM -0800, Shaun Ren wrote:
> This patch fixes the alignment issue reported by checkpatch.pl:
> 
> CHECK: Alignment should match open parenthesis
> 
> Add a unsigned char *sgbuffer in rtsx_stor_access_xfer_buffer to make the
> following memcpy logic easier to read.
> 
> Add a struct scatterlist *sg in the use_sg branch of
> rtsx_transfer_data_partial to make the parameters of the
> rtsx_transfer_sglist_adma_partial call fit in 80 character lines after
> aligning them to the open parenthesis.
> 
> Refactor memcpy logic in rtsx_stor_access_xfer_buf to make it more legible.
> 
> Signed-off-by: Shaun Ren 
> ---
>  drivers/staging/rts5208/rtsx_transport.c | 69 
> +++-
> Changes since v3
>   * Fixed misalignment of the last parameter of rtsx_stor_access_xfer_buf()
>   * Refactored memcpy in rtsx_stor_access_xfer_buf() for legibility

Where are the 7 other patches in this series?

Please resend all of them.

thanks,

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


Re: [PATCH] staging/lustre: proper support of NFS anonymous dentries

2016-02-14 Thread Greg Kroah-Hartman
On Sun, Feb 14, 2016 at 07:13:52PM -0500, gr...@linuxhacker.ru wrote:
> From: Dmitry Eremin 
> 
> NFS can ask to encode dentries that are not connected to the root.
> The fix check for parent is NULL and encode a file handle accordingly.
> 
> Reviewed-on: http://review.whamcloud.com/8347
> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4231
> Reviewed-by: Fan Yong 
> Reviewed-by: James Simmons 
> Reviewed-by: Jian Yu 
> Signed-off-by: Dmitry Eremin 
> Signed-off-by: Oleg Drokin 
> ---
> This also happens to fix a crash when you try to use fhandle syscalls
> with Lustre.
> 
>  drivers/staging/lustre/lustre/llite/llite_nfs.c | 30 
> ++---
>  include/linux/exportfs.h|  6 +

I need an ack from someone who maintains nfs code before I can take this
one...

thanks,

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


Re: [PATCH] Staging: android: fix brace coding style issue in sync_debug.c

2016-02-14 Thread Oliver Graff
Sorry, do you mean the patch won't apply or you were the wrong person
to bother with this? Either way I'm so sorry if I wasted any of your
time.

Thanks,
Oliver

On Sun, Feb 14, 2016 at 7:35 PM, Greg KH  wrote:
> On Fri, Feb 12, 2016 at 03:52:09AM -0500, Oliver Graff wrote:
>> Remove scope braces that were generating a warning in sync_debug.c since
>> they were scoping a single statement
>>
>> Signed-off-by: Oliver Graff 
>> ---
>>  drivers/staging/android/sync_debug.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/staging/android/sync_debug.c 
>> b/drivers/staging/android/sync_debug.c
>> index f45d13c..02a1649 100644
>> --- a/drivers/staging/android/sync_debug.c
>> +++ b/drivers/staging/android/sync_debug.c
>> @@ -158,9 +158,8 @@ static void sync_print_fence(struct seq_file *s, struct 
>> sync_fence *fence)
>>   seq_printf(s, "[%p] %s: %s\n", fence, fence->name,
>>  sync_status_str(atomic_read(&fence->status)));
>>
>> - for (i = 0; i < fence->num_fences; ++i) {
>> + for (i = 0; i < fence->num_fences; ++i)
>>   sync_print_pt(s, fence->cbs[i].sync_pt, true);
>> - }
>>
>>   spin_lock_irqsave(&fence->wq.lock, flags);
>>   list_for_each_entry(pos, &fence->wq.task_list, task_list) {
>
> Doesn't apply to my tree at all :(
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: wilc1000: codestyle fix removes unnecessary spaces

2016-02-14 Thread Roger H. Newell
This patch corrects spacing errors generated by checkpatch.pl

Signed-off-by: Roger H. Newell 
---
 drivers/staging/wilc1000/wilc_spi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_spi.c 
b/drivers/staging/wilc1000/wilc_spi.c
index 2928712..d03e03a 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -514,7 +514,7 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 
adr, u8 *b, u32 sz,
crc[0] = rb[rix++];
crc[1] = rb[rix++];
} else {
-   dev_err(&spi->dev,"buffer overrun when 
reading crc.\n");
+   dev_err(&spi->dev, "buffer overrun when 
reading crc.\n");
result = N_FAIL;
return result;
}
@@ -680,7 +680,7 @@ static int spi_data_write(struct wilc *wilc, u8 *b, u32 sz)
 **/
if (!g_spi.crc_off) {
if (wilc_spi_tx(wilc, crc, 2)) {
-   dev_err(&spi->dev,"Failed data block crc write, 
bus error...\n");
+   dev_err(&spi->dev, "Failed data block crc 
write, bus error...\n");
result = N_FAIL;
break;
}
@@ -1074,7 +1074,7 @@ static int wilc_spi_clear_int_ext(struct wilc *wilc, u32 
val)
ret = wilc_spi_write_reg(wilc,
 WILC_VMM_CORE_CTL, 1);
if (!ret) {
-   dev_err(&spi->dev,"fail write reg 
vmm_core_ctl...\n");
+   dev_err(&spi->dev, "fail write reg 
vmm_core_ctl...\n");
goto _fail_;
}
}
-- 
2.5.0

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


[PATCH 2/2] staging: wilc1000: codestyle fix removes unnecessary braces

2016-02-14 Thread Roger H. Newell
This patch removes braces {} for single block statements as prescribed
by checkpatch.pl

Signed-off-by: Roger H. Newell 
---
 drivers/staging/wilc1000/wilc_spi.c | 25 +
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_spi.c 
b/drivers/staging/wilc1000/wilc_spi.c
index d03e03a..cfec982 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -380,9 +380,8 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 
adr, u8 *b, u32 sz,
break;
}
 
-   if (result != N_OK) {
+   if (result != N_OK)
return result;
-   }
 
if (!g_spi.crc_off)
wb[len - 1] = (crc7(0x7f, (const u8 *)&wb[0], len - 1)) << 1;
@@ -419,9 +418,8 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 
adr, u8 *b, u32 sz,
return result;
}
/* zero spi write buffers. */
-   for (wix = len; wix < len2; wix++) {
+   for (wix = len; wix < len2; wix++)
wb[wix] = 0;
-   }
rix = len;
 
if (wilc_spi_tx_rx(wilc, wb, rb, len2)) {
@@ -523,9 +521,8 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 
adr, u8 *b, u32 sz,
int ix;
 
/* some data may be read in response to dummy bytes. */
-   for (ix = 0; (rix < len2) && (ix < sz); ) {
+   for (ix = 0; (rix < len2) && (ix < sz); )
b[ix++] = rb[rix++];
-   }
 
sz -= ix;
 
@@ -711,9 +708,8 @@ static int spi_internal_write(struct wilc *wilc, u32 adr, 
u32 dat)
dat = cpu_to_le32(dat);
result = spi_cmd_complete(wilc, CMD_INTERNAL_WRITE, adr, (u8 *)&dat, 4,
  0);
-   if (result != N_OK) {
+   if (result != N_OK)
dev_err(&spi->dev, "Failed internal write cmd...\n");
-   }
 
return result;
 }
@@ -756,9 +752,8 @@ static int wilc_spi_write_reg(struct wilc *wilc, u32 addr, 
u32 data)
}
 
result = spi_cmd_complete(wilc, cmd, addr, (u8 *)&data, 4, clockless);
-   if (result != N_OK) {
+   if (result != N_OK)
dev_err(&spi->dev, "Failed cmd, write reg (%08x)...\n", addr);
-   }
 
return result;
 }
@@ -786,9 +781,8 @@ static int wilc_spi_write(struct wilc *wilc, u32 addr, u8 
*buf, u32 size)
 *  Data
 **/
result = spi_data_write(wilc, buf, size);
-   if (result != N_OK) {
+   if (result != N_OK)
dev_err(&spi->dev, "Failed block data write...\n");
-   }
 
return 1;
 }
@@ -1124,9 +1118,9 @@ static int wilc_spi_sync_ext(struct wilc *wilc, int nint)
return 0;
}
 
-   for (i = 0; (i < 5) && (nint > 0); i++, nint--) {
+   for (i = 0; (i < 5) && (nint > 0); i++, nint--)
reg |= (BIT((27 + i)));
-   }
+
ret = wilc_spi_write_reg(wilc, WILC_INTR_ENABLE, reg);
if (!ret) {
dev_err(&spi->dev, "Failed write reg (%08x)...\n",
@@ -1141,9 +1135,8 @@ static int wilc_spi_sync_ext(struct wilc *wilc, int nint)
return 0;
}
 
-   for (i = 0; (i < 3) && (nint > 0); i++, nint--) {
+   for (i = 0; (i < 3) && (nint > 0); i++, nint--)
reg |= BIT(i);
-   }
 
ret = wilc_spi_read_reg(wilc, WILC_INTR2_ENABLE, ®);
if (!ret) {
-- 
2.5.0

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


[PATCH 2/2] staging: wilc1000: codestyle fix removes unnecessary braces

2016-02-14 Thread Roger H. Newell
This patch removes braces {} for single block statements as prescribed
by checkpatch.pl

Signed-off-by: Roger H. Newell 
---
 drivers/staging/wilc1000/wilc_spi.c | 25 +
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_spi.c 
b/drivers/staging/wilc1000/wilc_spi.c
index d03e03a..cfec982 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -380,9 +380,8 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 
adr, u8 *b, u32 sz,
break;
}
 
-   if (result != N_OK) {
+   if (result != N_OK)
return result;
-   }
 
if (!g_spi.crc_off)
wb[len - 1] = (crc7(0x7f, (const u8 *)&wb[0], len - 1)) << 1;
@@ -419,9 +418,8 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 
adr, u8 *b, u32 sz,
return result;
}
/* zero spi write buffers. */
-   for (wix = len; wix < len2; wix++) {
+   for (wix = len; wix < len2; wix++)
wb[wix] = 0;
-   }
rix = len;
 
if (wilc_spi_tx_rx(wilc, wb, rb, len2)) {
@@ -523,9 +521,8 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 
adr, u8 *b, u32 sz,
int ix;
 
/* some data may be read in response to dummy bytes. */
-   for (ix = 0; (rix < len2) && (ix < sz); ) {
+   for (ix = 0; (rix < len2) && (ix < sz); )
b[ix++] = rb[rix++];
-   }
 
sz -= ix;
 
@@ -711,9 +708,8 @@ static int spi_internal_write(struct wilc *wilc, u32 adr, 
u32 dat)
dat = cpu_to_le32(dat);
result = spi_cmd_complete(wilc, CMD_INTERNAL_WRITE, adr, (u8 *)&dat, 4,
  0);
-   if (result != N_OK) {
+   if (result != N_OK)
dev_err(&spi->dev, "Failed internal write cmd...\n");
-   }
 
return result;
 }
@@ -756,9 +752,8 @@ static int wilc_spi_write_reg(struct wilc *wilc, u32 addr, 
u32 data)
}
 
result = spi_cmd_complete(wilc, cmd, addr, (u8 *)&data, 4, clockless);
-   if (result != N_OK) {
+   if (result != N_OK)
dev_err(&spi->dev, "Failed cmd, write reg (%08x)...\n", addr);
-   }
 
return result;
 }
@@ -786,9 +781,8 @@ static int wilc_spi_write(struct wilc *wilc, u32 addr, u8 
*buf, u32 size)
 *  Data
 **/
result = spi_data_write(wilc, buf, size);
-   if (result != N_OK) {
+   if (result != N_OK)
dev_err(&spi->dev, "Failed block data write...\n");
-   }
 
return 1;
 }
@@ -1124,9 +1118,9 @@ static int wilc_spi_sync_ext(struct wilc *wilc, int nint)
return 0;
}
 
-   for (i = 0; (i < 5) && (nint > 0); i++, nint--) {
+   for (i = 0; (i < 5) && (nint > 0); i++, nint--)
reg |= (BIT((27 + i)));
-   }
+
ret = wilc_spi_write_reg(wilc, WILC_INTR_ENABLE, reg);
if (!ret) {
dev_err(&spi->dev, "Failed write reg (%08x)...\n",
@@ -1141,9 +1135,8 @@ static int wilc_spi_sync_ext(struct wilc *wilc, int nint)
return 0;
}
 
-   for (i = 0; (i < 3) && (nint > 0); i++, nint--) {
+   for (i = 0; (i < 3) && (nint > 0); i++, nint--)
reg |= BIT(i);
-   }
 
ret = wilc_spi_read_reg(wilc, WILC_INTR2_ENABLE, ®);
if (!ret) {
-- 
2.5.0

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


Re: [PATCH] Staging: android: fix brace coding style issue in sync_debug.c

2016-02-14 Thread Greg KH
On Sun, Feb 14, 2016 at 08:02:38PM -0500, Oliver Graff wrote:
> Sorry, do you mean the patch won't apply or you were the wrong person
> to bother with this? Either way I'm so sorry if I wasted any of your
> time.

The patch didn't apply to my tree.  I'm the right one to send this to,
please make your patch against linux-next to ensure that you don't
duplicate work someone else has already done.

thanks,

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


[PATCH] staging: lustre: Fixed the parenthesis

2016-02-14 Thread Shalin Mehta
The parentehsis are fixed in the macro for the ldlm lock to set and
clear the flags.

Signed-off-by: Shalin Mehta 
---
 drivers/staging/lustre/lustre/include/lustre_dlm_flags.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm_flags.h 
b/drivers/staging/lustre/lustre/include/lustre_dlm_flags.h
index 0d3ed87..4f9e9ad 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm_flags.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm_flags.h
@@ -365,10 +365,10 @@
 #define LDLM_TEST_FLAG(_l, _b)(((_l)->l_flags & (_b)) != 0)
 
 /** set a ldlm_lock flag bit */
-#define LDLM_SET_FLAG(_l, _b) (((_l)->l_flags |= (_b))
+#define LDLM_SET_FLAG(_l, _b) ((_l)->l_flags |= (_b))
 
 /** clear a ldlm_lock flag bit */
-#define LDLM_CLEAR_FLAG(_l, _b)   (((_l)->l_flags &= ~(_b))
+#define LDLM_CLEAR_FLAG(_l, _b)   ((_l)->l_flags &= ~(_b))
 
 /** Mask of flags inherited from parent lock when doing intents. */
 #define LDLM_INHERIT_FLAGSLDLM_FL_INHERIT_MASK
-- 
1.9.1

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