From patchwork Thu Jun 29 08:28:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 114235 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9483965vqr; Thu, 29 Jun 2023 01:34:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlHoJYtLeSOieh/Orbtwv5h27MQ+3q4nAbYjsO4y0LAHSOMvTkkZk+rWgRtezSKBkWf4k1qH X-Received: by 2002:a17:903:558:b0:1b3:ec39:f42c with SMTP id jo24-20020a170903055800b001b3ec39f42cmr1784463plb.5.1688027655025; Thu, 29 Jun 2023 01:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688027655; cv=none; d=google.com; s=arc-20160816; b=bTZSAfrzRUpYU7x4BLy6UQFXoASBzSzHyhQkYPplmQWnfhqmO6Rl3q1ONVo9sbM/S0 psJ4c7fsbgnhalc8agPNvVo5O4Y8yqiA73R7N0SH0dRVo4PRyMR34m06Xzf+3p6ND0j0 wTXOqCCqk9froEspUASFA9IPrHdHkdBTcfQimDDzBVwY1Osdxh3BpAe51u+u/adfqg/P T7vdSqzmUg5uhzdSeO6ik6NxMHjPBX9Ip0Eplv9U3+nbQW3748D4xBL+nJkHDJH/GaeF hUA3ayDU3CGsfSfryAakRnOTELfgVP6MaDcTmRpyR6/jdhmp7P25yoDwzQ9lqOfhLi4+ 2P+g== 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=KeSlBRaKzkxfoPFYViH5WmnMdvhDFBjlAHvC3FGoccQ=; fh=id5NoWTfrmVnmm2w/Ed5X4erHGUuViLdGWw+WL1NNbc=; b=L4jJvj4E+Uavm/OjqXM97fjhXtNYzOYZmIPV5YxGaPbe90sJ9et8dExkLmm19fmI4N +gHsuLpssKF0u5+IK+jXXbtTAWxWxCzn1vAg+x6Ff5ZqCaipNfbTo1xrL/E9FIKkU+nv Ej5DmLPvdJVY6P7Tohb6+56PndY07QyS2DbRRAX/1SkyJxazAzKZDDss5WI1YWNn0tA6 R6ihVRGQpq5+x6mfwLSdVnN/BdRzIVMqIz9jQPf4v3stIPKfaPP53eIgrquZIp1PhSVT ei+MBmuELHIIpRVW0fq7svLMfupiloGSHVWYJT/zT7TasJ86pBvTF+6vp8vi90wv/8Br QYcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=HdRXstia; 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 j20-20020a170902f25400b001b8275650acsi3682697plc.21.2023.06.29.01.34.00; Thu, 29 Jun 2023 01:34:15 -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=HdRXstia; 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 S232516AbjF2IbJ (ORCPT + 99 others); Thu, 29 Jun 2023 04:31:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232609AbjF2IaL (ORCPT ); Thu, 29 Jun 2023 04:30:11 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A9691FE7; Thu, 29 Jun 2023 01:29:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1688027399; x=1719563399; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6yGCLTHTWBR9QgFp49drRvDK9QX9Ej+dLrWhdW/gWbA=; b=HdRXstiauOVZ1CUU/qqDeLkEziVSE5CsUt/Amek2Eo4VFBtOjKTZcuc3 W/RmEzuh7F7oOfpJDcFN1A8fGhtgKUGWY8/NDpQMnHwWrZlyH9oykzK06 1oWCOlFB+O9U3s+0GXNbwlU31S3sG/a3A333qA9TNI43mF/38XJBDCeEN O7UO0Bqjgplpa1ejcuHw5Yf7+VPebZxjz2uW/3LgStyP3Iwt8pLWf7kzD 2cdFoRqlFtccSN/h6OV0pL0L0PigXFZaUeytQgMspKRoPkJhN7Q5gSdY0 ehYBI97t440zB596NUj8eIs7E1chkZmiYKpteQ0DUCzSXH1hp7ZathdGm g==; X-IronPort-AV: E=Sophos;i="6.01,168,1684825200"; d="scan'208";a="218155941" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 29 Jun 2023 01:29:58 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 29 Jun 2023 01:29:53 -0700 Received: from wendy.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Thu, 29 Jun 2023 01:29:50 -0700 From: Conor Dooley To: CC: , , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Albert Ou , Andrew Jones , Heiko Stuebner , "Evan Green" , Sunil V L , , , Subject: [PATCH v2 02/10] RISC-V: drop a needless check in print_isa_ext() Date: Thu, 29 Jun 2023 09:28:48 +0100 Message-ID: <20230629-tightly-filtrate-a0b8656035b6@wendy> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230629-rebuttal-vagueness-a699deb7c7b3@wendy> References: <20230629-rebuttal-vagueness-a699deb7c7b3@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=6yGCLTHTWBR9QgFp49drRvDK9QX9Ej+dLrWhdW/gWbA=; b=owGbwMvMwCFWscWwfUFT0iXG02pJDClzHQ7O/5jZKX5wYerZcy4XN1QdYwg7sGWDftNq5dLY9NAA EZn4jlIWBjEOBlkxRZbE230tUuv/uOxw7nkLM4eVCWQIAxenAExkzmxGhgOJoZGnTaWeGas0vN1o9v SYa3bTDhtfo/SrnC1zfaYmczP8lY9LiLpzerPj2fzdbFM01+z9fsvW0VOhOWRGysxDUt69nAA= 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, 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770025286401935557?= X-GMAIL-MSGID: =?utf-8?q?1770025286401935557?= 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 2fb5e8e1df52..ddd7634e4c1d 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -233,10 +233,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))