On Wed, 17 Sep 2025 18:15:36 +0800
Feifei Wang <wff_li...@vip.163.com> wrote:

> +
> +static inline int
> +hinic3_get_bit(int nr, volatile RTE_ATOMIC(uint64_t) *addr)
> +{
> +     RTE_ASSERT(nr < 0x20);
> +
> +     uint32_t mask = UINT32_C(1) << nr;
> +     return (*addr) & mask;
> +}

Shouldn't nr be unsigned? You don't want to support negative sifts here.
Use RTE_BIT32() macro if possible.

Since you declare addr as RTE_ATOMIC(), the only valid way
to access the variable is with rte_atomic_load_explicit() etc.
Some of the compilers versions (clang) will warn about this.

Reply via email to