about summary refs log tree commit diff
path: root/library/std_detect/src/detect/os/linux
diff options
context:
space:
mode:
Diffstat (limited to 'library/std_detect/src/detect/os/linux')
-rw-r--r--library/std_detect/src/detect/os/linux/aarch64.rs10
-rw-r--r--library/std_detect/src/detect/os/linux/loongarch.rs15
-rw-r--r--library/std_detect/src/detect/os/linux/riscv.rs11
3 files changed, 7 insertions, 29 deletions
diff --git a/library/std_detect/src/detect/os/linux/aarch64.rs b/library/std_detect/src/detect/os/linux/aarch64.rs
index 22a9cefff7b..0de4beeae8b 100644
--- a/library/std_detect/src/detect/os/linux/aarch64.rs
+++ b/library/std_detect/src/detect/os/linux/aarch64.rs
@@ -343,14 +343,8 @@ impl AtHwcap {
             enable_feature(Feature::sve2, sve2);
             enable_feature(Feature::sve2p1, self.sve2p1 && sve2);
             // SVE2 extensions require SVE2 and crypto features
-            enable_feature(
-                Feature::sve2_aes,
-                self.sveaes && self.svepmull && sve2 && self.aes,
-            );
-            enable_feature(
-                Feature::sve2_sm4,
-                self.svesm4 && sve2 && self.sm3 && self.sm4,
-            );
+            enable_feature(Feature::sve2_aes, self.sveaes && self.svepmull && sve2 && self.aes);
+            enable_feature(Feature::sve2_sm4, self.svesm4 && sve2 && self.sm3 && self.sm4);
             enable_feature(
                 Feature::sve2_sha3,
                 self.svesha3 && sve2 && self.sha512 && self.sha3 && self.sha1 && self.sha2,
diff --git a/library/std_detect/src/detect/os/linux/loongarch.rs b/library/std_detect/src/detect/os/linux/loongarch.rs
index 14cc7a73183..e97fda11d08 100644
--- a/library/std_detect/src/detect/os/linux/loongarch.rs
+++ b/library/std_detect/src/detect/os/linux/loongarch.rs
@@ -1,8 +1,9 @@
 //! Run-time feature detection for LoongArch on Linux.
 
+use core::arch::asm;
+
 use super::auxvec;
 use crate::detect::{Feature, bit, cache};
-use core::arch::asm;
 
 /// Try to read the features from the auxiliary vector.
 pub(crate) fn detect_features() -> cache::Initializer {
@@ -43,16 +44,8 @@ pub(crate) fn detect_features() -> cache::Initializer {
     //
     // [hwcap]: https://github.com/torvalds/linux/blob/master/arch/loongarch/include/uapi/asm/hwcap.h
     if let Ok(auxv) = auxvec::auxv() {
-        enable_feature(
-            &mut value,
-            Feature::f,
-            bit::test(cpucfg2, 1) && bit::test(auxv.hwcap, 3),
-        );
-        enable_feature(
-            &mut value,
-            Feature::d,
-            bit::test(cpucfg2, 2) && bit::test(auxv.hwcap, 3),
-        );
+        enable_feature(&mut value, Feature::f, bit::test(cpucfg2, 1) && bit::test(auxv.hwcap, 3));
+        enable_feature(&mut value, Feature::d, bit::test(cpucfg2, 2) && bit::test(auxv.hwcap, 3));
         enable_feature(&mut value, Feature::lsx, bit::test(auxv.hwcap, 4));
         enable_feature(&mut value, Feature::lasx, bit::test(auxv.hwcap, 5));
         enable_feature(
diff --git a/library/std_detect/src/detect/os/linux/riscv.rs b/library/std_detect/src/detect/os/linux/riscv.rs
index db20538af95..dbb3664890e 100644
--- a/library/std_detect/src/detect/os/linux/riscv.rs
+++ b/library/std_detect/src/detect/os/linux/riscv.rs
@@ -119,16 +119,7 @@ fn _riscv_hwprobe(out: &mut [riscv_hwprobe]) -> bool {
         cpus: *mut libc::c_ulong,
         flags: libc::c_uint,
     ) -> libc::c_long {
-        unsafe {
-            libc::syscall(
-                __NR_riscv_hwprobe,
-                pairs,
-                pair_count,
-                cpu_set_size,
-                cpus,
-                flags,
-            )
-        }
+        unsafe { libc::syscall(__NR_riscv_hwprobe, pairs, pair_count, cpu_set_size, cpus, flags) }
     }
 
     unsafe { __riscv_hwprobe(out.as_mut_ptr(), out.len(), 0, ptr::null_mut(), 0) == 0 }