Skip to contentSkip to conversation

iio:dac:ad5592r: Fix use of true for IIO_SHARED_BY_TYPE

PATCH In review Jonathan Cameron 2 participants 3 messages Jul 22, 2020 – Sep 17, 2020

Subsystems (2)
lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

PATCH 1/1 iio:dac:ad5592r: Fix use of true for IIO_SHARED_BY_TYPE

From: Jonathan Cameron <[email protected]>

struct iio_chan_spec_ext_info shared element is of type
enum iio_shared_by, not boolean. It's like the enum value
will for IIO_SHARED_BY_TYPE == 1 == true, hence no actual problem has been observed.

CC [M] drivers/iio/dac/ad5592r-base.o
drivers/iio/dac/ad5592r-base.c:491:13: warning: implicit conversion from ‘enum <anonymous>’ to ‘enum iio_shared_by’ [-Wenum-conversion]
491 | .shared = true,

      |
Fixes 56ca9db862bf ("iio: dac: Add support for the AD5592R/AD5593R ADCs/DACs")
Cc Alexandru Ardelean <[email protected]>
---
 drivers/iio/dac/ad5592r-base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ad5592r-base.c +1 -1
index cc4875660a69..456bf5292c44 100644
@@ -488,7 +488,7 @@ static const struct iio_chan_spec_ext_info ad5592r_ext_info[] = {
 	{
 	 .name = "scale_available",
 	 .read = ad5592r_show_scale_available,
-	 .shared = true,
+	 .shared = IIO_SHARED_BY_TYPE,
 	 },
 	{},
 };
Signature · 1 line
2.27.0
Acked-by on v1 1/1
#1 lore raw
Quoted 24 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

struct iio_chan_spec_ext_info shared element is of type
enum iio_shared_by, not boolean. It's like the enum value
will for IIO_SHARED_BY_TYPE == 1 == true, hence no actual problem has been observed.

CC [M] drivers/iio/dac/ad5592r-base.o
drivers/iio/dac/ad5592r-base.c:491:13: warning: implicit conversion from ‘enum <anonymous>’ to ‘enum iio_shared_by’ [-Wenum-conversion]
491 | .shared = true,

      |
Fixes 56ca9db862bf ("iio: dac: Add support for the AD5592R/AD5593R ADCs/DACs")
Cc Alexandru Ardelean <[email protected]>
---
 drivers/iio/dac/ad5592r-base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ad5592r-base.c +0 -0
index cc4875660a69..456bf5292c44 100644

drivers/iio/dac/ad5592r-base.c static const struct iio_chan_spec_ext_info ad5592r_ext_info[] = { · line 491

Quoted 5 lines
drivers/iio/dac/ad5592r-base.c +1 -1
@@ -488,7 +488,7 @@ static const struct iio_chan_spec_ext_info ad5592r_ext_info[] = {
        {
         .name = "scale_available",
         .read = ad5592r_show_scale_available,
-        .shared = true,
+        .shared = IIO_SHARED_BY_TYPE,
Quoted 6 lines
drivers/iio/dac/ad5592r-base.c +0 -1
         },
        {},
 };
--

2.27.0

author maintainer
#2 lore raw
Quoted 20 lines · On Thu, 23 Jul 2020 08:59:17 +0300 Alexandru Ardelean <[email protected]>…
Quoted 19 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

struct iio_chan_spec_ext_info shared element is of type
enum iio_shared_by, not boolean. It's like the enum value
will for IIO_SHARED_BY_TYPE == 1 == true, hence no actual problem has been observed.

CC [M] drivers/iio/dac/ad5592r-base.o
drivers/iio/dac/ad5592r-base.c:491:13: warning: implicit conversion from ‘enum <anonymous>’ to ‘enum iio_shared_by’ [-Wenum-conversion]
491 | .shared = true,

      |
Fixes 56ca9db862bf ("iio: dac: Add support for the AD5592R/AD5593R ADCs/DACs")
Cc Alexandru Ardelean <[email protected]>
---
 drivers/iio/dac/ad5592r-base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

drivers/iio/dac/ad5592r-base.c static const struct iio_chan_spec_ext_info ad5592r_ext_info[] = { · line 491

Quoted 10 lines
drivers/iio/dac/ad5592r-base.c +1 -1
index cc4875660a69..456bf5292c44 100644
@@ -488,7 +488,7 @@ static const struct iio_chan_spec_ext_info ad5592r_ext_info[] = {
        {
         .name = "scale_available",
         .read = ad5592r_show_scale_available,
-        .shared = true,
+        .shared = IIO_SHARED_BY_TYPE,  

Applied to the togreg branch of iio.git and pushed out as testing etc.

Ignore the fact I sent the same patch again having lost this version in my own email. oops

Jonathan

Quoted 7 lines
Quoted 7 lines
drivers/iio/dac/ad5592r-base.c +0 -1
         },
        {},
 };
--

2.27.0