MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_bsf32_safe

Function rte_bsf32_safe

dpdk/lib/eal/include/rte_bitops.h:506–514  ·  view source on GitHub ↗

* Searches the input parameter for the least significant set bit * (starting from zero). Safe version (checks for input parameter being zero). * * @warning ``pos`` must be a valid pointer. It is not checked! * * @param v * The input parameter. * @param pos * If ``v`` was not 0, this value will contain position of least significant * bit within the input parameter. * @return

Source from the content-addressed store, hash-verified

504 * Returns 0 if ``v`` was 0, otherwise returns 1.
505 */
506static inline int
507rte_bsf32_safe(uint32_t v, uint32_t *pos)
508{
509 if (v == 0)
510 return 0;
511
512 *pos = rte_bsf32(v);
513 return 1;
514}
515
516/**
517 * Searches the input parameter for the least significant set bit

Callers 1

test_bsfFunction · 0.50

Calls 1

rte_bsf32Function · 0.70

Tested by 1

test_bsfFunction · 0.40