diff options
author | Stefano Babic <sbabic@denx.de> | 2014-08-08 10:18:40 +0200 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2014-08-08 10:18:40 +0200 |
commit | c23154aab5825fec81d5500c53eaa686646c76b5 (patch) | |
tree | 32b0aafae49f664a65ced50981492bb031f006b8 /include/linux/compat.h | |
parent | cb07d74e2e0c0a41533b6bcd551af9bf2ebcf2bc (diff) | |
parent | 9d195a546179bc732aba9eacccf0a9a3db591288 (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-arm
Diffstat (limited to 'include/linux/compat.h')
-rw-r--r-- | include/linux/compat.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h index 3fdfb399b5..35e216e06e 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -57,4 +57,23 @@ , __FILE__, __LINE__); } #define PAGE_SIZE 4096 + +/** + * upper_32_bits - return MSB bits 32-63 of a number if little endian, or + * return MSB bits 0-31 of a number if big endian. + * @n: the number we're accessing + * + * A basic shift-right of a 64- or 32-bit quantity. Use this to suppress + * the "right shift count >= width of type" warning when that quantity is + * 32-bits. + */ +#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16)) + +/** + * lower_32_bits - return LSB bits 0-31 of a number if little endian, or + * return LSB bits 32-63 of a number if big endian. + * @n: the number we're accessing + */ +#define lower_32_bits(n) ((u32)(n)) + #endif |