Thread (9 messages) flat view 9 messages, 3 authors, 2022-07-19

Re: [PATCH bpf-next v2 0/5] cleanup for data casting

From: Edward Cree <ecree.xilinx@gmail.com>
Date: 2022-07-19 14:17:18
Also in: bpf, lkml

quoted
On Mon, Jul 18, 2022 at 5:59 AM Pu Lehui [off-list ref] wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help