summaryrefslogtreecommitdiff
path: root/rust/kernel/str.rs
diff options
context:
space:
mode:
authorMiguel Ojeda <ojeda@kernel.org>2026-04-08 09:46:01 +0200
committerMiguel Ojeda <ojeda@kernel.org>2026-04-08 10:44:11 +0200
commitb06b348e855383ed80e041299f3925cdd7dff3da (patch)
tree711ca958418fe1b8253929f163fc4b279498111a /rust/kernel/str.rs
parentf4231eb25cd215882d4a5da9110d3772c2644b6c (diff)
parentddb1444d3335129ae87d9796ab1debf41c0ee51b (diff)
downloadlinux-next-b06b348e855383ed80e041299f3925cdd7dff3da.tar.gz
linux-next-b06b348e855383ed80e041299f3925cdd7dff3da.zip
Merge tag 'rust-timekeeping-for-v7.1' of https://github.com/Rust-for-Linux/linux into rust-next
Pull timekeeping updates from Andreas Hindborg: - Expand the example section in the 'HrTimer' documentation. - Mark the 'ClockSource' trait as unsafe to ensure valid values for 'ktime_get()'. - Add 'Delta::from_nanos()'. This is a back merge since the pull request has a newer base -- we will avoid that in the future. And, given it is a back merge, it happens to resolve the "subtle" conflict around '--remap-path-{prefix,scope}' that I discussed in linux-next [1], plus a few other common conflicts. The result matches what we did for next-20260407. The actual diffstat (i.e. using a temporary merge of upstream first) is: rust/kernel/time.rs | 32 ++++- rust/kernel/time/hrtimer.rs | 336 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 362 insertions(+), 6 deletions(-) Link: https://lore.kernel.org/linux-next/CANiq72kdxB=W3_CV1U44oOK3SssztPo2wLDZt6LP94TEO+Kj4g@mail.gmail.com/ [1] * tag 'rust-timekeeping-for-v7.1' of https://github.com/Rust-for-Linux/linux: hrtimer: add usage examples to documentation rust: time: make ClockSource unsafe trait rust/time: Add Delta::from_nanos()
Diffstat (limited to 'rust/kernel/str.rs')
-rw-r--r--rust/kernel/str.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs
index 9b89564ae6d8..8311d91549e1 100644
--- a/rust/kernel/str.rs
+++ b/rust/kernel/str.rs
@@ -680,13 +680,13 @@ impl fmt::Write for Formatter<'_> {
///
/// * The first byte of `buffer` is always zero.
/// * The length of `buffer` is at least 1.
-pub(crate) struct NullTerminatedFormatter<'a> {
+pub struct NullTerminatedFormatter<'a> {
buffer: &'a mut [u8],
}
impl<'a> NullTerminatedFormatter<'a> {
/// Create a new [`Self`] instance.
- pub(crate) fn new(buffer: &'a mut [u8]) -> Option<NullTerminatedFormatter<'a>> {
+ pub fn new(buffer: &'a mut [u8]) -> Option<NullTerminatedFormatter<'a>> {
*(buffer.first_mut()?) = 0;
// INVARIANT: