From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH] irqdomain: Initialize number of IRQs for simple domains Date: Sat, 7 Jan 2012 12:40:16 +0100 Message-ID: <20120107114016.GA3655@avionic-0098.mockup.avionic-design.de> References: <1325860112-22051-1-git-send-email-thierry.reding@avionic-design.de> <20120106162016.GB5593@avionic-0098.mockup.avionic-design.de> <20120106213422.GF7457@ponder.secretlab.ca> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4873083779370080757==" Return-path: In-Reply-To: <20120106213422.GF7457-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: Grant Likely Cc: Tony Lindgren , Catalin Marinas , Daniel Walker , Russell King , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , David Brown , "open list:ARM/QUALCOMM MSM..." , devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, Rob Herring , Barry Song , Thomas Gleixner , "open list:OMAP SUPPORT" , Andrew Victor , "open list:ARM/ATMEL AT91RM9..." , open list , Bryan Huntsman , Richard Zhao , Sascha Hauer , David Woodhouse List-Id: linux-arm-msm@vger.kernel.org --===============4873083779370080757== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mP3DRpeJDSE+ciuQ" Content-Disposition: inline --mP3DRpeJDSE+ciuQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Grant Likely wrote: > No. ERR_PTR is a horrible pattern because you cannot tell by looking > at a prototype that returns a pointer whether or not the correct > failure test is "if (!ptr)" or "if (IS_ERR(ptr))". Unless it is > absolutely critical for an error code to be returned (which isn't the > case here) I will not accept new code that uses ERR_PTR(). >=20 > In this case, if irq_domain_add_simple() fails, then something is very > wrong. I'd much rather the routine complain loudly regardless of the > error condition. Okay, I'll keep the WARN_ON(1) and simply return NULL. > Actually, looking again at irq_domain_generate_simple() it should > probably succeed even if it cannot find a matching node since an > irq_domain does more than just device tree translation. Although, > irq_domain_generate_simple() is a stop-gap solution that will > eventually be removed. So I'll just handle errors in irq_domain_generate_simple() the same way as = in irq_domain_add_simple() and will return NULL if no matching node is found. Thierry --mP3DRpeJDSE+ciuQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk8ILyAACgkQZ+BJyKLjJp/JwACePLsFSxiy8jJiGLgoa6n8DdhF L28AnAj8DDRhLKFrXdwjuuRK6sRpGWyA =fbJq -----END PGP SIGNATURE----- --mP3DRpeJDSE+ciuQ-- --===============4873083779370080757== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ devicetree-discuss mailing list devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org https://lists.ozlabs.org/listinfo/devicetree-discuss --===============4873083779370080757==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: thierry.reding@avionic-design.de (Thierry Reding) Date: Sat, 7 Jan 2012 12:40:16 +0100 Subject: [PATCH] irqdomain: Initialize number of IRQs for simple domains In-Reply-To: <20120106213422.GF7457@ponder.secretlab.ca> References: <1325860112-22051-1-git-send-email-thierry.reding@avionic-design.de> <20120106162016.GB5593@avionic-0098.mockup.avionic-design.de> <20120106213422.GF7457@ponder.secretlab.ca> Message-ID: <20120107114016.GA3655@avionic-0098.mockup.avionic-design.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org * Grant Likely wrote: > No. ERR_PTR is a horrible pattern because you cannot tell by looking > at a prototype that returns a pointer whether or not the correct > failure test is "if (!ptr)" or "if (IS_ERR(ptr))". Unless it is > absolutely critical for an error code to be returned (which isn't the > case here) I will not accept new code that uses ERR_PTR(). > > In this case, if irq_domain_add_simple() fails, then something is very > wrong. I'd much rather the routine complain loudly regardless of the > error condition. Okay, I'll keep the WARN_ON(1) and simply return NULL. > Actually, looking again at irq_domain_generate_simple() it should > probably succeed even if it cannot find a matching node since an > irq_domain does more than just device tree translation. Although, > irq_domain_generate_simple() is a stop-gap solution that will > eventually be removed. So I'll just handle errors in irq_domain_generate_simple() the same way as in irq_domain_add_simple() and will return NULL if no matching node is found. Thierry -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: