]> git.baikalelectronics.ru Git - kernel.git/commit
s390: avoid undefined behaviour
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Wed, 8 Nov 2017 10:18:29 +0000 (11:18 +0100)
committerHeiko Carstens <heiko.carstens@de.ibm.com>
Wed, 8 Nov 2017 21:11:20 +0000 (22:11 +0100)
commitd0e5eb7290c8c3cde0caf32575781db73af8d766
tree296023c7e837c5cfecc4f0ee935232161e9472ae
parent424dd731d8ff3cac79dfe90d9bcc47e166114df2
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>
arch/s390/mm/init.c
arch/s390/mm/vmem.c