Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1143808iog; Sat, 18 Jun 2022 01:48:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vkkSdK+WorZud8IC8k4D7s75f1xbwEYrRKadbuc9+BOFBMxFHrxSAIMPIJGjbEqWjsm8At X-Received: by 2002:aa7:c952:0:b0:434:edcc:f247 with SMTP id h18-20020aa7c952000000b00434edccf247mr16966183edt.412.1655542107918; Sat, 18 Jun 2022 01:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655542107; cv=none; d=google.com; s=arc-20160816; b=fExnMYrfHbR40ykGv4vcWZQg9jVDuG1XqOyUBWXH4oyd5Mz05A2z62b6ZARPzggaMQ i8dLhW2ygNOzL0i0F0y+t+K0Era/KDGKL0oIgeUfNukj+ie4+nD79ntAjD5XcysANzrg OrdQsBuEeWqyMvlwPn1U1a+9/QMy6I5qZ/upyxOjshsmx5xzBCxv7GxxN2MlUYA66vTq NxOBmL7R0yv6ppa+sq4L+12LHmEVDf2NLIe2F8VbVEGfO1bygBSFVs8hC3n89sdax/EN y3E5BuJzxbWjmtvxc/jg89UFAV52VecKij6fnOFnrffYa8TEWNNGlv2+s7WsoR+WoZoV YTRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=vEqIo1AdMgtIO8iq5DvzLjXq/OfoD4oKTTt0J78j37o=; b=RpridOSHC5m6Tf90Q/pdZvJqYwlCCAkf2LcmGJsnhHIbn+j3iQeKLpAcxqJZyDmfSf +9Km6M3jPOeEsvF3svRJlzJiryEaMpEJf3TRvhOuYWhvqOGVxi3qJ10Anq638tuVtCU3 39g6PfXia5RYt5eQjqcgw44JpOnsj23Rw5FQCro2hAKe6hVNlMt2K+CfKCwITlZQfJiy bh4y0HADiBbXhzeK20JL+OwBqdwiCvMmLHV0+7DQe4LiAoBwUCl6M9SCN6vcUCvD5jKg WLcpYxDBl2yUw61zpPTi1j/NMrODFpY1miJXtOEBtG1qKm1puPwL69AlyEZXH9El5a56 dB5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f13-20020a170906824d00b007048c0e873esi5851600ejx.172.2022.06.18.01.48.01; Sat, 18 Jun 2022 01:48:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231877AbiFRIjQ (ORCPT + 99 others); Sat, 18 Jun 2022 04:39:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231130AbiFRIjP (ORCPT ); Sat, 18 Jun 2022 04:39:15 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3174522522 for ; Sat, 18 Jun 2022 01:39:14 -0700 (PDT) Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dx398wj61iX35KAA--.15929S2; Sat, 18 Jun 2022 16:39:12 +0800 (CST) From: Tiezhu Yang To: Huacai Chen , WANG Xuerui Cc: Xuefeng Li , linux-kernel@vger.kernel.org Subject: [PATCH] LoongArch: Make compute_return_era() return void Date: Sat, 18 Jun 2022 16:39:11 +0800 Message-Id: <1655541551-3997-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: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UUI43ZEXa7VUjxR65UUUU U== X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org compute_return_era() always returns 0, make it return void, and then no need to check its return value for its callers. Signed-off-by: Tiezhu Yang --- arch/loongarch/include/asm/branch.h | 3 +-- arch/loongarch/kernel/traps.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/loongarch/include/asm/branch.h b/arch/loongarch/include/asm/branch.h index 3f33c89..9a133e4 100644 --- a/arch/loongarch/include/asm/branch.h +++ b/arch/loongarch/include/asm/branch.h @@ -12,10 +12,9 @@ static inline unsigned long exception_era(struct pt_regs *regs) return regs->csr_era; } -static inline int compute_return_era(struct pt_regs *regs) +static inline void compute_return_era(struct pt_regs *regs) { regs->csr_era += 4; - return 0; } #endif /* _ASM_BRANCH_H */ diff --git a/arch/loongarch/kernel/traps.c b/arch/loongarch/kernel/traps.c index e4060f8..1bf58c6 100644 --- a/arch/loongarch/kernel/traps.c +++ b/arch/loongarch/kernel/traps.c @@ -475,8 +475,7 @@ asmlinkage void noinstr do_ri(struct pt_regs *regs) die_if_kernel("Reserved instruction in kernel code", regs); - if (unlikely(compute_return_era(regs) < 0)) - goto out; + compute_return_era(regs); if (unlikely(get_user(opcode, era) < 0)) { status = SIGSEGV; -- 2.1.0