Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1332711imw; Tue, 5 Jul 2022 07:42:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v1U9YSlAqoFDLem0frBVyPI7oZpcS3AoMF2gncjp59cMraflzn8uDypxKLRknsJ8oK74Ir X-Received: by 2002:a50:eb45:0:b0:437:7686:6048 with SMTP id z5-20020a50eb45000000b0043776866048mr48626390edp.264.1657032169436; Tue, 05 Jul 2022 07:42:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657032169; cv=none; d=google.com; s=arc-20160816; b=Hzz23Peu2/zOavCs6mT8R/P8M70GSi1y3nsCbK1PLPkSdHXInjpXjf+Fg8m3/MX/I8 cjjQKzsurQoWFf6eXK+Ec9g9seTNJMI1s8Yxiy0D35IM+LsONpEibD0kS32cr0NBGVrv 3si9/agZKb8PGxXCOoAdqc0PN8JXe2h+zVYVn4LO7QSm0Ju0Ibl+S7IFYaI0VTE/vMMA kUozcnSZ/FWVh0r/iXbEXW2HMd0Tx8paHWr46WZThOIb0T7BKHdOsHwv0p+S++1pP2Dd PWWcTU1DWQPnPAxNfJBfg97M91MjdcKxdOjIlGDHqBDeVsDI2nQg5Y0JTLT0t6/7lnVc cOWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=2zQlYc9U3hxiIn86A5QE2kEqLA+X+YH+JZD8cteagW8=; b=izWo0oqP+xbCFeNMHWC/xfhcfwZNrsbL6eUBeJP2AG1A0DZNYtOPmWowOlDpd6BIZO /Qydj1XTF+g2hMqAC97RaM1tkR0PTglFmYjTRTu7yI984aYklDUsr96/RcqxuJY4tXUJ 01KQlAMzqKHGB8lmwj11E9Yc1V7lU4fyrW9diFh3Q6ztaGKu5b7ZTuXgGRhJ6CZJt6FO lnByeZEvLiG9oq3qLZcxe4POJIpnq2t4vN2/ZgSinC2YqvxxVOTvikvYcbPzlMI6VrCd +bTjbPp9HzT/9CFXSoZvLBcILs4mibqRzKavDUtjZLm+WxiLn39si2Rwtc86wAEXY1zw Fl2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=fqCtfyiW; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cr11-20020a170906d54b00b0072a9a683407si15075123ejc.118.2022.07.05.07.42.24; Tue, 05 Jul 2022 07:42:49 -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; dkim=pass header.i=@google.com header.s=20210112 header.b=fqCtfyiW; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232468AbiGEOXg (ORCPT + 99 others); Tue, 5 Jul 2022 10:23:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232954AbiGEOX1 (ORCPT ); Tue, 5 Jul 2022 10:23:27 -0400 Received: from mail-ed1-x549.google.com (mail-ed1-x549.google.com [IPv6:2a00:1450:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 396ADD42 for ; Tue, 5 Jul 2022 07:23:25 -0700 (PDT) Received: by mail-ed1-x549.google.com with SMTP id f13-20020a0564021e8d00b00437a2acb543so9403129edf.7 for ; Tue, 05 Jul 2022 07:23:25 -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=E6BCoaC6sHnC9ajaQXwbL3yEIYxeOh1cVSb/zvIa1LKi52tpm+wkjDuo0m1USqIF24 6seedXTT3mPB1tT7juyx0ctHGAblew+aVskhtwnLQNsHFz/AuZzLSkDT4gZhN0aThSVM mAK8u5Ej+idg9oJ8ynJUPqZyywCwSY3iS7CzCji0EJyc12kRWPpB6PJDiTC3jmBrm6X6 eHYrdZa+qy3XHQ2bKRVrm2QfBwBcdwVZKBLaQEHk4Mdcs4FE7WaWk+pWlPJap12j7lBx ZXK62N3rYhMuRu3aCnONGBMmWGh3928tayFMcwA0aughJyKZGdFah1KocCkl0sugI63P NzMA== X-Gm-Message-State: AJIora9TWpvxj3CfizmEKAoKz+4HZd2yuiAH8hM0CUPnh2o+uVXKIig2 JiRO9TomNmqufX4gHbVSBPIwyzUlfCw9 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL 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 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(); } -- 2.37.0.rc0.161.g10f37bed90-goog