Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1413174 > unrolled thread
| Started by | Rob Herring <robh@kernel.org> |
|---|---|
| First post | 2016-06-03 14:20 +0200 |
| Last post | 2016-06-10 15:00 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] of: irq: don't return 0 from of_irq_get() Rob Herring <robh@kernel.org> - 2016-06-03 14:20 +0200
Re: [PATCH] of: irq: don't return 0 from of_irq_get() Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-06-10 14:20 +0200
Re: [PATCH] of: irq: don't return 0 from of_irq_get() Rob Herring <robh@kernel.org> - 2016-06-10 15:00 +0200
| From | Rob Herring <robh@kernel.org> |
|---|---|
| Date | 2016-06-03 14:20 +0200 |
| Subject | Re: [PATCH] of: irq: don't return 0 from of_irq_get() |
| Message-ID | <rFWf0-32g-21@gated-at.bofh.it> |
On Sun, May 29, 2016 at 12:53:08AM +0300, Sergei Shtylyov wrote: > of_irq_get() returns 0 iff irq_create_of_mapping() call fails. Returning > both error code and 0 on failure is a sign of a misdesigned API. Return > -ENXIO instead like one of the callers, platform_get_irq(), does; fix up > the kernel-doc as well... > > Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> So I think this is done this way because of the variation in NO_IRQ definition across architectures. But then again, of_irq_get is relatively new. Rob
[toc] | [next] | [standalone]
| From | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> |
|---|---|
| Date | 2016-06-10 14:20 +0200 |
| Message-ID | <rItzQ-4sE-9@gated-at.bofh.it> |
| In reply to | #1413174 |
On 6/3/2016 3:14 PM, Rob Herring wrote:
>> of_irq_get() returns 0 iff irq_create_of_mapping() call fails. Returning
>> both error code and 0 on failure is a sign of a misdesigned API. Return
>> -ENXIO instead like one of the callers, platform_get_irq(), does; fix up
>> the kernel-doc as well...
>>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> So I think this is done this way because of the variation in NO_IRQ
> definition across architectures.
I remember that NO_IRQ is "considered harmful" by Linus. Actually, I'm nit
sure what you mean, could you elaborate on that?
> But then again, of_irq_get is
> relatively new.
> Rob
MBR, Sergei
[toc] | [prev] | [next] | [standalone]
| From | Rob Herring <robh@kernel.org> |
|---|---|
| Date | 2016-06-10 15:00 +0200 |
| Message-ID | <rIucy-4Ga-31@gated-at.bofh.it> |
| In reply to | #1419320 |
On Fri, Jun 10, 2016 at 7:14 AM, Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> wrote: > On 6/3/2016 3:14 PM, Rob Herring wrote: > >>> of_irq_get() returns 0 iff irq_create_of_mapping() call fails. Returning >>> both error code and 0 on failure is a sign of a misdesigned API. Return >>> -ENXIO instead like one of the callers, platform_get_irq(), does; fix up >>> the kernel-doc as well... >>> >>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> >> >> >> So I think this is done this way because of the variation in NO_IRQ >> definition across architectures. > > > I remember that NO_IRQ is "considered harmful" by Linus. Actually, I'm > nit sure what you mean, could you elaborate on that? Calling locations could handle 0 vs. negative differently. The return value propagates as well, so you can't easily audit how it is handled. I'm being paranoid, but we need a better reason than "misdesigned API". I'm pretty sure we misdesigned it on purpose. Rob
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web