> >
> >> +     uint64_t pool_size;
> >> +
> >> +     /** Minimum alloc size application will request from pool
> (bytes)*/
> >> +     uint64_t min_alloc;
> >
> > Since this is a driver interface: ... size *driver* will request ...
> 
> It is not limited to drivers: other driver elements such as
> enumerators, devios... will also be "clients" of this interface. Would
> you accept "user" rather than "application"?

I think user is OK. The main point is that application never uses/sees this 
interface.

 
> >
> >> + *
> >> + * @return Non-zero value if pool inconsistency is detected
> >
> > 0   on success
> > <0  on failure
> 
> OK=> V3
> A side comment there: If we say 0   on success and <0  on failure,
> do you regard the statement "if (odpdrv_shm_pool_print()) {error}" as
> valid?
> Or do you always require "if (odpdrv_shm_pool_print() < 0) {error}" ?
> The first statement would react on positive values, and nothing is
> technically said about them...
> I will change it as you want anyway.


if (foo()) is OK.

Interface does not define any positive values for success either. Specification 
of <0 allows -1, -2, etc for failure return codes. If interface would change to 
have more success codes than the 0, caller would likely need to check those and 
change the if statement anyway.


-Petri

Reply via email to