diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2017-11-08 11:18:29 +0100 |
---|---|---|
committer | Heiko Carstens <heiko.carstens@de.ibm.com> | 2017-11-08 22:11:20 +0100 |
commit | ead7a22e9b6eff225afb127f8835a1d3da271a89 (patch) | |
tree | 296023c7e837c5cfecc4f0ee935232161e9472ae /arch/s390/mm/init.c | |
parent | s390/disassembler: generate opcode tables from text file (diff) | |
download | linux-ead7a22e9b6eff225afb127f8835a1d3da271a89.tar.xz linux-ead7a22e9b6eff225afb127f8835a1d3da271a89.zip |
s390: avoid undefined behaviour
At a couple of places smatch emits warnings like this:
arch/s390/mm/vmem.c:409 vmem_map_init() warn:
right shifting more than type allows
In fact shifting a signed type right is undefined. Avoid this and add
an unsigned long cast. The shifted values are always positive.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'arch/s390/mm/init.c')
-rw-r--r-- | arch/s390/mm/init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index 3b567838b905..a26fb8ee4a6b 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c @@ -144,8 +144,8 @@ void __init mem_init(void) void free_initmem(void) { - __set_memory((unsigned long) _sinittext, - (_einittext - _sinittext) >> PAGE_SHIFT, + __set_memory((unsigned long)_sinittext, + (unsigned long)(_einittext - _sinittext) >> PAGE_SHIFT, SET_MEMORY_RW | SET_MEMORY_NX); free_initmem_default(POISON_FREE_INITMEM); } |