]> git.dujemihanovic.xyz Git - linux.git/commitdiff
s390/irq: simplify on_async_stack()
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 5 Jul 2021 18:57:49 +0000 (20:57 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Thu, 8 Jul 2021 20:12:17 +0000 (22:12 +0200)
Make on_async_stack() a bit more readable, even though as usual it
depends if one considers "!!!" readable or not.
At least the new construct to check if the async stack is in use or
not is a bit shorter and generates slightly better code.

Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/irq.c

index b55af916fbd5bbabc3f3bcebd145c5c7e9e653f4..a1af5ecdabdf7f829f030a1ccfe8a3abde8bdd68 100644 (file)
@@ -110,7 +110,7 @@ static int on_async_stack(void)
 {
        unsigned long frame = current_frame_address();
 
-       return !!!((S390_lowcore.async_stack - frame) >> (PAGE_SHIFT + THREAD_SIZE_ORDER));
+       return ((S390_lowcore.async_stack ^ frame) & ~(THREAD_SIZE - 1)) == 0;
 }
 
 static void do_irq_async(struct pt_regs *regs, int irq)