[openib-general] Error code in "create" functions

Roland Dreier roland at topspin.com
Tue Aug 17 14:34:30 PDT 2004


    Dror> My concern is about the ability to return error status. The
    Dror> failure may be due to lack of resources, in which case,
    Dror> returning NULL makes sense. However, some may fail because
    Dror> of bad parameters being passed in. This is mainly because
    Dror> these functions not only deal with memory allocation of the
    Dror> object, they also deal with initialization of the object and
    Dror> configuration of the HW.

    Sean> Based on previous discussions, I believe that the plan is to
    Sean> use the ERR_PTR / PTR_ERR / IS_ERR routines to return
    Sean> failure reasons.

Exactly, that is what my implementation in mthca does.

 - Roland



More information about the general mailing list