diff mbox series

[1/4] MIPS: simplify definition of TASK_SIZE64

Message ID 20190224071355.14488-2-wangxuerui@qiniu.com (mailing list archive)
State Changes Requested
Headers show
Series MIPS: support 47-bit userland VM space | expand

Commit Message

Wang Xuerui Feb. 24, 2019, 7:13 a.m. UTC
There is a "min" macro in linux/kernel.h, so use it.

Signed-off-by: Wang Xuerui <wangxuerui@qiniu.com>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Alex Belits <alex.belits@cavium.com>
Cc: James Hogan <james.hogan@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
---
 arch/mips/include/asm/processor.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/mips/include/asm/processor.h b/arch/mips/include/asm/processor.h
index aca909bd7841..c50cba85d145 100644
--- a/arch/mips/include/asm/processor.h
+++ b/arch/mips/include/asm/processor.h
@@ -13,6 +13,7 @@ 
 
 #include <linux/atomic.h>
 #include <linux/cpumask.h>
+#include <linux/kernel.h>
 #include <linux/sizes.h>
 #include <linux/threads.h>
 
@@ -62,7 +63,7 @@  extern unsigned int vced_count, vcei_count;
  */
 #define TASK_SIZE32	0x7fff8000UL
 #ifdef CONFIG_MIPS_VA_BITS_48
-#define TASK_SIZE64     (0x1UL << ((cpu_data[0].vmbits>48)?48:cpu_data[0].vmbits))
+#define TASK_SIZE64     (0x1UL << min(cpu_data[0].vmbits, 48))
 #else
 #define TASK_SIZE64     0x10000000000UL
 #endif