[v6,6/6] Fix 'cbaud_to_speed' defined but not used on LA32

Message ID 20260312014203.1916933-7-mengqinggang@loongson.cn (mailing list archive)
State Under Review
Delegated to: Adhemerval Zanella Netto
Headers
Series Add support for LoongArch32 |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
redhat-pt-bot/TryBot-32bit success Build for i686
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Test passed

Commit Message

mengqinggang March 12, 2026, 1:42 a.m. UTC
  '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(-)
  

Patch

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)