* [PATCH] rust: uaccess: name the correct function
@ 2025-03-17 11:43 Tamir Duberstein
2025-03-17 11:49 ` Alice Ryhl
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Tamir Duberstein @ 2025-03-17 11:43 UTC (permalink / raw)
To: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Danilo Krummrich, Wedson Almeida Filho
Cc: rust-for-linux, linux-kernel, Tamir Duberstein
Correctly refer to `reserve` rather than `try_reserve` in a comment. This
comment has been incorrect since inception in commit 1b580e7b9ba2 ("rust:
uaccess: add userspace pointers").
Fixes: 1b580e7b9ba2 ("rust: uaccess: add userspace pointers")
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
---
rust/kernel/uaccess.rs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/rust/kernel/uaccess.rs b/rust/kernel/uaccess.rs
index 719b0a48ff55..80a9782b1c6e 100644
--- a/rust/kernel/uaccess.rs
+++ b/rust/kernel/uaccess.rs
@@ -285,8 +285,7 @@ pub fn read_all<A: Allocator>(mut self, buf: &mut Vec<u8, A>, flags: Flags) -> R
let len = self.length;
buf.reserve(len, flags)?;
- // The call to `try_reserve` was successful, so the spare capacity is at least `len` bytes
- // long.
+ // The call to `reserve` was successful, so the spare capacity is at least `len` bytes long.
self.read_raw(&mut buf.spare_capacity_mut()[..len])?;
// SAFETY: Since the call to `read_raw` was successful, so the next `len` bytes of the
---
base-commit: cf25bc61f8aecad9b0c45fe32697e35ea4b13378
change-id: 20250317-uaccess-typo-reserve-87f20265e6e2
Best regards,
--
Tamir Duberstein <tamird@gmail.com>
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] rust: uaccess: name the correct function
2025-03-17 11:43 [PATCH] rust: uaccess: name the correct function Tamir Duberstein
@ 2025-03-17 11:49 ` Alice Ryhl
2025-03-17 14:32 ` Benno Lossin
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Alice Ryhl @ 2025-03-17 11:49 UTC (permalink / raw)
To: Tamir Duberstein
Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Danilo Krummrich, Wedson Almeida Filho,
rust-for-linux, linux-kernel
On Mon, Mar 17, 2025 at 07:43:03AM -0400, Tamir Duberstein wrote:
> Correctly refer to `reserve` rather than `try_reserve` in a comment. This
> comment has been incorrect since inception in commit 1b580e7b9ba2 ("rust:
> uaccess: add userspace pointers").
>
> Fixes: 1b580e7b9ba2 ("rust: uaccess: add userspace pointers")
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Thanks.
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] rust: uaccess: name the correct function
2025-03-17 11:43 [PATCH] rust: uaccess: name the correct function Tamir Duberstein
2025-03-17 11:49 ` Alice Ryhl
@ 2025-03-17 14:32 ` Benno Lossin
2025-03-17 14:43 ` Charalampos Mitrodimas
2025-03-23 22:31 ` Miguel Ojeda
3 siblings, 0 replies; 5+ messages in thread
From: Benno Lossin @ 2025-03-17 14:32 UTC (permalink / raw)
To: Tamir Duberstein, Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich, Wedson Almeida Filho
Cc: rust-for-linux, linux-kernel
On Mon Mar 17, 2025 at 12:43 PM CET, Tamir Duberstein wrote:
> Correctly refer to `reserve` rather than `try_reserve` in a comment. This
> comment has been incorrect since inception in commit 1b580e7b9ba2 ("rust:
> uaccess: add userspace pointers").
>
> Fixes: 1b580e7b9ba2 ("rust: uaccess: add userspace pointers")
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
---
Cheers,
Benno
> ---
> rust/kernel/uaccess.rs | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/rust/kernel/uaccess.rs b/rust/kernel/uaccess.rs
> index 719b0a48ff55..80a9782b1c6e 100644
> --- a/rust/kernel/uaccess.rs
> +++ b/rust/kernel/uaccess.rs
> @@ -285,8 +285,7 @@ pub fn read_all<A: Allocator>(mut self, buf: &mut Vec<u8, A>, flags: Flags) -> R
> let len = self.length;
> buf.reserve(len, flags)?;
>
> - // The call to `try_reserve` was successful, so the spare capacity is at least `len` bytes
> - // long.
> + // The call to `reserve` was successful, so the spare capacity is at least `len` bytes long.
> self.read_raw(&mut buf.spare_capacity_mut()[..len])?;
>
> // SAFETY: Since the call to `read_raw` was successful, so the next `len` bytes of the
>
> ---
> base-commit: cf25bc61f8aecad9b0c45fe32697e35ea4b13378
> change-id: 20250317-uaccess-typo-reserve-87f20265e6e2
>
> Best regards,
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] rust: uaccess: name the correct function
2025-03-17 11:43 [PATCH] rust: uaccess: name the correct function Tamir Duberstein
2025-03-17 11:49 ` Alice Ryhl
2025-03-17 14:32 ` Benno Lossin
@ 2025-03-17 14:43 ` Charalampos Mitrodimas
2025-03-23 22:31 ` Miguel Ojeda
3 siblings, 0 replies; 5+ messages in thread
From: Charalampos Mitrodimas @ 2025-03-17 14:43 UTC (permalink / raw)
To: Tamir Duberstein
Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Danilo Krummrich, Wedson Almeida Filho,
rust-for-linux, linux-kernel
Tamir Duberstein <tamird@gmail.com> writes:
> Correctly refer to `reserve` rather than `try_reserve` in a comment. This
> comment has been incorrect since inception in commit 1b580e7b9ba2 ("rust:
> uaccess: add userspace pointers").
>
> Fixes: 1b580e7b9ba2 ("rust: uaccess: add userspace pointers")
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Reviewed-by: Charalampos Mitrodimas <charmitro@posteo.net>
--
C. Mitrodimas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] rust: uaccess: name the correct function
2025-03-17 11:43 [PATCH] rust: uaccess: name the correct function Tamir Duberstein
` (2 preceding siblings ...)
2025-03-17 14:43 ` Charalampos Mitrodimas
@ 2025-03-23 22:31 ` Miguel Ojeda
3 siblings, 0 replies; 5+ messages in thread
From: Miguel Ojeda @ 2025-03-23 22:31 UTC (permalink / raw)
To: Tamir Duberstein
Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
Trevor Gross, Danilo Krummrich, Wedson Almeida Filho,
rust-for-linux, linux-kernel
On Mon, Mar 17, 2025 at 12:43 PM Tamir Duberstein <tamird@gmail.com> wrote:
>
> Correctly refer to `reserve` rather than `try_reserve` in a comment. This
> comment has been incorrect since inception in commit 1b580e7b9ba2 ("rust:
> uaccess: add userspace pointers").
>
> Fixes: 1b580e7b9ba2 ("rust: uaccess: add userspace pointers")
> Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Applied to `rust-next` -- thanks everyone!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-03-23 22:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-17 11:43 [PATCH] rust: uaccess: name the correct function Tamir Duberstein
2025-03-17 11:49 ` Alice Ryhl
2025-03-17 14:32 ` Benno Lossin
2025-03-17 14:43 ` Charalampos Mitrodimas
2025-03-23 22:31 ` Miguel Ojeda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).