linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: dummy_evgen: modify the return value check for irq_sim_init()
@ 2017-11-27 10:54 Bartosz Golaszewski
  2017-12-02 11:43 ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Bartosz Golaszewski @ 2017-11-27 10:54 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler
  Cc: linux-iio, linux-kernel, Bartosz Golaszewski

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.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
 drivers/iio/dummy/iio_dummy_evgen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/dummy/iio_dummy_evgen.c b/drivers/iio/dummy/iio_dummy_evgen.c
index fe8884543da0..efd0005f59b4 100644
--- a/drivers/iio/dummy/iio_dummy_evgen.c
+++ b/drivers/iio/dummy/iio_dummy_evgen.c
@@ -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.15.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: dummy_evgen: modify the return value check for irq_sim_init()
  2017-11-27 10:54 [PATCH] iio: dummy_evgen: modify the return value check for irq_sim_init() Bartosz Golaszewski
@ 2017-12-02 11:43 ` Jonathan Cameron
  2017-12-02 15:33   ` Bartosz Golaszewski
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2017-12-02 11:43 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, linux-kernel

On Mon, 27 Nov 2017 11:54:49 +0100
Bartosz Golaszewski <brgl@bgdev.pl> 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.
> 
> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
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

Acked-by: Jonathan Cameron <jonathan.cameron@huawei.com>

Thanks,

Jonathan
> ---
>  drivers/iio/dummy/iio_dummy_evgen.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/dummy/iio_dummy_evgen.c b/drivers/iio/dummy/iio_dummy_evgen.c
> index fe8884543da0..efd0005f59b4 100644
> --- a/drivers/iio/dummy/iio_dummy_evgen.c
> +++ b/drivers/iio/dummy/iio_dummy_evgen.c
> @@ -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;
>  	}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: dummy_evgen: modify the return value check for irq_sim_init()
  2017-12-02 11:43 ` Jonathan Cameron
@ 2017-12-02 15:33   ` Bartosz Golaszewski
  2017-12-10 15:02     ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Bartosz Golaszewski @ 2017-12-02 15:33 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, linux-kernel

2017-12-02 12:43 GMT+01:00 Jonathan Cameron <jic23@kernel.org>:
> On Mon, 27 Nov 2017 11:54:49 +0100
> Bartosz Golaszewski <brgl@bgdev.pl> 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.
>>
>> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
> 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
>
> Acked-by: Jonathan Cameron <jonathan.cameron@huawei.com>
>
> Thanks,
>
> Jonathan
>> ---
>>  drivers/iio/dummy/iio_dummy_evgen.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/iio/dummy/iio_dummy_evgen.c b/drivers/iio/dummy/iio_dummy_evgen.c
>> index fe8884543da0..efd0005f59b4 100644
>> --- a/drivers/iio/dummy/iio_dummy_evgen.c
>> +++ b/drivers/iio/dummy/iio_dummy_evgen.c
>> @@ -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;
>>       }
>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: dummy_evgen: modify the return value check for irq_sim_init()
  2017-12-02 15:33   ` Bartosz Golaszewski
@ 2017-12-10 15:02     ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2017-12-10 15:02 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, linux-kernel

On Sat, 2 Dec 2017 16:33:59 +0100
Bartosz Golaszewski <brgl@bgdev.pl> wrote:

> 2017-12-02 12:43 GMT+01:00 Jonathan Cameron <jic23@kernel.org>:
> > On Mon, 27 Nov 2017 11:54:49 +0100
> > Bartosz Golaszewski <brgl@bgdev.pl> 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.
> >>
> >> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>  
> > 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
> >
> > Acked-by: Jonathan Cameron <jonathan.cameron@huawei.com>
> >
> > Thanks,
> >
> > Jonathan  
> >> ---
> >>  drivers/iio/dummy/iio_dummy_evgen.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/iio/dummy/iio_dummy_evgen.c b/drivers/iio/dummy/iio_dummy_evgen.c
> >> index fe8884543da0..efd0005f59b4 100644
> >> --- a/drivers/iio/dummy/iio_dummy_evgen.c
> >> +++ b/drivers/iio/dummy/iio_dummy_evgen.c
> >> @@ -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;
> >>       }  
> >  
> 
> 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
> 
> Thanks,
> Bartosz

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-12-10 15:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-27 10:54 [PATCH] iio: dummy_evgen: modify the return value check for irq_sim_init() Bartosz Golaszewski
2017-12-02 11:43 ` Jonathan Cameron
2017-12-02 15:33   ` Bartosz Golaszewski
2017-12-10 15:02     ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).