Thread (49 messages) 49 messages, 5 authors, 2018-03-28

Re: [PATCH v12 13/22] selftests/vm: powerpc implementation for generic abstraction

From: Dave Hansen <hidden>
Date: 2018-03-16 22:23:38
Also in: linux-arch, linux-doc, linux-kselftest, linux-mm, lkml

On 02/21/2018 05:55 PM, Ram Pai wrote:
 static inline u32 pkey_to_shift(int pkey)
 {
+#if defined(__i386__) || defined(__x86_64__) /* arch */
 	return pkey * PKEY_BITS_PER_PKEY;
+#elif __powerpc64__ /* arch */
+	return (NR_PKEYS - pkey - 1) * PKEY_BITS_PER_PKEY;
+#endif /* arch */
 }
I really detest the #if #else style.  Can't we just have a pkey_ppc.h
and a pkey_x86.h or something?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help