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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux