Skip to contentSkip to conversation

iio:magn:hmc5843: Fix passing true where iio_shared_by enum required.

PATCH In review Jonathan Cameron 4 participants 6 messages Sep 13, 2020 – Sep 21, 2020 IIO

lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

PATCH 1/1 iio:magn:hmc5843: Fix passing true where iio_shared_by enum required.

From: Jonathan Cameron <[email protected]>

So it's obvious that the code is wrong in passing true, but I'm assuming that will actually evaluate to 1 and hence IIO_SHARED_BY_TYPE. The documentation however has this attribute as IIO_SHARED_BY_ALL. My current assumption is the documentation is wrong.
If anyone knows otherwise please shout out!

Fixes 7247645f6865 ("iio: hmc5843: Move hmc5843 out of staging")
Cc H. Nikolaus Schaller <[email protected]>
---
 drivers/iio/magnetometer/hmc5843_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/magnetometer/hmc5843_core.c +2 -2
index 1474ba63babe..780faea61d82 100644
@@ -245,7 +245,7 @@ static const struct iio_enum hmc5843_meas_conf_enum = {
 };
 
 static const struct iio_chan_spec_ext_info hmc5843_ext_info[] = {
-	IIO_ENUM("meas_conf", true, &hmc5843_meas_conf_enum),
+	IIO_ENUM("meas_conf", IIO_SHARED_BY_TYPE, &hmc5843_meas_conf_enum),
 	IIO_ENUM_AVAILABLE("meas_conf", &hmc5843_meas_conf_enum),
 	IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, hmc5843_get_mount_matrix),
 	{ }
@@ -259,7 +259,7 @@ static const struct iio_enum hmc5983_meas_conf_enum = {
 };
 
 static const struct iio_chan_spec_ext_info hmc5983_ext_info[] = {
-	IIO_ENUM("meas_conf", true, &hmc5983_meas_conf_enum),
+	IIO_ENUM("meas_conf", IIO_SHARED_BY_TYPE, &hmc5983_meas_conf_enum),
 	IIO_ENUM_AVAILABLE("meas_conf", &hmc5983_meas_conf_enum),
 	IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, hmc5843_get_mount_matrix),
 	{ }
Signature · 1 line
2.28.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

So it's obvious that the code is wrong in passing true, but I'm assuming that will actually evaluate to 1 and hence IIO_SHARED_BY_TYPE. The documentation however has this attribute as IIO_SHARED_BY_ALL. My current assumption is the documentation is wrong.
If anyone knows otherwise please shout out!

Fixes 7247645f6865 ("iio: hmc5843: Move hmc5843 out of staging")
Cc H. Nikolaus Schaller <[email protected]>

Obviously correct.

Quoted 26 lines
---
  drivers/iio/magnetometer/hmc5843_core.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/magnetometer/hmc5843_core.c +2 -2
index 1474ba63babe..780faea61d82 100644
@@ -245,7 +245,7 @@ static const struct iio_enum hmc5843_meas_conf_enum = {
  };
 
  static const struct iio_chan_spec_ext_info hmc5843_ext_info[] = {
-	IIO_ENUM("meas_conf", true, &hmc5843_meas_conf_enum),
+	IIO_ENUM("meas_conf", IIO_SHARED_BY_TYPE, &hmc5843_meas_conf_enum),
  	IIO_ENUM_AVAILABLE("meas_conf", &hmc5843_meas_conf_enum),
  	IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, hmc5843_get_mount_matrix),
  	{ }
@@ -259,7 +259,7 @@ static const struct iio_enum hmc5983_meas_conf_enum = {
  };
 
  static const struct iio_chan_spec_ext_info hmc5983_ext_info[] = {
-	IIO_ENUM("meas_conf", true, &hmc5983_meas_conf_enum),
+	IIO_ENUM("meas_conf", IIO_SHARED_BY_TYPE, &hmc5983_meas_conf_enum),
  	IIO_ENUM_AVAILABLE("meas_conf", &hmc5983_meas_conf_enum),
  	IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, hmc5843_get_mount_matrix),
  	{ }
Reviewed-by on v1 1/1
#2 lore raw
In reply to Jonathan Cameron
Quoted 9 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

So it's obvious that the code is wrong in passing true, but I'm assuming that will actually evaluate to 1 and hence IIO_SHARED_BY_TYPE. The documentation however has this attribute as IIO_SHARED_BY_ALL. My current assumption is the documentation is wrong.
If anyone knows otherwise please shout out!

Yeah this is much easier to understand than the odd boolean value.

Quoted 32 lines
Fixes 7247645f6865 ("iio: hmc5843: Move hmc5843 out of staging")
Cc H. Nikolaus Schaller <[email protected]>
---
 drivers/iio/magnetometer/hmc5843_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/magnetometer/hmc5843_core.c +2 -3
index 1474ba63babe..780faea61d82 100644
@@ -245,7 +245,7 @@ static const struct iio_enum hmc5843_meas_conf_enum = {
 };
 
 static const struct iio_chan_spec_ext_info hmc5843_ext_info[] = {
-       IIO_ENUM("meas_conf", true, &hmc5843_meas_conf_enum),
+       IIO_ENUM("meas_conf", IIO_SHARED_BY_TYPE, &hmc5843_meas_conf_enum),
        IIO_ENUM_AVAILABLE("meas_conf", &hmc5843_meas_conf_enum),
        IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, hmc5843_get_mount_matrix),
        { }
@@ -259,7 +259,7 @@ static const struct iio_enum hmc5983_meas_conf_enum = {
 };
 
 static const struct iio_chan_spec_ext_info hmc5983_ext_info[] = {
-       IIO_ENUM("meas_conf", true, &hmc5983_meas_conf_enum),
+       IIO_ENUM("meas_conf", IIO_SHARED_BY_TYPE, &hmc5983_meas_conf_enum),
        IIO_ENUM_AVAILABLE("meas_conf", &hmc5983_meas_conf_enum),
        IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, hmc5843_get_mount_matrix),
        { }
--

2.28.0

author maintainer Applied
#3 lore raw
Quoted 11 lines · On Fri, 18 Sep 2020 12:15:20 -0700 Matt Ranostay <[email protected]>…
Quoted 9 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

So it's obvious that the code is wrong in passing true, but I'm assuming that will actually evaluate to 1 and hence IIO_SHARED_BY_TYPE. The documentation however has this attribute as IIO_SHARED_BY_ALL. My current assumption is the documentation is wrong.
If anyone knows otherwise please shout out!

Quoted 4 lines

Yeah this is much easier to understand than the odd boolean value.

Thanks all.

Applied to the togreg branch of iio.git. I've not marked it for stable as it has no functional affect.

Jonathan

Quoted 32 lines
Quoted 32 lines
Fixes 7247645f6865 ("iio: hmc5843: Move hmc5843 out of staging")
Cc H. Nikolaus Schaller <[email protected]>
---
 drivers/iio/magnetometer/hmc5843_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/magnetometer/hmc5843_core.c +2 -3
index 1474ba63babe..780faea61d82 100644
@@ -245,7 +245,7 @@ static const struct iio_enum hmc5843_meas_conf_enum = {
 };
 
 static const struct iio_chan_spec_ext_info hmc5843_ext_info[] = {
-       IIO_ENUM("meas_conf", true, &hmc5843_meas_conf_enum),
+       IIO_ENUM("meas_conf", IIO_SHARED_BY_TYPE, &hmc5843_meas_conf_enum),
        IIO_ENUM_AVAILABLE("meas_conf", &hmc5843_meas_conf_enum),
        IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, hmc5843_get_mount_matrix),
        { }
@@ -259,7 +259,7 @@ static const struct iio_enum hmc5983_meas_conf_enum = {
 };
 
 static const struct iio_chan_spec_ext_info hmc5983_ext_info[] = {
-       IIO_ENUM("meas_conf", true, &hmc5983_meas_conf_enum),
+       IIO_ENUM("meas_conf", IIO_SHARED_BY_TYPE, &hmc5983_meas_conf_enum),
        IIO_ENUM_AVAILABLE("meas_conf", &hmc5983_meas_conf_enum),
        IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, hmc5843_get_mount_matrix),
        { }
--

2.28.0

Tested-by on v1 1/1
#4 lore raw
In reply to Jonathan Cameron
Quoted 11 lines

Am 13.09.2020 um 13:25 schrieb Jonathan Cameron <[email protected]>:

From: Jonathan Cameron <[email protected]>

So it's obvious that the code is wrong in passing true, but I'm assuming that will actually evaluate to 1 and hence IIO_SHARED_BY_TYPE. The documentation however has this attribute as IIO_SHARED_BY_ALL. My current assumption is the documentation is wrong.
If anyone knows otherwise please shout out!

Quoted 3 lines
Fixes 7247645f6865 ("iio: hmc5843: Move hmc5843 out of staging")
Cc H. Nikolaus Schaller <[email protected]>

on GTA04 (omap3-gta04.dtsi).

Quoted 29 lines

---
drivers/iio/magnetometer/hmc5843_core.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/magnetometer/hmc5843_core.c +2 -2
index 1474ba63babe..780faea61d82 100644
@@ -245,7 +245,7 @@ static const struct iio_enum hmc5843_meas_conf_enum = {
 };
 
 static const struct iio_chan_spec_ext_info hmc5843_ext_info[] = {
-	IIO_ENUM("meas_conf", true, &hmc5843_meas_conf_enum),
+	IIO_ENUM("meas_conf", IIO_SHARED_BY_TYPE, &hmc5843_meas_conf_enum),
 	IIO_ENUM_AVAILABLE("meas_conf", &hmc5843_meas_conf_enum),
 	IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, hmc5843_get_mount_matrix),
 	{ }
@@ -259,7 +259,7 @@ static const struct iio_enum hmc5983_meas_conf_enum = {
 };
 
 static const struct iio_chan_spec_ext_info hmc5983_ext_info[] = {
-	IIO_ENUM("meas_conf", true, &hmc5983_meas_conf_enum),
+	IIO_ENUM("meas_conf", IIO_SHARED_BY_TYPE, &hmc5983_meas_conf_enum),
 	IIO_ENUM_AVAILABLE("meas_conf", &hmc5983_meas_conf_enum),
 	IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, hmc5843_get_mount_matrix),
 	{ }
Signature · 1 line
2.28.0
author maintainer
#5 lore raw
Quoted 10 lines · On Sun, 20 Sep 2020 19:12:47 +0200 "H. Nikolaus Schaller" <[email protected]>…
Quoted 10 lines

Am 13.09.2020 um 13:25 schrieb Jonathan Cameron <[email protected]>:

From: Jonathan Cameron <[email protected]>

So it's obvious that the code is wrong in passing true, but I'm assuming that will actually evaluate to 1 and hence IIO_SHARED_BY_TYPE. The documentation however has this attribute as IIO_SHARED_BY_ALL. My current assumption is the documentation is wrong.
If anyone knows otherwise please shout out!

Quoted 7 lines
Quoted 3 lines
Fixes 7247645f6865 ("iio: hmc5843: Move hmc5843 out of staging")
Cc H. Nikolaus Schaller <[email protected]>

on GTA04 (omap3-gta04.dtsi).

Thanks, that's great. Added the tag and re-pushed as testing for the autobuilders to work their magic.

Thanks,

Jonathan

Quoted 31 lines
Quoted 30 lines

---
drivers/iio/magnetometer/hmc5843_core.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/magnetometer/hmc5843_core.c +2 -2
index 1474ba63babe..780faea61d82 100644
@@ -245,7 +245,7 @@ static const struct iio_enum hmc5843_meas_conf_enum = {
 };
 
 static const struct iio_chan_spec_ext_info hmc5843_ext_info[] = {
-	IIO_ENUM("meas_conf", true, &hmc5843_meas_conf_enum),
+	IIO_ENUM("meas_conf", IIO_SHARED_BY_TYPE, &hmc5843_meas_conf_enum),
 	IIO_ENUM_AVAILABLE("meas_conf", &hmc5843_meas_conf_enum),
 	IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, hmc5843_get_mount_matrix),
 	{ }
@@ -259,7 +259,7 @@ static const struct iio_enum hmc5983_meas_conf_enum = {
 };
 
 static const struct iio_chan_spec_ext_info hmc5983_ext_info[] = {
-	IIO_ENUM("meas_conf", true, &hmc5983_meas_conf_enum),
+	IIO_ENUM("meas_conf", IIO_SHARED_BY_TYPE, &hmc5983_meas_conf_enum),
 	IIO_ENUM_AVAILABLE("meas_conf", &hmc5983_meas_conf_enum),
 	IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, hmc5843_get_mount_matrix),
 	{ }
Signature · 1 line
2.28.0