[PATCH 1/7] omap: iommu: migrate to the generic IOMMU API

Arnd Bergmann arnd at arndb.de
Thu Aug 18 09:35:42 EDT 2011


On Thursday 18 August 2011, Laurent Pinchart wrote:
> > +static int omap_iommu_domain_init(struct iommu_domain *domain)
> > +{
> > +     struct omap_iommu_domain *omap_domain;
> > +
> > +     omap_domain = kzalloc(sizeof(*omap_domain), GFP_KERNEL);
> > +     if (!omap_domain) {
> > +             pr_err("kzalloc failed\n");
> > +             goto out;
> 
> You can directly return -ENOMEM here, and remove the "out:" label.

Risking to get into bike-shedding here, I would comment that the current
code is actually better. I would not mix the two methods of error handling
in one function. If you use goto labels, better use them consistenly and
have only one 'return' statement.

	Arnd



More information about the linux-arm-kernel mailing list