s390/mm,fault: replace WARN_ON_ONCE() with unreachable()
authorHeiko Carstens <hca@linux.ibm.com>
Thu, 12 Oct 2023 07:40:39 +0000 (09:40 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Mon, 23 Oct 2023 16:21:22 +0000 (18:21 +0200)
do_secure_storage_access() contains a switch statements which handles
all possible return values from get_fault_type(). Therefore remove the
pointless default case error handling and replace it with unreachable().

Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/mm/fault.c

index 4ab698988618e46023ce3fa5faf5d9d5760e4195..dd1dca10bd6b0faa390c23220f1847ed9eb8103e 100644 (file)
@@ -618,8 +618,7 @@ void do_secure_storage_access(struct pt_regs *regs)
                        BUG();
                break;
        default:
-               do_fault_error(regs, VM_FAULT_BADMAP);
-               WARN_ON_ONCE(1);
+               unreachable();
        }
 }
 NOKPROBE_SYMBOL(do_secure_storage_access);