mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Elder <elder@linaro.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	Johannes Berg <johannes@sipsolutions.net>,
	Arnd Bergmann <arnd@arndb.de>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] bitfield.h: add FIELD_MAX() and field_max()
Date: Fri, 28 Feb 2020 12:37:14 -0600	[thread overview]
Message-ID: <d2fc495b-0520-2acc-accb-4f03637dfd85@linaro.org> (raw)
In-Reply-To: <20200228103339.4f36d6ae@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>

On 2/28/20 12:33 PM, Jakub Kicinski wrote:
> On Fri, 28 Feb 2020 12:06:09 -0600 Alex Elder wrote:
>> On 2/28/20 12:04 PM, Alex Elder wrote:
>>>
>>>
>>> I find field_max() to be a good name for what I'm looking for.  
>>
>> Sorry I wanted to add this but clicked "send" too fast.
>>
>> Yes it's the same as field_mask(), but that name only *implies*
>> it is the same as the maximum value.  I mean, they're the same,
>> but the name I'm suggesting conveys its purpose better.
> 
> We got FIELD_FIT tho.. The comparison is part of the macro there, 
> and it catches negative values if they manage to sneak in.

Ahhh!  I was using the lower-case macros and it looks like there
isn't one (despite seeming to have all(?) of the others).

How would you feel about having field_fit() be a lower-case
equivalent of FIELD_FIT()?

					-Alex


  reply	other threads:[~2020-02-28 18:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28 16:53 Alex Elder
2020-02-28 17:56 ` Jakub Kicinski
2020-02-28 18:04   ` Alex Elder
2020-02-28 18:06     ` Alex Elder
2020-02-28 18:33       ` Jakub Kicinski
2020-02-28 18:37         ` Alex Elder [this message]
2020-02-28 19:01           ` Jakub Kicinski
2020-02-29 13:10     ` Alex Elder
2020-02-29 20:17       ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2fc495b-0520-2acc-accb-4f03637dfd85@linaro.org \
    --to=elder@linaro.org \
    --cc=arnd@arndb.de \
    --cc=bjorn.andersson@linaro.org \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®