rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rust: bitmap: fix formatting
@ 2025-10-16 23:21 Miguel Ojeda
  2025-10-17  6:40 ` Burak Emir
  2025-10-19 19:01 ` Miguel Ojeda
  0 siblings, 2 replies; 3+ messages in thread
From: Miguel Ojeda @ 2025-10-16 23:21 UTC (permalink / raw)
  To: Alice Ryhl, Burak Emir, Miguel Ojeda, Alex Gaynor
  Cc: Yury Norov, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Trevor Gross, Danilo Krummrich,
	rust-for-linux, linux-kernel, patches

We do our best to keep the repository `rustfmt`-clean, thus run the tool
to fix the formatting issue.

Link: https://docs.kernel.org/rust/coding-guidelines.html#style-formatting
Link: https://rust-for-linux.com/contributing#submit-checklist-addendum
Fixes: 0f5878834d6c ("rust: bitmap: clean Rust 1.92.0 `unused_unsafe` warning")
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
This one will go on top of:

    https://lore.kernel.org/rust-for-linux/20251010174351.948650-1-ojeda@kernel.org/

 rust/kernel/bitmap.rs | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/rust/kernel/bitmap.rs b/rust/kernel/bitmap.rs
index 711b8368b38f..aa8fc7bf06fc 100644
--- a/rust/kernel/bitmap.rs
+++ b/rust/kernel/bitmap.rs
@@ -167,7 +167,9 @@ fn deref(&self) -> &Bitmap {
         let ptr = if self.nbits <= BITS_PER_LONG {
             // SAFETY: Bitmap is represented inline.
             #[allow(unused_unsafe, reason = "Safe since Rust 1.92.0")]
-            unsafe { core::ptr::addr_of!(self.repr.bitmap) }
+            unsafe {
+                core::ptr::addr_of!(self.repr.bitmap)
+            }
         } else {
             // SAFETY: Bitmap is represented as array of `unsigned long`.
             unsafe { self.repr.ptr.as_ptr() }
@@ -184,7 +186,9 @@ fn deref_mut(&mut self) -> &mut Bitmap {
         let ptr = if self.nbits <= BITS_PER_LONG {
             // SAFETY: Bitmap is represented inline.
             #[allow(unused_unsafe, reason = "Safe since Rust 1.92.0")]
-            unsafe { core::ptr::addr_of_mut!(self.repr.bitmap) }
+            unsafe {
+                core::ptr::addr_of_mut!(self.repr.bitmap)
+            }
         } else {
             // SAFETY: Bitmap is represented as array of `unsigned long`.
             unsafe { self.repr.ptr.as_ptr() }

base-commit: 32f072d9eaf9c31c2b0527a4a3370570a731e3cc
--
2.51.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] rust: bitmap: fix formatting
  2025-10-16 23:21 [PATCH] rust: bitmap: fix formatting Miguel Ojeda
@ 2025-10-17  6:40 ` Burak Emir
  2025-10-19 19:01 ` Miguel Ojeda
  1 sibling, 0 replies; 3+ messages in thread
From: Burak Emir @ 2025-10-17  6:40 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Alice Ryhl, Alex Gaynor, Yury Norov, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Trevor Gross, Danilo Krummrich, rust-for-linux, linux-kernel,
	patches

On Fri, Oct 17, 2025 at 7:21 AM Miguel Ojeda <ojeda@kernel.org> wrote:
>
> We do our best to keep the repository `rustfmt`-clean, thus run the tool
> to fix the formatting issue.
>
> Link: https://docs.kernel.org/rust/coding-guidelines.html#style-formatting
> Link: https://rust-for-linux.com/contributing#submit-checklist-addendum
> Fixes: 0f5878834d6c ("rust: bitmap: clean Rust 1.92.0 `unused_unsafe` warning")
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Reviewed-by: Burak Emir <bqe@google.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] rust: bitmap: fix formatting
  2025-10-16 23:21 [PATCH] rust: bitmap: fix formatting Miguel Ojeda
  2025-10-17  6:40 ` Burak Emir
@ 2025-10-19 19:01 ` Miguel Ojeda
  1 sibling, 0 replies; 3+ messages in thread
From: Miguel Ojeda @ 2025-10-19 19:01 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Alice Ryhl, Burak Emir, Alex Gaynor, Yury Norov, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Trevor Gross, Danilo Krummrich, rust-for-linux, linux-kernel,
	patches

On Fri, Oct 17, 2025 at 1:21 AM Miguel Ojeda <ojeda@kernel.org> wrote:
>
> We do our best to keep the repository `rustfmt`-clean, thus run the tool
> to fix the formatting issue.
>
> Link: https://docs.kernel.org/rust/coding-guidelines.html#style-formatting
> Link: https://rust-for-linux.com/contributing#submit-checklist-addendum
> Fixes: 0f5878834d6c ("rust: bitmap: clean Rust 1.92.0 `unused_unsafe` warning")
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
> ---
> This one will go on top of:
>
>     https://lore.kernel.org/rust-for-linux/20251010174351.948650-1-ojeda@kernel.org/

For completeness: I applied this one together with the others and they
got merged by Linus. The tree is now again `rustfmt`-clean.

Thanks!

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-10-19 19:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-16 23:21 [PATCH] rust: bitmap: fix formatting Miguel Ojeda
2025-10-17  6:40 ` Burak Emir
2025-10-19 19:01 ` 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).