From patchwork Tue Jul 5 14:23:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Perret X-Patchwork-Id: 12906633 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1ACD5C43334 for ; Tue, 5 Jul 2022 14:24:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Mime-Version: Message-Id:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=4I5VZxshQOvpgLnmV3InsX+BW6+sDgiyaNbNbvgSj90=; b=vLi UnTb5HvNt9vG2JtreYf0jOo62N7gUFWYrJoELb5PK437oBhdZOzx7Qwsith9xhMCWN5V6uJ2Ks+ZN 5Gzx8df9Aki1+X7IDu+/TfJ4jmDZh9vC5oJWvJpsR2WI8dqLyFuF+wP1t4AKFNnwlCckZMcHPCl2U oXjxwMVVq3SDwfvribUDEZDEl9KmIW11m5W5z7oSMEuEieRaAugpSOy5mgUwUwrrf+UEOCNI2WSZC 1Ktmy8QxGVylkUyiEfJSVp9ueKh8MB/MuGMAqkViKuxfTxze2n8wy2IanB9AAaiVRx6L/ZCIrDdAG iFMhJbTG2sZfVCPMYersO2i92UUy9mw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8jSc-000myE-OK; Tue, 05 Jul 2022 14:23:30 +0000 Received: from mail-ed1-x54a.google.com ([2a00:1450:4864:20::54a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8jSY-000mx0-SH for linux-arm-kernel@lists.infradead.org; Tue, 05 Jul 2022 14:23:28 +0000 Received: by mail-ed1-x54a.google.com with SMTP id z13-20020a056402274d00b004357fcdd51fso9409807edd.17 for ; Tue, 05 Jul 2022 07:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=2zQlYc9U3hxiIn86A5QE2kEqLA+X+YH+JZD8cteagW8=; b=fqCtfyiWnz/sDbhBL26vUNigBrQZ7zc1r3SbimUnoBkTZIKAL796jt+N0l7Ug0wnn+ 75Cal62Cu7Fahm0ZR6w8DSiM6GATiDJdvNIUqzFzHnrMR78YCmguqNM6frxwfTRTggqK sOFFIN06fK9vVqaLxRvQB9VGFNhHVu7o5octaE1JxZu4S2GtzqeaFhfSyul1iRTL5MG8 MCbDUtMAqnfI9JBgZFh2FWoQ1tnV/HCzi1nrsw/5xcM4Hyq9wsjtUBZVYlXWrzHhos98 FHC99aEQ8ZprYBhSGhJGV6WuD9HIzFbbIx+2xsPs8lgThNEgd35vSvR0UwfkaTd0+bxq 9sYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=2zQlYc9U3hxiIn86A5QE2kEqLA+X+YH+JZD8cteagW8=; b=x+pPYHhpuahC/s320splmUQzavyB+MihO+HYpCUPD57VyGZWW5SSXuUpNwiJelqkpU b5TQXVxOsrA+/+Ef44T4KaL80UHzf2DA4s3RqF8QG1/obyvLytHD3olXyZWXe7koC55L b+BjUfZgOtDEfVTTGfYtbQunwCSHbc637SNRwarZ3ib4ZYBEtYkLTML3sqSR30XgFj6W AR4A/00j0M1CM3qlLL75Ua20g4OCEgjuilMEmlouKnBEXEGpKya6hEffB/Gk5mKpOLvK 3CsK9+gSK88hy6Tf/T8lXA93leQpcCt0CUlOHZODCWotRwGqtF/yHHGUtEuAszME8VeW UWGg== X-Gm-Message-State: AJIora8kitOonsFSdzXTT9SOQ7nHmO/1Ra60ZAqNCVBqMDS8puHjTtw+ iP8pjOEIq7ZbI98TfxMD4+XevS/4gC4v X-Google-Smtp-Source: AGRyM1tNS+g/vNh5/iHJY0oJdpY+ypTBmtMZDDMx1nXevSQ85XuXevbZFlKhTyDeX1hSIW57PP5R15KNfRy1 X-Received: from big-boi.c.googlers.com ([fda3:e722:ac3:cc00:31:98fb:c0a8:129]) (user=qperret job=sendgmr) by 2002:a17:906:7790:b0:722:e6cf:126 with SMTP id s16-20020a170906779000b00722e6cf0126mr33544579ejm.244.1657031003645; Tue, 05 Jul 2022 07:23:23 -0700 (PDT) Date: Tue, 5 Jul 2022 14:23:10 +0000 Message-Id: <20220705142310.3847918-1-qperret@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.37.0.rc0.161.g10f37bed90-goog Subject: [PATCH] KVM: arm64: Don't return from void function From: Quentin Perret To: Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Cc: kernel-team@android.com, qperret@google.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220705_072326_995370_BDE474F9 X-CRM114-Status: GOOD ( 14.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Although harmless, the return statement in kvm_unexpected_el2_exception is rather confusing as the function itself has a void return type. The C standard is also pretty clear that "A return statement with an expression shall not appear in a function whose return type is void". Given that this return statement does not seem to add any actual value, let's not pointlessly violate the standard. Build-tested with GCC 10 and CLANG 13 for good measure, the disassembled code is identical with or without the return statement. Fixes: e9ee186bb735 ("KVM: arm64: Add kvm_extable for vaxorcism code") Signed-off-by: Quentin Perret --- arch/arm64/kvm/hyp/nvhe/switch.c | 2 +- arch/arm64/kvm/hyp/vhe/switch.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kvm/hyp/nvhe/switch.c b/arch/arm64/kvm/hyp/nvhe/switch.c index 6db801db8f27..925b34b7708d 100644 --- a/arch/arm64/kvm/hyp/nvhe/switch.c +++ b/arch/arm64/kvm/hyp/nvhe/switch.c @@ -386,5 +386,5 @@ asmlinkage void __noreturn hyp_panic_bad_stack(void) asmlinkage void kvm_unexpected_el2_exception(void) { - return __kvm_unexpected_el2_exception(); + __kvm_unexpected_el2_exception(); } diff --git a/arch/arm64/kvm/hyp/vhe/switch.c b/arch/arm64/kvm/hyp/vhe/switch.c index 969f20daf97a..390af1a6a9b4 100644 --- a/arch/arm64/kvm/hyp/vhe/switch.c +++ b/arch/arm64/kvm/hyp/vhe/switch.c @@ -249,5 +249,5 @@ void __noreturn hyp_panic(void) asmlinkage void kvm_unexpected_el2_exception(void) { - return __kvm_unexpected_el2_exception(); + __kvm_unexpected_el2_exception(); }