openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/libnl/1_3.4.0-r0/libnl-3.4.0/lib/cache_mngt.c
int nl_cache_mngt_unregister(struct nl_cache_ops* ops)
{
    struct nl_cache_ops *t, **tp;
    int err = 0;

    nl_write_lock(&cache_ops_lock);

    if (ops->co_refcnt > 0)
    {
        err = -NLE_BUSY;
        goto errout;
    }

    for (tp = &cache_ops; (t = *tp) != NULL; tp = &t->co_next)
        if (t == ops)
            break;

    if (!t)
    {
        err = -NLE_NOCACHE;
        goto errout;
    }

    NL_DBG(1, "Unregistered cache operations %s\n", ops->co_name);

    *tp = t->co_next;
errout:
    nl_write_unlock(&cache_ops_lock);

    return err;
}
/**
 * Unregister a set of cache operations
 * @arg ops		cache operations
 *
 * Called by users of caches to announce a set of
 * cache operations is no longer available. The
 * specified cache operations must have been registered
 * previously using nl_cache_mngt_register()
 *
 * @return 0 on success or a negative error code
 */
Unregister a set of cache operations
@arg ops             cache operations

Called by users of caches to announce a set of
cache operations is no longer available. The
specified cache operations must have been registered
previously using nl_cache_mngt_register()

@return 0 on success or a negative error code
Unregister a set of cache operations @arg ops cache operations Called by users of caches to announce a set of cache operations is no longer available . The specified cache operations must have been registered previously using nl_cache_mngt_register () @return 0 on success or a negative error code
int nl_cache_mngt_unregister(struct nl_cache_ops* ops)
{
    struct nl_cache_ops *t, **tp;
    int err = 0;
    nl_write_lock(&cache_ops_lock);
    if (ops->co_refcnt > 0)
    {
        err = -NLE_BUSY;
        goto errout;
    }
    for (tp = &cache_ops; (t = *tp) != NULL; tp = &t->co_next)
        if (t == ops)
            break;
    if (!t)
    {
        err = -NLE_NOCACHE;
        goto errout;
    }
    NL_DBG(1, "Unregistered cache operations %s\n", ops->co_name);
    *tp = t->co_next;
errout:
    nl_write_unlock(&cache_ops_lock);
    return err;
}
int nl_cache_mngt_unregister ( struct nl_cache_ops * ops ) { struct nl_cache_ops * t , * * tp ; int err = 0 ; nl_write_lock ( & cache_ops_lock ) ; if ( ops -> co_refcnt > 0 ) { err = - NLE_BUSY ; goto errout ; } for ( tp = & cache_ops ; ( t = * tp ) != NULL ; tp = & t -> co_next ) if ( t == ops ) break ; if ( ! t ) { err = - NLE_NOCACHE ; goto errout ; } NL_DBG ( 1 , " \n " , ops -> co_name ) ; * tp = t -> co_next ; errout : nl_write_unlock ( & cache_ops_lock ) ; return err ; }
Unregister a set of cache operations
 @arg ops             cache operations
Unregister a set of cache operations @arg ops cache operations