[Cbe-oss-dev] [PATCH] libspe2: Fix return value of spe_ps_area_get

Kazunori Asayama asayama at sm.sony.co.jp
Tue Apr 24 16:22:17 EST 2007


Jeremy Kerr <jk at ozlabs.org> wrote:
> > -	return (void*) -1;
> > +
> > +	if (ptr == (void*)-1) {
> > +		errno = EACCES;
> > +		return NULL;
> > +	}
> > +
> 
> I think MAP_FAILED would be better here, rather than explicitly using 
> (void *)-1.

Yes, that sounds reasonable. The reason why I used explicit
'(void*)-1' was that it was used in other parts of the source, that
is, there is no significant reason. I'll eliminate use of explicit
'(void*)-1' in the source later.

--
(ASAYAMA Kazunori
  (asayama at sm.sony.co.jp))
t



More information about the cbe-oss-dev mailing list