Subject: Re: [RFC net-next 1/6] tools: ynl: fix render-max for flags definition

From: Jakub Kicinski <[email-masked]>
Date: Thu, 23 Feb 2023 09:09:37 -0800

On Thu, 23 Feb 2023 13:11:33 +0100 Lorenzo Bianconi wrote:
> +                if const['type'] == 'flags':
> +                    max_name = c_upper(name_pfx + 'mask')
> +                    max_val = f' = {(entry.user_value() << 1) - 1},'
> +                    cw.p(max_name + max_val)

Could you use EnumSet::get_mask instead() ?

I think it also needs to be fixed to actually walk the elements 
and combine the user_value()s rather than count them and assume
there are no gaps.