[Cbe-oss-dev] [PATCH]libspe2: make spe_context_create_affinity spec conform

Dirk Herrendoerfer d.herrendoerfer at de.ibm.com
Fri Aug 29 01:45:11 EST 2008


Right - but I think we should not use EINVAL, since it is used quite
frequently.

The spec states:
ESRCH : No such SPE context (affinity_neighbor is not valid). No such gang
context (gang context could not be found).

I think ESRCH is probably a better indicator to the user to check the gang
argument.

Regards,

D.Herrendoerfer

cbe-oss-dev-bounces+d.herrendoerfer=de.ibm.com at ozlabs.org wrote on
28.08.2008 15:08:15:

> Dirk Herrendoerfer wrote:
> > Second try:
> > According to spec the spe_context_create_affinity() call should
> > not accept NULL as an argument to gang.
> > This fixes it.
> >
> > Ok to apply ?
>
> I think an error code (maybe EINVAL) should be set to the errno before
> returning from the function.
>
> >
> > Signed-off-by: D. Herrendoerfer <d_herrendoerfer at herrendoerfer dot
> > name >
> >
> >
> > Index: libspe2.c
> > ===================================================================
> > --- libspe2.c   (revision 129)
> > +++ libspe2.c   (working copy)
> > @@ -60,6 +60,9 @@ spe_context_ptr_t spe_context_create(uns
> >   */
> >  spe_context_ptr_t spe_context_create_affinity(unsigned int flags,
> spe_context_ptr_t affinity_neighbor, spe_gang_context_ptr_t gang)
> >  {
> > +   if ( gang == NULL ) {
> > +      return NULL;
> > +   }
> >     spe_context_ptr_t spe = _base_spe_context_create(flags, gang,
> affinity_neighbor);
> >     if ( spe == NULL ) {
> >        return NULL;
> >
> >
> > _______________________________________________
> > cbe-oss-dev mailing list
> > cbe-oss-dev at ozlabs.org
> > https://ozlabs.org/mailman/listinfo/cbe-oss-dev
>
>
> --
> (ASAYAMA Kazunori
>    (asayama at sm.sony.co.jp))
> t
> _______________________________________________
> cbe-oss-dev mailing list
> cbe-oss-dev at ozlabs.org
> https://ozlabs.org/mailman/listinfo/cbe-oss-dev




More information about the cbe-oss-dev mailing list