On Wed, May 29, 2013 at 11:34:34AM -0700, Andrew Morton wrote:
> > > > +       if (size <= 0 || gfp & __GFP_HIGHMEM)
> > > > +               return -EINVAL;
> > > > +       if (size > PAGE_SIZE)
> > > > +               return -E2BIG;
> > > 
> > > Means "Argument list too long" and isn't appropriate here.
> > 
> > Ok, I need a return value other than -EINVAL to convey to the user that the
> > allocation is larger than what the allocator can hold. I don't see an 
> > existing
> > errno that would be more suited for that.  Do you have a suggestion?
> 
> ENOMEM perhaps.  That's also somewhat misleading, but I guess there's
> precedent for ENOMEM meaning "allocation too large" as well as "out
> of memory".

Ah, spoke to soon. ENOMEM is already being used to indicate that an allocation
to grow the pool failed.

Seth

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to