From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v4 1/6] xen: dt: add dt_for_each_irq_map helper Date: Fri, 3 Jul 2015 16:28:37 +0100 Message-ID: <1435937317.9447.158.camel@citrix.com> References: <1431084401.2660.440.camel@citrix.com> <1431084420-14372-1-git-send-email-ian.campbell@citrix.com> <558D9040.7070503@citrix.com> <1435933014.9447.123.camel@citrix.com> <5596A71C.4090509@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5596A71C.4090509@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xen.org, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Fri, 2015-07-03 at 16:15 +0100, Julien Grall wrote: > >> The other caller of dt_irq_translate returns an error when ret is not 0. > >> I would do the same here. > > > > dt_device_get_irq just returns the value of dt_irq_translate directly. > > But the caller of dt_device_get_irq is treating everything other than 0 > as an error. > > > > > Are you suggesting this code should treat positive results as an error > > as well as negative ones? I don't agree, this function has the normal 0 > > on success -ve on error semantics AFAICT. > > Well, it's not documented so it can be interpreted differently. It's not documented, but it's pretty conventional throughout most Linux interfaces... > I > personally interpreted as anything other than 0 is an error. This is how > Linux behave on most of the of_* function and I think it's "safer". ...but it does look like of_* (which are dt_* in Xen) do indeed behave that way so I shall change it. I'm going to change the two cb invocations for consistency too. Ian.