Thread (36 messages) 36 messages, 5 authors, 2020-01-16

Re: [PATCH v15 06/23] selftests/vm/pkeys: Typecast the pkey register

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2019-12-19 11:39:53
Also in: linux-arch, linux-kselftest, linux-mm

Dave Hansen [off-list ref] writes:
On 12/18/19 12:59 PM, Michal Suchánek wrote:
quoted
quoted
I'd really just rather do %016lx *everywhere* than sprinkle the
PKEY_REG_FMTs around.
Does lx work with u32 without warnings?
Either way, I'd be happy to just make the x86 one u64 to make the whole
thing look more sane,
It's userspace so you don't get u64, you only get __u64.

And then you'll hit the fact that by default __u64 is unsigned long on
powerpc and unsigned long long on x86, meaning you still can't use the
same printf specifier.

To avoid that you should define __SANE_USERSPACE_TYPES__ before
including any headers, and then you'll get unsigned long long for __u64
everywhere and you can just use %llx.

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help