Re: [PATCH] bitfield.h: add FIELD_MAX() and field_max()

From: Jakub Kicinski
Date: Fri Feb 28 2020 - 12:56:16 EST


On Fri, 28 Feb 2020 10:53:43 -0600 Alex Elder wrote:
> Define FIELD_MAX(), which supplies the maximum value that can be
> represented by a field value. Define field_max() as well, to go
> along with the lower-case forms of the field mask functions.
>
> Signed-off-by: Alex Elder <elder@xxxxxxxxxx>
> ---
>
> NOTE: I'm not entirely sure who owns/maintains this file so
> I'm sending it to those who have committed things to it.
> I hope someone will just take it in after review; I use
> field_max() in some code I'm about to send out.

Could you give us an example use?

Is it that you find the current macros misnamed or there's something
you can't do? Or are you trying to set fields to max?