* 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
| 504 | * Returns 0 if ``v`` was 0, otherwise returns 1. |
| 505 | */ |
| 506 | static inline int |
| 507 | rte_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 |