Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1536840
| Path | csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Sebastian Frias <sf84@laposte.net> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] bitops: add equivalent of BIT(x) for bitfields |
| Date | Tue, 06 Dec 2016 11:40:02 +0100 |
| Message-ID | <sLlke-Rj-19@gated-at.bofh.it> (permalink) |
| References | <sL1ER-58Y-23@gated-at.bofh.it> <sL5yO-7xB-41@gated-at.bofh.it> |
| Dkim-Signature | v=1; a=rsa-sha256; c=simple/simple; d=laposte.net; s=mail0; t=1481020296; bh=PijJUo3tktTJ5MVxDxrLz0cvK2dbUo9bUIdbJmVjeXA=; h=Subject:To:References:Cc:From:Date:In-Reply-To; b=i8sh9GKw2PDkppIjxQ6cxZ9pCahimNQSiV+K4BktpK3TZb3+TsltCSa3lOmb72T/k hpy/aXhBTPc9TnGVl5gdw24Y8tgPdrXpsL9UEHsJXLKV3o2xoPyR7ohaWiT5/ZOIzR csA1Z06p2k2J1g89QHfyDmbpB7Zxok2lAEdIaA0is+KAFr1QOLZeoFFhJ9u4TN4oWi Uik44nuKp1/2g44/vFebYQNCzXCnZ2BhmSn5i+SreafZe8+UxFG7yDauzbbZkVKcfk on+NTpmc+xCzrkW03N6vw7dsJSIt+wWHWCzyttDVIgPaZ4Qaxa0fTmsxnuTKaAXQF8 +WtWuuqelX4uw== |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 7bit |
| X-Vr-Srcip | 92.154.11.170 |
| X-Vr-Score | -100 |
| X-Vr-Cause-1 | gggruggvucftvghtrhhoucdtuddrfeelfedrhedtgddthecutefuodetggdotefrodftvfcurfhrohhf |
| X-Vr-Cause-2 | ihhlvgemucfntefrqffuvffgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhs |
| X-Vr-Cause-3 | ucdlqddutddtmdenucfjughrpefuvfhfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpefu |
| X-Vr-Cause-4 | vggsrghsthhirghnucfhrhhirghsuceoshhfkeegsehlrghpohhsthgvrdhnvghtqeenucfkphepledv |
| X-Vr-Cause-5 | rdduheegrdduuddrudejtdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopegludej |
| X-Vr-Cause-6 | vddrvdejrddtrddvudegngdpihhnvghtpeelvddrudehgedruddurddujedtpdhmrghilhhfrhhomhep |
| X-Vr-Cause-7 | shhfkeegsehlrghpohhsthgvrdhnvghtpdhrtghpthhtohepghgvvghrtheslhhinhhugidqmheikehk |
| X-Vr-Cause-8 | rdhorhhg |
| X-Vr-Avstate | No |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 41 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | zijun_hu <zijun_hu@htc.com>, Sasha Levin <sasha.levin@oracle.com>, Andrew Morton <akpm@linux-foundation.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Linus Torvalds <torvalds@linux-foundation.org>, Mason <slash.tmp@free.fr>, Maxime Coquelin <maxime.coquelin@st.com>, Harvey Harrison <harvey.harrison@gmail.com>, Borislav Petkov <bp@alien8.de> |
| X-Original-Date | Tue, 6 Dec 2016 11:31:36 +0100 |
| X-Original-Message-ID | <55a33378-e235-08da-251e-fff432be72fb@laposte.net> |
| X-Original-References | <196dd443-e3c7-2c37-1dd1-bc1d249ea2fb@laposte.net> <CAMuHMdWBBFS1HZGoaixakFEOTPyWtp6dsOeYi3UFNKT7f00a3w@mail.gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1536840 |
Show key headers only | View raw
On 05/12/16 18:48, Geert Uytterhoeven wrote:
> On Mon, Dec 5, 2016 at 2:36 PM, Sebastian Frias <sf84@laposte.net> wrote:
>> Introduce SETBITFIELD(msb, lsb, value) macro to ease dealing with
>> continuous bitfields, just as BIT(x) does for single bits.
>
> If it's a bitfield, why not calling it that way?
>
I don't know if you saw v2 (or v3 for that matter), but the name was changed
to GENVALUE.
Also a small use case was added to the commit message:
"Introduce GENVALUE(msb, lsb, value) macro..."
"...This is useful mostly for creating values to be packed together
via OR operations, ex:
u32 val = 0x11110000;
val |= GENVALUE(19, 12, 0x5a);
now 'val = 0x1115a000'"
> So what about BITFIELD(start ,size), like arch/tile/kernel/tile-desc_32.c has?
>
>> SETBITFIELD_ULL(msb, lsb, value) macro is also added.
>
> Confused by the need for a "value" parameter...
"value" is the value to be massaged (shifted, masked) into a [msb:lsb] bitfield.
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] bitops: add equivalent of BIT(x) for bitfields Sebastian Frias <sf84@laposte.net> - 2016-12-05 14:40 +0100
Re: [PATCH] bitops: add equivalent of BIT(x) for bitfields Borislav Petkov <bp@alien8.de> - 2016-12-05 16:40 +0100
Re: [PATCH] bitops: add equivalent of BIT(x) for bitfields Sebastian Frias <sf84@laposte.net> - 2016-12-05 18:30 +0100
Re: [PATCH] bitops: add equivalent of BIT(x) for bitfields Linus Torvalds <torvalds@linux-foundation.org> - 2016-12-05 18:20 +0100
Re: [PATCH] bitops: add equivalent of BIT(x) for bitfields Sebastian Frias <sf84@laposte.net> - 2016-12-05 18:50 +0100
Re: [PATCH] bitops: add equivalent of BIT(x) for bitfields Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-05 18:50 +0100
Re: [PATCH] bitops: add equivalent of BIT(x) for bitfields Sebastian Frias <sf84@laposte.net> - 2016-12-06 11:40 +0100
Re: [PATCH] bitops: add equivalent of BIT(x) for bitfields Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-06 11:50 +0100
Re: [PATCH] bitops: add equivalent of BIT(x) for bitfields Sebastian Frias <sf84@laposte.net> - 2016-12-06 12:10 +0100
Re: [PATCH] bitops: add equivalent of BIT(x) for bitfields Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-06 12:40 +0100
Re: [PATCH] bitops: add equivalent of BIT(x) for bitfields Sebastian Frias <sf84@laposte.net> - 2016-12-06 16:00 +0100
Re: [PATCH] bitops: add equivalent of BIT(x) for bitfields Kalle Valo <kvalo@codeaurora.org> - 2016-12-07 09:40 +0100
csiph-web