From: Florian Weimer <fweimer@redhat.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Meng Zhuo <mengzhuo1203@gmail.com>,
linux-api@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: Please remove all bit fields in bpf uapi
Date: Fri, 18 Dec 2020 12:04:06 +0100 [thread overview]
Message-ID: <87im8z1il5.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <X9yE+hJpT73PdKjG@kroah.com> (Greg KH's message of "Fri, 18 Dec 2020 11:31:22 +0100")
* Greg KH:
> On Fri, Dec 18, 2020 at 05:09:58PM +0800, Meng Zhuo wrote:
>> Hi, Greg
>>
>> Thank you for your reply
>> It's fine to do compile bit fields "by hand".
>
> Surely Go has something like "if (field & 0x01)", right? That's all you
> need for a bitfield.
>
> Look at the most common syscall, open(2)? It uses bitfields, why
> can't Go handle that?
Flag arguments are very different from bit-fields in struct types.
Structs with bit-fields are not part of the highly portable C subset.
Even C compilers differ in their interpretation.
Thanks,
Florian
--
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill
next prev parent reply other threads:[~2020-12-18 11:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-18 8:52 Please remove all bit fields in bpf uapi Meng Zhuo
2020-12-18 8:56 ` Greg KH
2020-12-18 9:09 ` Meng Zhuo
2020-12-18 10:31 ` Greg KH
2020-12-18 11:04 ` Florian Weimer [this message]
2020-12-18 13:05 ` Daniel Borkmann
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=87im8z1il5.fsf@oldenburg2.str.redhat.com \
--to=fweimer@redhat.com \
--cc=bpf@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-api@vger.kernel.org \
--cc=mengzhuo1203@gmail.com \
/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