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

Timur Tabi timur at freescale.com
Thu Apr 5 04:19:27 EST 2007


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



More information about the Linuxppc-dev mailing list