Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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@google.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20251022035324.70785-3-boqun.feng@gmail.com

+9
+9
rust/kernel/sync/atomic.rs
··· 307 307 } 308 308 } 309 309 310 + impl<T: AtomicType + core::fmt::Debug> core::fmt::Debug for Atomic<T> 311 + where 312 + T::Repr: AtomicBasicOps, 313 + { 314 + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { 315 + core::fmt::Debug::fmt(&self.load(Relaxed), f) 316 + } 317 + } 318 + 310 319 impl<T: AtomicType> Atomic<T> 311 320 where 312 321 T::Repr: AtomicExchangeOps,