Skip to content

DP_SUCCESS() macro as inverse of DP_FAILED() #695

Open
@PlagueCZ

Description

@PlagueCZ

The absolute majority of calls are fail-early scenarios with DP_FAILED() as a wrapper.

However some calls are better handled via positive test, like

if (!DP_FAILED(rte_hash_lookup())) {
    // do extra code when entry already present
}

This is visually almost identical to the inverse case dues to how small the exclamation mark is.

It would be better to also have a DP_SUCCESS(ret) macro to make it absolutely clear that this is the non-standard test for positive result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions