Skip to contentSkip to conversation

iio: dummy_evgen: modify the return value check for irq_sim_init()

PATCH In review Bartosz Golaszewski 2 participants 4 messages Nov 27, 2017 – Dec 10, 2017 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: dummy_evgen: modify the return value check for irq_sim_init()

As discussed with Marc Zyngier: irq_sim_init() and its devres variant should return the base of the allocated interrupt range on success rather than 0. This will be modified later - first, change the way users handle the return value of these routines.

---
 drivers/iio/dummy/iio_dummy_evgen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dummy/iio_dummy_evgen.c +1 -1
index fe8884543da0..efd0005f59b4 100644
@@ -56,7 +56,7 @@ static int iio_dummy_evgen_create(void)
 		return -ENOMEM;
 
 	ret = irq_sim_init(&iio_evgen->irq_sim, IIO_EVENTGEN_NO);
-	if (ret) {
+	if (ret < 0) {
 		kfree(iio_evgen);
 		return ret;
 	}
Signature · 1 line
2.15.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · On Mon, 27 Nov 2017 11:54:49 +0100 Bartosz Golaszewski <[email protected]> wrote:

As discussed with Marc Zyngier: irq_sim_init() and its devres variant should return the base of the allocated interrupt range on success rather than 0. This will be modified later - first, change the way users handle the return value of these routines.

I'm happy to take this but if it goes via my tree whilst the other changes take a different path you are going to slow things down considerably (a kernel cycle for this change to be in the upstream of where the fix gets applied). So I would bundle it up in a single patch set with the more major changes.

If you still want me to take it let me know, but if it might go via another route then

Thanks,

Jonathan

Quoted 17 lines
---
 drivers/iio/dummy/iio_dummy_evgen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dummy/iio_dummy_evgen.c +1 -1
index fe8884543da0..efd0005f59b4 100644
@@ -56,7 +56,7 @@ static int iio_dummy_evgen_create(void)
 		return -ENOMEM;
 
 	ret = irq_sim_init(&iio_evgen->irq_sim, IIO_EVENTGEN_NO);
-	if (ret) {
+	if (ret < 0) {
 		kfree(iio_evgen);
 		return ret;
 	}
#2 lore raw

2017-12-02 12:43 GMT+01:00 Jonathan Cameron <[email protected]>:

Quoted 34 lines
Quoted 6 lines · On Mon, 27 Nov 2017 11:54:49 +0100 Bartosz Golaszewski <[email protected]> wrote:

As discussed with Marc Zyngier: irq_sim_init() and its devres variant should return the base of the allocated interrupt range on success rather than 0. This will be modified later - first, change the way users handle the return value of these routines.

I'm happy to take this but if it goes via my tree whilst the other changes take a different path you are going to slow things down considerably (a kernel cycle for this change to be in the upstream of where the fix gets applied). So I would bundle it up in a single patch set with the more major changes.

If you still want me to take it let me know, but if it might go via another route then

Thanks,

Jonathan

Quoted 11 lines
---
 drivers/iio/dummy/iio_dummy_evgen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dummy/iio_dummy_evgen.c +0 -0
index fe8884543da0..efd0005f59b4 100644
@@ -56,7 +56,7 @@ static int iio_dummy_evgen_create(void)
              return -ENOMEM;
 
Quoted 7 lines

drivers/iio/dummy/iio_dummy_evgen.c static int iio_dummy_evgen_create(void) · line 62

Quoted 6 lines
drivers/iio/dummy/iio_dummy_evgen.c +1 -1
      ret = irq_sim_init(&iio_evgen->irq_sim, IIO_EVENTGEN_NO);
-     if (ret) {
+     if (ret < 0) {
              kfree(iio_evgen);
              return ret;
      }

There's no hurry with that, it doesn't cause any problems really and the same change must be applied to gpio-mockup. I planned to actually change the return value for 4.17 after all users are modified for 4.16.

How does it sound?

Thanks,
Bartosz

maintainer
#3 lore raw
Quoted 43 lines · On Sat, 2 Dec 2017 16:33:59 +0100 Bartosz Golaszewski <[email protected]> wrote:

2017-12-02 12:43 GMT+01:00 Jonathan Cameron <[email protected]>:

Quoted 34 lines
Quoted 6 lines · On Mon, 27 Nov 2017 11:54:49 +0100 Bartosz Golaszewski <[email protected]> wrote:

As discussed with Marc Zyngier: irq_sim_init() and its devres variant should return the base of the allocated interrupt range on success rather than 0. This will be modified later - first, change the way users handle the return value of these routines.

I'm happy to take this but if it goes via my tree whilst the other changes take a different path you are going to slow things down considerably (a kernel cycle for this change to be in the upstream of where the fix gets applied). So I would bundle it up in a single patch set with the more major changes.

If you still want me to take it let me know, but if it might go via another route then

Thanks,

Jonathan

Quoted 11 lines
---
 drivers/iio/dummy/iio_dummy_evgen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dummy/iio_dummy_evgen.c +0 -0
index fe8884543da0..efd0005f59b4 100644
@@ -56,7 +56,7 @@ static int iio_dummy_evgen_create(void)
              return -ENOMEM;
 
Quoted 7 lines

drivers/iio/dummy/iio_dummy_evgen.c static int iio_dummy_evgen_create(void) · line 62

Quoted 6 lines
drivers/iio/dummy/iio_dummy_evgen.c +1 -1
      ret = irq_sim_init(&iio_evgen->irq_sim, IIO_EVENTGEN_NO);
-     if (ret) {
+     if (ret < 0) {
              kfree(iio_evgen);
              return ret;
      }  
Quoted 6 lines

There's no hurry with that, it doesn't cause any problems really and the same change must be applied to gpio-mockup. I planned to actually change the return value for 4.17 after all users are modified for 4.16.

How does it sound?

It's fine if slow. Up to you though.

Anyhow, I've applied this to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.

Thanks,

Jonathan

Quoted 3 lines

Thanks,
Bartosz