[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200229121705.5e29c886@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Sat, 29 Feb 2020 12:17:05 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Alex Elder <elder@...aro.org>
Cc: Al Viro <viro@...iv.linux.org.uk>,
Johannes Berg <johannes@...solutions.net>,
Arnd Bergmann <arnd@...db.de>,
Masahiro Yamada <masahiroy@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] bitfield.h: add FIELD_MAX() and field_max()
On Sat, 29 Feb 2020 07:10:45 -0600 Alex Elder wrote:
> I should have actually checked my code before I sent this. Yes
> I am using the macro as I described, to see if something fits.
> But I'm also using it this way:
>
> foo = u32_get_bits(register, FOO_COUNT_FMASK);
> if (foo == field_max(FOO_COUNT_MASK))
> ; /* This has special meaning */
>
> And another way:
>
> size_limit = field_max(FOO_COUNT_MASK) * sizeof(struct foo);
>
> So field_max() is really what I need here.
Makes sense, in that case:
Acked-by: Jakub Kicinski <kuba@...nel.org>
Powered by blists - more mailing lists