Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xtensa: xtfpga: fix integer overflow in TASK_SIZE

This fixes the following warning when default memory region crosses
0x80000000:

arch/xtensa/include/asm/processor.h:40:47: warning:
integer overflow in expression [-Woverflow]
#define TASK_SIZE (PLATFORM_DEFAULT_MEM_START + PLATFORM_DEFAULT_MEM_SIZE)
^
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

+4 -2
+4 -2
arch/xtensa/platforms/xtfpga/include/platform/hardware.h
··· 12 12 * This file contains the hardware configuration of the XTAVNET boards. 13 13 */ 14 14 15 + #include <asm/types.h> 16 + 15 17 #ifndef __XTENSA_XTAVNET_HARDWARE_H 16 18 #define __XTENSA_XTAVNET_HARDWARE_H 17 19 18 20 /* Memory configuration. */ 19 21 20 - #define PLATFORM_DEFAULT_MEM_START CONFIG_DEFAULT_MEM_START 21 - #define PLATFORM_DEFAULT_MEM_SIZE CONFIG_DEFAULT_MEM_SIZE 22 + #define PLATFORM_DEFAULT_MEM_START __XTENSA_UL(CONFIG_DEFAULT_MEM_START) 23 + #define PLATFORM_DEFAULT_MEM_SIZE __XTENSA_UL(CONFIG_DEFAULT_MEM_SIZE) 22 24 23 25 /* Interrupt configuration. */ 24 26