From patchwork Thu Jul 13 12:11:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 119831 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1789734vqm; Thu, 13 Jul 2023 05:32:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlHkdbwqi4nBeuJZ9Q448OCXqogCxXVlB42nK6uHeG6WdKk5tnluZ16L/zdb3ZrsDI0PHEJT X-Received: by 2002:a17:906:df54:b0:971:eb29:a082 with SMTP id if20-20020a170906df5400b00971eb29a082mr1088081ejc.49.1689251563610; Thu, 13 Jul 2023 05:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689251563; cv=none; d=google.com; s=arc-20160816; b=OLNLDQN/xA8sFb8O/um0FQq+suYQhBXLSI8/r5BUd0+X8xgK+TZBhnGycqn8ae+RMW iTwHA2Feg+s0RlyxkG1qKVNZTVp1ZuHm5NepJavCivxjyHA9IpA2AFMUQ4IcZt5fk1WU Z6Q2wpp2h6DcKcklQSUkDoLhCb/47UCpQ9FjQS4fMQg8bzfPA5kwWfdAsj0mjL3zU4Ox pDTqckbem/n146gs3tVVJT19dGAJRWyzeQUIqLJ/ZdNUBftU5lSX3bOb+brWg4KWutK5 uS6unrbvTJBrwwURKV8CYg2XwXNE3pSYDQBGoq4b4+qLMGIoScpEeROo0VGmVqNG15df Vzmw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vC1BnLacuWIn4JP44zo+QlFO9OWCrIZRrezYlKwlTx8=; fh=+t+G/OXZaGbelVlx/PAQKy/ssq96RZ9Njlv0n65gx60=; b=fVTtflSkBEWja3KajMSn4CUbfjyV+a8FNjWkXpULY9i638lPOVCPVGRMMoQHdctSBa LmmHz0NKd6DuVpf+ZqkEOEuo7xcWQNJtHvJ6ERyum3VvU4yhkVoCiU03Mn3dBpN1aanT 9Xp36hra2Fdt3c1zWcAJXZ8beXNJszS6O3C0ux5oZt9NsVvu7w99qmrqiUEVHu0oCHcf pd42AigMf8n5Xld0SzFeljlTsnaUFzNkoLTW28nimP4165ulWSpCsUXGPusF+h7arHpK X8Aa7Bnzcf/z29YHphKY+N0s2DRq1QHihIlHyUJPhPwX/e9nAp598qEqzn6mCwE8axSB hBBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=tJRpUm64; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xo6-20020a170907bb8600b009889ae99c40si6972054ejc.611.2023.07.13.05.32.18; Thu, 13 Jul 2023 05:32:43 -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=@microchip.com header.s=mchp header.b=tJRpUm64; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234553AbjGMMMr (ORCPT + 99 others); Thu, 13 Jul 2023 08:12:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234544AbjGMMMk (ORCPT ); Thu, 13 Jul 2023 08:12:40 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A3E926B8; Thu, 13 Jul 2023 05:12:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1689250359; x=1720786359; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1i34KSawlUL8WNjNkmTiVglWiYjIqUpNKEWr7RWMan4=; b=tJRpUm644RjT8ajQUgOA7tn35xOLCi3JHWrUQ7fsOecP9bu4S8Xc3jw+ NaX/hcsUNPHsrpBoJ9ngjD0IpweeHEtO5pErFidMU69bMXWVXPzdFMo1i 7LP0xxHCBmEXO0PD7wZcczpertKfJ9jH7edJsT4dP0n7zpCWFIVvnu1qm rtPVKFt/bcajtS2n6DGbWnPt4StyWIh/HQepgvr2DR7yv/nLb9cC0rmQs QjyIBP6BHYMD3cLGbxI4FQ+jMyBGGohFld1dMNF+SWHFcz6qwRYyr5Blz fxyrkm1x0X8f92FNyoVdHwN01mLFRjNOO5+Hx4BT8DkYiSGi2/kBeiEiL A==; X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; d="scan'208";a="222827139" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 13 Jul 2023 05:12:39 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 13 Jul 2023 05:12:38 -0700 Received: from wendy.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Thu, 13 Jul 2023 05:12:36 -0700 From: Conor Dooley To: CC: , , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Albert Ou , "Jonathan Corbet" , Andrew Jones , "Heiko Stuebner" , Evan Green , Sunil V L , , , , Subject: [PATCH v5 03/11] RISC-V: drop a needless check in print_isa_ext() Date: Thu, 13 Jul 2023 13:11:01 +0100 Message-ID: <20230713-veggie-mug-3d3bf6787ae2@wendy> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230713-target-much-8ac624e90df8@wendy> References: <20230713-target-much-8ac624e90df8@wendy> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1275; i=conor.dooley@microchip.com; h=from:subject:message-id; bh=1i34KSawlUL8WNjNkmTiVglWiYjIqUpNKEWr7RWMan4=; b=owGbwMvMwCFWscWwfUFT0iXG02pJDCnrX15dnT3zoNehbztPtS703Cn0evqXSf3LJDnnbIvR88xU NBKN7ihlYRDjYJAVU2RJvN3XIrX+j8sO5563MHNYmUCGMHBxCsBEYk8yMmy41VY7X+Pdp5ctjsmT7j aHfhK+t10mrNpt/vK/GazS9wIY/tm2HFI/t7Zy87PdG0V3eT1fuvLXR8643YfK3/C5tm6fcIYHAA== X-Developer-Key: i=conor.dooley@microchip.com; a=openpgp; fpr=F9ECA03CF54F12CD01F1655722E2C55B37CF380C X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771308647667718502 X-GMAIL-MSGID: 1771308647667718502 isa_ext_arr cannot be empty, as some of the extensions within it are always built into the kernel. When this code was first added, back in commit a9b202606c69 ("RISC-V: Improve /proc/cpuinfo output for ISA extensions"), the array was empty and needed a dummy item & thus there could be no extensions present. When the first multi-letter ones did get added, it was Sscofpmf - which didn't have a Kconfig symbol to disable it. Remove this check, as it has been redundant since Sscofpmf was added. Reviewed-by: Andrew Jones Signed-off-by: Conor Dooley --- Changes in v2: - Reword commit message to explain why this can be dropped --- arch/riscv/kernel/cpu.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index f808b67f5a27..e721f15fdf17 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -237,10 +237,6 @@ static void print_isa_ext(struct seq_file *f) arr_sz = ARRAY_SIZE(isa_ext_arr) - 1; - /* No extension support available */ - if (arr_sz <= 0) - return; - for (i = 0; i <= arr_sz; i++) { edata = &isa_ext_arr[i]; if (!__riscv_isa_extension_available(NULL, edata->isa_ext_id))