Subject: Re: [PATCH] powerpc: change rheap functions to use long integers instead of pointers

From: Timur Tabi <[email-masked]>
Date: Wed, 04 Apr 2007 13:19:27 -0500

Scott Wood wrote:

> ...in which case it's already broken, as IS_ERR() will return true after
> you use up a little over 1/16 of the region.

Scott's right.  rh_attach_region() never supported anything above "(unsigned long) 
-MAXERR".  Perhaps I should add a check for that?

	/* Round start up */
	s = (s + m) & ~m;

+	if (IS_ERR_VALUE(s))
+		return -EINVAL;

	/* Round end down */
	e = e & ~m;

The same patch should be applied to rh_detach_region() and rh_alloc_fixed().

-- 
Timur Tabi
Linux Kernel Developer @ Freescale