Skip to content

Instantly share code, notes, and snippets.

@leitao
Created June 18, 2018 13:55
Show Gist options
  • Save leitao/a2aff0621f89f0d11c1687d524bcb859 to your computer and use it in GitHub Desktop.
Save leitao/a2aff0621f89f0d11c1687d524bcb859 to your computer and use it in GitHub Desktop.
commit 2ee2270e6f40173cbb1e2bfd4a073e7cf7469f30 (HEAD -> tbs2)
Author: Breno Leitao <leitao@debian.org>
Date: Mon Jun 18 09:40:09 2018 -0400
powerpc/reg: Enable __MASK to be 64bits wide.
Currently __MASK is defined as type unsigned log (UL), which does not seem
correct, since this is mask to be used against MSR, which is 64-bits wide even
on 32 bits mode.
Unsigned Long (UL) type could be 64-bits on powerpc64, but that is not always
valid in different configurations (aka 32bits).
According to C99, the guaranteed type for 64bits definitions is long long
and 'long' just guarantees 32-bits size.
Signed-off-by: Breno Leitao <leitao@debian.org>
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 75c5b2cd9d66..7cf564459a99 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -62,7 +62,7 @@
#ifdef __ASSEMBLY__
#define __MASK(X) (1<<(X))
#else
-#define __MASK(X) (1UL<<(X))
+#define __MASK(X) (1ULL<<(X))
#endif
#ifdef CONFIG_PPC64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment