From: Edward Cree <ecree.xilinx@gmail.com>
To: Pu Lehui <pulehui@huawei.com>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: bpf <bpf@vger.kernel.org>,
Network Development <netdev@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH bpf-next v2 0/5] cleanup for data casting
Date: Tue, 19 Jul 2022 14:48:22 +0100 [thread overview]
Message-ID: <df76c412-d9e4-b89d-1bd3-eefb50280f57@gmail.com> (raw)
In-Reply-To: <b5c03458-7fd8-3739-63b1-11618f4b8a6a@huawei.com>
>> On Mon, Jul 18, 2022 at 5:59 AM Pu Lehui <pulehui@huawei.com> wrote:
>>> Previously, we found that memory address casting in libbpf
>>> was not appropriate [0]. Memory addresses are conceptually
>>> unsigned, (unsigned long) casting makes more sense. With the
>>> suggestion of Daniel, we applied this cleanup to the entire
>>> bpf, and there is no functional change.
Fwiw, pointers in C aren't necessarily unsigned; some versions of
gcc have treated them as signed and — if no object can straddle
the sign boundary — it's even allowed by the standard. [1]
(And at a hardware level, a memory address is just a pattern of
bits on an address bus, which isn't arithmetic at all.)
-ed
[1]: https://yarchive.net/comp/linux/signed_pointers.html
prev parent reply other threads:[~2022-07-19 14:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-18 13:29 [PATCH bpf-next v2 0/5] cleanup for data casting Pu Lehui
2022-07-18 13:29 ` [PATCH bpf-next v2 1/5] bpf: Unify memory address casting operation style Pu Lehui
2022-07-18 13:29 ` [PATCH bpf-next v2 2/5] libbpf: " Pu Lehui
2022-07-18 13:29 ` [PATCH bpf-next v2 3/5] selftests: bpf: " Pu Lehui
2022-07-18 13:29 ` [PATCH bpf-next v2 4/5] samples: " Pu Lehui
2022-07-18 13:29 ` [PATCH bpf-next v2 5/5] selftests/bpf: Change the casting about jited_ksyms and jited_linfo Pu Lehui
2022-07-19 3:12 ` [PATCH bpf-next v2 0/5] cleanup for data casting Alexei Starovoitov
2022-07-19 4:00 ` Pu Lehui
2022-07-19 13:48 ` Edward Cree [this message]
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=df76c412-d9e4-b89d-1bd3-eefb50280f57@gmail.com \
--to=ecree.xilinx@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pulehui@huawei.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