lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <176313439079.498.4521363360222860326.tip-bot2@tip-bot2>
Date: Fri, 14 Nov 2025 15:33:10 -0000
From: "tip-bot2 for Boqun Feng" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: David Gow <davidgow@...gle.com>,
 "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
 Boqun Feng <boqun.feng@...il.com>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Subject:
 [tip: locking/core] rust: sync: atomic: Implement Debug for Atomic<Debug>

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     013f912eb5fa7c06b3648ca630acfc4ff26456fa
Gitweb:        https://git.kernel.org/tip/013f912eb5fa7c06b3648ca630acfc4ff26456fa
Author:        Boqun Feng <boqun.feng@...il.com>
AuthorDate:    Tue, 21 Oct 2025 23:53:23 -04:00
Committer:     Boqun Feng <boqun.feng@...il.com>
CommitterDate: Wed, 12 Nov 2025 08:56:41 -08:00

rust: sync: atomic: Implement Debug for Atomic<Debug>

If `Atomic<T>` is `Debug` then it's a `debugfs::Writer`, therefore make
it so since 1) debugfs needs to support `Atomic<T>` and 2) it's rather
trivial to implement `Debug` for `Atomic<Debug>`.

Tested-by: David Gow <davidgow@...gle.com>
Acked-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Signed-off-by: Boqun Feng <boqun.feng@...il.com>
Link: https://patch.msgid.link/20251022035324.70785-3-boqun.feng@gmail.com
---
 rust/kernel/sync/atomic.rs |  9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/rust/kernel/sync/atomic.rs b/rust/kernel/sync/atomic.rs
index 0bc6e7b..3afc376 100644
--- a/rust/kernel/sync/atomic.rs
+++ b/rust/kernel/sync/atomic.rs
@@ -307,6 +307,15 @@ where
     }
 }
 
+impl<T: AtomicType + core::fmt::Debug> core::fmt::Debug for Atomic<T>
+where
+    T::Repr: AtomicBasicOps,
+{
+    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+        core::fmt::Debug::fmt(&self.load(Relaxed), f)
+    }
+}
+
 impl<T: AtomicType> Atomic<T>
 where
     T::Repr: AtomicExchangeOps,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ