lkml.org 
[lkml]   [2016]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] of: irq: don't return 0 from of_irq_get()
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

\
 
 \ /
  Last update: 2016-06-10 15:21    [W:0.151 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site