Re: [RESEND PATCH v5 3/5] drivers core: allow probe_err accept integer and pointer types

2020-06-25 Thread Andrzej Hajda
On 25.06.2020 10:41, Andy Shevchenko wrote: > On Wed, Jun 24, 2020 at 10:40 PM Andrzej Hajda wrote: >> On 24.06.2020 17:16, Robin Murphy wrote: > ... > >> I have proposed such thing in my previous iteration[1], except it was >> macro because of variadic arguments. > You may have a function with

Re: [RESEND PATCH v5 3/5] drivers core: allow probe_err accept integer and pointer types

2020-06-25 Thread Andy Shevchenko
On Wed, Jun 24, 2020 at 10:40 PM Andrzej Hajda wrote: > On 24.06.2020 17:16, Robin Murphy wrote: ... > I have proposed such thing in my previous iteration[1], except it was > macro because of variadic arguments. You may have a function with variadic arguments. Macros are beasts and make in

Re: [RESEND PATCH v5 3/5] drivers core: allow probe_err accept integer and pointer types

2020-06-24 Thread Andrzej Hajda
On 24.06.2020 17:16, Robin Murphy wrote: > On 2020-06-24 16:04, Mark Brown wrote: >> On Wed, Jun 24, 2020 at 03:25:33PM +0100, Robin Murphy wrote: >> >>> And yeah, anyone who pipes up suggesting that places where an >>> ERR_PTR value >>> could be passed to probe_err() could simply refactor

Re: [RESEND PATCH v5 3/5] drivers core: allow probe_err accept integer and pointer types

2020-06-24 Thread Robin Murphy
On 2020-06-24 16:04, Mark Brown wrote: On Wed, Jun 24, 2020 at 03:25:33PM +0100, Robin Murphy wrote: And yeah, anyone who pipes up suggesting that places where an ERR_PTR value could be passed to probe_err() could simply refactor IS_ERR() checks with more uses of the god-awful

Re: [RESEND PATCH v5 3/5] drivers core: allow probe_err accept integer and pointer types

2020-06-24 Thread Mark Brown
On Wed, Jun 24, 2020 at 03:25:33PM +0100, Robin Murphy wrote: > And yeah, anyone who pipes up suggesting that places where an ERR_PTR value > could be passed to probe_err() could simply refactor IS_ERR() checks with > more uses of the god-awful PTR_ERR_OR_ZERO() obfuscator gets a long stare of >

Re: [RESEND PATCH v5 3/5] drivers core: allow probe_err accept integer and pointer types

2020-06-24 Thread Rafael J. Wysocki
On Wed, Jun 24, 2020 at 4:44 PM Andrzej Hajda wrote: > > > On 24.06.2020 14:14, Rafael J. Wysocki wrote: > > On Wed, Jun 24, 2020 at 1:41 PM Andrzej Hajda wrote: > >> Many resource acquisition functions return error value encapsulated in > >> pointer instead of integer value. To simplify coding

Re: [RESEND PATCH v5 3/5] drivers core: allow probe_err accept integer and pointer types

2020-06-24 Thread Andrzej Hajda
On 24.06.2020 14:30, Greg Kroah-Hartman wrote: > On Wed, Jun 24, 2020 at 01:41:25PM +0200, Andrzej Hajda wrote: >> Many resource acquisition functions return error value encapsulated in >> pointer instead of integer value. To simplify coding we can use macro >> which will accept both types of

Re: [RESEND PATCH v5 3/5] drivers core: allow probe_err accept integer and pointer types

2020-06-24 Thread Andrzej Hajda
On 24.06.2020 14:14, Rafael J. Wysocki wrote: > On Wed, Jun 24, 2020 at 1:41 PM Andrzej Hajda wrote: >> Many resource acquisition functions return error value encapsulated in >> pointer instead of integer value. To simplify coding we can use macro >> which will accept both types of error. >>

Re: [RESEND PATCH v5 3/5] drivers core: allow probe_err accept integer and pointer types

2020-06-24 Thread Robin Murphy
On 2020-06-24 13:55, Andy Shevchenko wrote: On Wed, Jun 24, 2020 at 3:37 PM Robin Murphy wrote: On 2020-06-24 12:41, Andrzej Hajda wrote: Many resource acquisition functions return error value encapsulated in pointer instead of integer value. To simplify coding we can use macro which will

Re: [RESEND PATCH v5 3/5] drivers core: allow probe_err accept integer and pointer types

2020-06-24 Thread Laurent Pinchart
On Wed, Jun 24, 2020 at 01:37:52PM +0100, Robin Murphy wrote: > On 2020-06-24 12:41, Andrzej Hajda wrote: > > Many resource acquisition functions return error value encapsulated in > > pointer instead of integer value. To simplify coding we can use macro > > which will accept both types of error.

Re: [RESEND PATCH v5 3/5] drivers core: allow probe_err accept integer and pointer types

2020-06-24 Thread Andrzej Hajda
On 24.06.2020 14:53, Andy Shevchenko wrote: > On Wed, Jun 24, 2020 at 2:41 PM Andrzej Hajda wrote: >> Many resource acquisition functions return error value encapsulated in >> pointer instead of integer value. To simplify coding we can use macro >> which will accept both types of error. >> With

Re: [RESEND PATCH v5 3/5] drivers core: allow probe_err accept integer and pointer types

2020-06-24 Thread Andy Shevchenko
On Wed, Jun 24, 2020 at 3:37 PM Robin Murphy wrote: > On 2020-06-24 12:41, Andrzej Hajda wrote: > > Many resource acquisition functions return error value encapsulated in > > pointer instead of integer value. To simplify coding we can use macro > > which will accept both types of error. > > With

Re: [RESEND PATCH v5 3/5] drivers core: allow probe_err accept integer and pointer types

2020-06-24 Thread Andy Shevchenko
On Wed, Jun 24, 2020 at 2:41 PM Andrzej Hajda wrote: > > Many resource acquisition functions return error value encapsulated in > pointer instead of integer value. To simplify coding we can use macro > which will accept both types of error. > With this patch user can use: > probe_err(dev,

Re: [RESEND PATCH v5 3/5] drivers core: allow probe_err accept integer and pointer types

2020-06-24 Thread Robin Murphy
On 2020-06-24 12:41, Andrzej Hajda wrote: Many resource acquisition functions return error value encapsulated in pointer instead of integer value. To simplify coding we can use macro which will accept both types of error. With this patch user can use: probe_err(dev, ptr, ...) instead of:

Re: [RESEND PATCH v5 3/5] drivers core: allow probe_err accept integer and pointer types

2020-06-24 Thread Greg Kroah-Hartman
On Wed, Jun 24, 2020 at 01:41:25PM +0200, Andrzej Hajda wrote: > Many resource acquisition functions return error value encapsulated in > pointer instead of integer value. To simplify coding we can use macro > which will accept both types of error. > With this patch user can use: >

Re: [RESEND PATCH v5 3/5] drivers core: allow probe_err accept integer and pointer types

2020-06-24 Thread Rafael J. Wysocki
On Wed, Jun 24, 2020 at 1:41 PM Andrzej Hajda wrote: > > Many resource acquisition functions return error value encapsulated in > pointer instead of integer value. To simplify coding we can use macro > which will accept both types of error. > With this patch user can use: > probe_err(dev,