From patchwork Thu Mar 12 01:42:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mengqinggang X-Patchwork-Id: 131559 X-Patchwork-Delegate: azanella@linux.vnet.ibm.com Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id DCD864BB58F8 for ; Thu, 12 Mar 2026 01:48:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DCD864BB58F8 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 791F14B920DF for ; Thu, 12 Mar 2026 01:46:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 791F14B920DF Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 791F14B920DF Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773280002; cv=none; b=qEb5cxvmPa0l1kxMU4UkzGwVwp9t0U0sqybOADc8g28ZBxhEJEGtRfWjpi1Q3ppm+jBEEpHfn7hwfkSEt0LXarm/9UfPoso2gjuOsTTzjSDt1aXpkzFyOeobNYLUgLATXG4htmT485wHS6SJOLN7cjpN9yDXcRMlmoM4Znr/PMI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773280002; c=relaxed/simple; bh=bCbiphhj8hrZpKc2WL7dePN04Z+jq9oJPxLpF6f7Nsk=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=mWCaUoIPgtXGoPoDPl+QjMPufrHjUr5M7KWjLX9IbBR4mhUIEwGckp46JNHj/LBR3KzVXAKM/6E2/uQvAxxZMVARJp8pz2CKsD22j4IK4bSxKZ0AX+TcV/HnfAU+DpKhwpUzViSFdPXrHJ7Pe6ENb8ZizYNHRuMRdzFVzo2DxKc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 791F14B920DF Received: from loongson.cn (unknown [10.2.6.7]) by gateway (Coremail) with SMTP id _____8BxEMD_GrJpKS4aAA--.17635S3; Thu, 12 Mar 2026 09:46:39 +0800 (CST) Received: from amd9754.. (unknown [10.2.6.7]) by front1 (Coremail) with SMTP id qMiowJCx98D8GrJpwIBTAA--.14089S2; Thu, 12 Mar 2026 09:46:36 +0800 (CST) From: mengqinggang To: libc-alpha@sourceware.org Cc: adhemerval.zanella@linaro.org, fweimer@redhat.com, xuchenghua@loongson.cn, caiyinyu@loongson.cn, chenglulu@loongson.cn, xry111@xry111.site, i.swmail@xen0n.name, maskray@google.com, luweining@loongson.cn, hejinyang@loongson.cn, mengqinggang@loongson.cn Subject: [PATCH v6 6/6] Fix 'cbaud_to_speed' defined but not used on LA32 Date: Thu, 12 Mar 2026 09:42:03 +0800 Message-Id: <20260312014203.1916933-7-mengqinggang@loongson.cn> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260312014203.1916933-1-mengqinggang@loongson.cn> References: <20260312014203.1916933-1-mengqinggang@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: qMiowJCx98D8GrJpwIBTAA--.14089S2 X-CM-SenderInfo: 5phqw15lqjwttqj6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org 'cbaud_to_speed' used if TEST_COMPAT (libc, GLIBC_2_0, GLIBC_2_42). Move cbaud_to_speed to #if TEST_COMPAT (libc, GLIBC_2_0, GLIBC_2_42) --- sysdeps/unix/sysv/linux/tst-termios-linux.c | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sysdeps/unix/sysv/linux/tst-termios-linux.c b/sysdeps/unix/sysv/linux/tst-termios-linux.c index 6495b435e8..d9c3284e1c 100644 --- a/sysdeps/unix/sysv/linux/tst-termios-linux.c +++ b/sysdeps/unix/sysv/linux/tst-termios-linux.c @@ -163,18 +163,6 @@ static speed_t speed_to_cbaud (speed_t speed) return ct->cbaud; } -/* Returns ANY if cbaud is __BOTHER, or BOGUS if invalid */ -static speed_t cbaud_to_speed (speed_t cbaud) -{ - const struct cbaud_table *ct; - for (ct = cbaud_table; ct->cbaud != BOGUS; ct++) - { - if (ct->cbaud == cbaud) - break; - } - return ct->speed; -} - static const char *cbaud_name (speed_t cbaud) { const struct cbaud_table *ct; @@ -514,6 +502,18 @@ old_tcspeed_test (int fd, speed_t speed) check_speeds_tc (fd, speed, speed); } +/* Returns ANY if cbaud is __BOTHER, or BOGUS if invalid */ +static speed_t cbaud_to_speed (speed_t cbaud) +{ + const struct cbaud_table *ct; + for (ct = cbaud_table; ct->cbaud != BOGUS; ct++) + { + if (ct->cbaud == cbaud) + break; + } + return ct->speed; +} + /* Verify that invalid CBAUD values return error for the old interfaces */ static void old_invalid_speeds_test (int fd)