From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id 902B73857829 for ; Wed, 23 Feb 2022 01:47:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 902B73857829 From: Tsukasa OI To: Tsukasa OI Cc: binutils@sourceware.org Subject: [PATCH 1/3] RISC-V: Remove a loop in the ISA parser Date: Wed, 23 Feb 2022 10:47:22 +0900 Message-Id: In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TO_EQ_FM_DIRECT_MX, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Feb 2022 01:47:46 -0000 Since commit e601909a3287bf541c6a7d82214bb387d2c76d82 ("RISC-V: Support to parse the multi-letter prefix in the architecture string.") changed so that all prefixed extensions are parsed in single riscv_parse_prefixed_ext call, a "while" loop on riscv_parse_subset is no longer required. bfd/ChangeLog: * elfxx-riscv.c (riscv_parse_subset): Remove unnecessary loop. --- bfd/elfxx-riscv.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c index 27d06d2fa3d..329dcaed304 100644 --- a/bfd/elfxx-riscv.c +++ b/bfd/elfxx-riscv.c @@ -2019,14 +2019,11 @@ riscv_parse_subset (riscv_parse_subset_t *rps, if (p == NULL) return false; - /* Parse the different classes of extensions in the specified order. */ - while (*p != '\0') - { - p = riscv_parse_prefixed_ext (rps, arch, p); + /* Parse prefixed extensions. */ + p = riscv_parse_prefixed_ext (rps, arch, p); - if (p == NULL) - return false; - } + if (p == NULL) + return false; /* Finally add implicit extensions according to the current extensions. */ -- 2.32.0