parisc: Avoid calling faulthandler_disabled() twice
authorJohn David Anglin <dave.anglin@bell.net>
Wed, 22 Dec 2021 16:52:26 +0000 (16:52 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:04:55 +0000 (11:04 +0100)
commitb9d50e591133a139fb7e5cfeb53fea2b27e16e18
treee9ee9421632e3d64399f89cbf2bcc4a917fda0bc
parent4e2e5a033e93ec8805f2584e900a6bea4016ef5b
parisc: Avoid calling faulthandler_disabled() twice

[ Upstream commit 9e9d4b460f23bab61672eae397417d03917d116c ]

In handle_interruption(), we call faulthandler_disabled() to check whether the
fault handler is not disabled. If the fault handler is disabled, we immediately
call do_page_fault(). It then calls faulthandler_disabled(). If disabled,
do_page_fault() attempts to fixup the exception by jumping to no_context:

no_context:

        if (!user_mode(regs) && fixup_exception(regs)) {
                return;
        }

        parisc_terminate("Bad Address (null pointer deref?)", regs, code, address);

Apart from the error messages, the two blocks of code perform the same
function.

We can avoid two calls to faulthandler_disabled() by a simple revision
to the code in handle_interruption().

Note: I didn't try to fix the formatting of this code block.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/parisc/kernel/traps.c