Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1296514rwe; Thu, 1 Sep 2022 16:17:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR5LaaN4rJXLYVa4e7oWerMsReQteSllxnPQx/CvhTaJa1VpBUWfTDO0Sx+40x5pxzQ8SrO1 X-Received: by 2002:a17:907:1ca9:b0:741:4f9a:5984 with SMTP id nb41-20020a1709071ca900b007414f9a5984mr18104620ejc.86.1662074271880; Thu, 01 Sep 2022 16:17:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662074271; cv=none; d=google.com; s=arc-20160816; b=X+6xm5/QTUdHeOVS+DLRb6W+Cx70oHgmd/q5u+wIynesOtSf/BtuiCcTs7qKM3xa2f 4YzBnaQ4Tr7wm9cU5m9autvGe1X4uqNRitKceJfY0uv4XiJboelw7lGzTvVrT5WFsy5z 4rgOj4JM3GGwV3suOX4NhvzsJI+ZRYZ/bP9xNOV230H2tCO3hGlQ8AUrf7J+1CmRWyFf YcT/hOKBpqxnARxMqQQOKgJFomYfD1nM8Kg4UMCaNth7GMYAnoUCVGqv8Nk1llFNGELa SpHjNF1HUjl4EAPzWcVnduYu0Z77lWLqQQNaQSUIK+SiZWH5LYI/GP6WpLENac6WbyIw bHmw== 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 :message-id:date:subject:cc:to:from; bh=1Kw6Df3ti1qziV5144CgJhfXFX3StI3fyd/oVMHS0r8=; b=iEgVi0qQnjRvSSR8xN/n6o8HGHxd29ltf273+DYHmbMV2iTJBq4MSf/5ey33uCQFAJ MjICdbnlvMy0tHqlkGRm4DZbueV1K5Ss6DXY1wGZPuGriq+EqzKPEt1yudss7SZaBUuK 0kRxzu4CCk4sKOa/EslB3nUTlvaIHAZqjIkp0KzoypZPjAgBEQs9Fi8eUbf0m/0wINdc uPgY4PPsGbUacafsaKeLgveA0+HWCObDtvIALCd0Q0bwXC4VRrWmwNcZlvyTphJkyRVq oDdVmHp0szHNxNEajRLYm/PL92wJT+2vRgNK+WKE1bIprn8sfPORAGhT8yI7qIBxOyKT RZng== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z4-20020a170906434400b007315a1b0f97si275259ejm.856.2022.09.01.16.17.25; Thu, 01 Sep 2022 16:17:51 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235404AbiIAWai (ORCPT + 99 others); Thu, 1 Sep 2022 18:30:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235050AbiIAW3p (ORCPT ); Thu, 1 Sep 2022 18:29:45 -0400 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80AAF3C8F3 for ; Thu, 1 Sep 2022 15:28:28 -0700 (PDT) Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oTsfV-0007wk-PN; Fri, 02 Sep 2022 00:28:13 +0200 From: Heiko Stuebner To: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu Cc: conor.dooley@microchip.com, guoren@kernel.org, apatel@ventanamicro.com, atishp@rivosinc.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Heiko Stuebner Subject: [PATCH 1/4] riscv: cleanup svpbmt cpufeature probing Date: Fri, 2 Sep 2022 00:27:41 +0200 Message-Id: <20220901222744.2210215-1-heiko@sntech.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_HELO_TEMPERROR 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 This can also do without the ifdef and use IS_ENABLED instead and for better readability, getting rid of that switch also seems waranted. Signed-off-by: Heiko Stuebner --- arch/riscv/kernel/cpufeature.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 553d755483ed..764ea220161f 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -253,16 +253,13 @@ void __init riscv_fill_hwcap(void) #ifdef CONFIG_RISCV_ALTERNATIVE static bool __init_or_module cpufeature_probe_svpbmt(unsigned int stage) { -#ifdef CONFIG_RISCV_ISA_SVPBMT - switch (stage) { - case RISCV_ALTERNATIVES_EARLY_BOOT: + if (!IS_ENABLED(CONFIG_RISCV_ISA_SVPBMT)) return false; - default: - return riscv_isa_extension_available(NULL, SVPBMT); - } -#endif - return false; + if (stage == RISCV_ALTERNATIVES_EARLY_BOOT) + return false; + + return riscv_isa_extension_available(NULL, SVPBMT); } static bool __init_or_module cpufeature_probe_zicbom(unsigned int stage) -- 2.35.1