From patchwork Sat Aug 19 08:36:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 13358524 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B701AEE49A8 for ; Sat, 19 Aug 2023 08:36:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229483AbjHSIgc (ORCPT ); Sat, 19 Aug 2023 04:36:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230024AbjHSIgb (ORCPT ); Sat, 19 Aug 2023 04:36:31 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EABF07A8EB; Sat, 19 Aug 2023 01:36:27 -0700 (PDT) Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8Bxd+gJf+BkOhsaAA--.17569S3; Sat, 19 Aug 2023 16:36:25 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx_c4Hf+BkLDpeAA--.33957S3; Sat, 19 Aug 2023 16:36:25 +0800 (CST) From: Tiezhu Yang To: Thomas Bogendoerfer Cc: "Maciej W. Rozycki" , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn Subject: [PATCH v4 1/4] MIPS: Add BUG() at the end of nmi_exception_handler() Date: Sat, 19 Aug 2023 16:36:20 +0800 Message-Id: <1692434183-2054-2-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1692434183-2054-1-git-send-email-y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twCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1I6r4UMIIF0xvE 2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcV C2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2Kfnx nUUI43ZEXa7IU8uuWJUUUUU== Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org In the later patch, we will remove noreturn attribute for die(), in order to make each patch can be built without errors and warnings, just add a noreturn function BUG() at the end of nmi_exception_handler() to make sure it does not return, otherwise there exists the following build error after the later patch: arch/mips/kernel/traps.c:2001:1: error: 'noreturn' function does return [-Werror] Signed-off-by: Tiezhu Yang --- arch/mips/kernel/traps.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 246c6a6..b1b68ce 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -1998,6 +1998,7 @@ void __noreturn nmi_exception_handler(struct pt_regs *regs) regs->cp0_epc = read_c0_errorepc(); die(str, regs); nmi_exit(); + BUG(); } unsigned long ebase;