Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3026357rwb; Mon, 15 Aug 2022 16:24:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR7TM7QHENwsSt5eSQSPLLqSE4i5xvbqsEc/WvHCeto8T1XwhBX5UVwFx7qYIzvzPA5lt9EU X-Received: by 2002:a17:902:e84d:b0:16d:c9a0:e502 with SMTP id t13-20020a170902e84d00b0016dc9a0e502mr19223138plg.125.1660605866563; Mon, 15 Aug 2022 16:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605866; cv=none; d=google.com; s=arc-20160816; b=0ohf/xWpPTiQOn/g5CvDnKoLQj/WghWJY0fmtX5XLqdEffmFMjUOW/SzWq07Zm2KAX iusJS9DTCmTgD/lQIwHBoVCV8HL1eaaj9S0k/NfnligmluDAy/XdY6ttgHE72HMZw0JL UHvSsrlMTlk06nB0KxppnwYQ7L65vqXH7aAeaCYoJqxCKXXBodKZVcxGs+41LixIrYzd O3r+8zpxDyRg9YXpC4UqdLsgPe1SIIV94RZcrvCiRkSeBzmvXyv5f6yQwo5gnZMoUb1H 68z8/mRgbQtT5E2n7UO4b5PpzFtVsVnNIfp3nzR1LakAtiL3Ol3bIWXhXeV6DrHDnXSx vNeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2fziiKD8B8GE9WXtYVtCNIvOE9QCev7vDf/vyG51aNU=; b=SIWelZOZZv3ZT2N9blxoZwEmXOaMsACXIDGMTJopNGff2+A2Jl9LabHxl8q01QN3b0 aWZSEjviO+eeut+Dki2zyJfM1xLlBZME1vu0x321Up2AoP+pgGeFNn1QBrIy749rEeTB q1KVTRUlGHneGxOZ/ysdt6KPNX5qd+LsyK6/PZxGn20m76rWelQc+qLLptSD2GFJQ1gH fDyv33zhbq+U44P5VGogw+ZIZpt6j7fFsaTfONFhPBtiw5uH7vSyG+engIrniC/OUqDs Ds8g3BSXynV962L83oOxq6u6ykoXE9Y2W28xaQpj4i/QgH54EkRbW/dIRkFFw8gURR8V 0Kdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="KcHUZ/au"; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020a632a07000000b004223f3d5005si10886711pgq.120.2022.08.15.16.24.15; Mon, 15 Aug 2022 16:24:26 -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=@linuxfoundation.org header.s=korg header.b="KcHUZ/au"; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346778AbiHOWHr (ORCPT + 99 others); Mon, 15 Aug 2022 18:07:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350400AbiHOWCF (ORCPT ); Mon, 15 Aug 2022 18:02:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E647610FE7; Mon, 15 Aug 2022 12:36:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8EF2BB80EA9; Mon, 15 Aug 2022 19:36:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DED6C433D7; Mon, 15 Aug 2022 19:36:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660592187; bh=I0wyDQbLG/JuU5JwqWrzDV7Xw9+rd6SjzThjPNzvkho=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KcHUZ/aujdRlk4Qq+LrkxeIMiXFglv0MTTnKsVc9kEHK8zDlzOThzwU5VCmsRQYRp bNsvRby1yteKEWM/l3YVkA5dg3nbEnzO2R7xEjLTwh8oS3faXcRSJOsSecTsca2INH W3BEj23mB5hrt+tmwVIWcGkwa/9a3NZVyqT/VKf8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Quentin Perret , Marc Zyngier , Sasha Levin Subject: [PATCH 5.18 0729/1095] KVM: arm64: Dont return from void function Date: Mon, 15 Aug 2022 20:02:08 +0200 Message-Id: <20220815180459.542749604@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 From: Quentin Perret [ Upstream commit 1c3ace2b8b3995d3213c5e2d2aca01a0577a3b0f ] 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 Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220705142310.3847918-1-qperret@google.com Signed-off-by: Sasha Levin --- 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 6410d21d8695..858e5be48791 100644 --- a/arch/arm64/kvm/hyp/nvhe/switch.c +++ b/arch/arm64/kvm/hyp/nvhe/switch.c @@ -371,5 +371,5 @@ void __noreturn hyp_panic(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 262dfe03134d..51ea9ac71210 100644 --- a/arch/arm64/kvm/hyp/vhe/switch.c +++ b/arch/arm64/kvm/hyp/vhe/switch.c @@ -240,5 +240,5 @@ void __noreturn hyp_panic(void) asmlinkage void kvm_unexpected_el2_exception(void) { - return __kvm_unexpected_el2_exception(); + __kvm_unexpected_el2_exception(); } -- 2.35.1