public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/16] rust: refactor to utilize `&raw [const|mut]`
@ 2025-03-16  6:14 Antonio Hickey
  2025-03-16  6:14 ` [PATCH v4 01/16] rust: enable `raw_ref_op` feature Antonio Hickey
                   ` (15 more replies)
  0 siblings, 16 replies; 32+ messages in thread
From: Antonio Hickey @ 2025-03-16  6:14 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
  Cc: Antonio Hickey, rust-for-linux

This patch set enables the `raw_ref_op` feature, which became stable 
in Rust 1.82.

It then replaces all occurences of `addr_of!(place)` and
`addr_of_mut!(place)` with `&raw const place` and `&raw mut place`.

Finally it adds the previous macros `addr_of!` and `addr_of_mut!` to
the disallowed macros in `.clippy.toml`.

Changes in v4:
- Fix comment typo.
- Fix clippy issues.
- Add more context and link for disallowed macros with clippy.
- Seperate the patch replacing of `addr_of[_mut]!` macros with
  `&raw [const|mut]` into smaller patches for each section.
  (PATCH v3 2/3 -> PATCH v4 2/16 through 15/16)
- Fix email typo.
- Link to v3: https://lore.kernel.org/all/0100019597091f92-cb55b6cd-4d06-4d14-8d9c-1a1314949a00-000000@email.amazonses.com/

Changes in v3:
- Re ordered the patches, so that the patch adding the `addr_of[_mut]!`
  macros to the disallowed macros in clippy is applied after replacing
  all the instances of `addr_of_[_mut]` with `&raw [const|mut]`.
  (moved PATCH v2 2/3 -> PATCH v3 3/3 and PATCH v2 3/3 -> PATCH v3 2/3)
- Link to v2: https://lore.kernel.org/all/0100019592c224ba-0cf38e16-2aa2-459d-99cd-09a463d616d4-000000@email.amazonses.com/

Changes in v2:   
- Fix `&raw place` should be `&raw const place`
- Fix email typo
- Link to v1: https://lore.kernel.org/all/010001958dfeacb5-9039aaab-6114-494a-9f1d-f13982091169-000000@email.amazonses.com/

Suggested-by: Benno Lossin <benno.lossin@proton.me>
Link: https://github.com/Rust-for-Linux/linux/issues/1148
Signed-off-by: Antonio Hickey <contact@antoniohickey.com>

---
Antonio Hickey (16):
  rust: enable `raw_ref_op` feature
  rust: init: refactor to use `&raw [const|mut]`
  rust: list: refactor to use `&raw [const|mut]`
  rust: task: refactor to use `&raw [const|mut]`
  rust: faux: refactor to use `&raw [const|mut]`
  rust: platform: refactor to use `&raw [const|mut]`
  rust: pci: refactor to use `&raw [const|mut]`
  rust: kunit: refactor to use `&raw [const|mut]`
  rust: workqueue: refactor to use `&raw [const|mut]`
  rust: rbtree: refactor to use `&raw [const|mut]`
  rust: net: phy: refactor to use `&raw [const|mut]`
  rust: sync: arc: refactor to use `&raw [const|mut]`
  rust: jump_label: refactor to use `&raw [const|mut]`
  rust: fs: file: refactor to use `&raw [const|mut]`
  rust: block: refactor to use `&raw [const|mut]`
  rust: clippy: disable `addr_of[_mut]!` macros

 .clippy.toml                           |  4 ++++
 rust/kernel/block/mq/request.rs        |  4 ++--
 rust/kernel/faux.rs                    |  4 ++--
 rust/kernel/fs/file.rs                 |  2 +-
 rust/kernel/init.rs                    |  8 ++++----
 rust/kernel/init/macros.rs             | 28 +++++++++++++-------------
 rust/kernel/jump_label.rs              |  4 ++--
 rust/kernel/kunit.rs                   |  4 ++--
 rust/kernel/lib.rs                     |  2 ++
 rust/kernel/list.rs                    |  2 +-
 rust/kernel/list/impl_list_item_mod.rs |  6 +++---
 rust/kernel/net/phy.rs                 |  4 ++--
 rust/kernel/pci.rs                     |  4 ++--
 rust/kernel/platform.rs                |  4 +---
 rust/kernel/rbtree.rs                  | 22 ++++++++++----------
 rust/kernel/sync/arc.rs                |  2 +-
 rust/kernel/task.rs                    |  4 ++--
 rust/kernel/workqueue.rs               |  9 +++++----
 18 files changed, 61 insertions(+), 56 deletions(-)

-- 
2.48.1


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

end of thread, other threads:[~2025-03-21 19:05 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-16  6:14 [PATCH v4 00/16] rust: refactor to utilize `&raw [const|mut]` Antonio Hickey
2025-03-16  6:14 ` [PATCH v4 01/16] rust: enable `raw_ref_op` feature Antonio Hickey
2025-03-16  6:14 ` [PATCH v4 02/16] rust: init: refactor to use `&raw [const|mut]` Antonio Hickey
2025-03-16 10:14   ` Benno Lossin
2025-03-16  6:14 ` [PATCH v4 03/16] rust: list: " Antonio Hickey
2025-03-16  6:14 ` [PATCH v4 04/16] rust: task: " Antonio Hickey
2025-03-17  4:00   ` Boqun Feng
2025-03-16  6:14 ` [PATCH v4 05/16] rust: faux: " Antonio Hickey
2025-03-16  6:14 ` [PATCH v4 06/16] rust: platform: " Antonio Hickey
2025-03-16  6:14 ` [PATCH v4 07/16] rust: pci: " Antonio Hickey
2025-03-16  6:14 ` [PATCH v4 08/16] rust: kunit: " Antonio Hickey
2025-03-18  8:02   ` David Gow
2025-03-20  1:39     ` Antonio Hickey
2025-03-20 23:15     ` Miguel Ojeda
2025-03-21  2:28       ` David Gow
2025-03-21 17:06         ` Boqun Feng
2025-03-21 19:04           ` Miguel Ojeda
2025-03-21 19:01       ` Antonio Hickey
2025-03-16  6:14 ` [PATCH v4 09/16] rust: workqueue: " Antonio Hickey
2025-03-17  4:21   ` Boqun Feng
2025-03-17  4:32     ` Boqun Feng
2025-03-16  6:14 ` [PATCH v4 10/16] rust: rbtree: " Antonio Hickey
2025-03-16  6:14 ` [PATCH v4 11/16] rust: net: phy: " Antonio Hickey
2025-03-16  6:14 ` [PATCH v4 12/16] rust: sync: arc: " Antonio Hickey
2025-03-16  6:14 ` [PATCH v4 13/16] rust: jump_label: " Antonio Hickey
2025-03-16  6:14 ` [PATCH v4 14/16] rust: fs: file: " Antonio Hickey
2025-03-17  4:33   ` Boqun Feng
2025-03-16  6:14 ` [PATCH v4 15/16] rust: block: " Antonio Hickey
2025-03-17  4:04   ` Boqun Feng
2025-03-16  6:14 ` [PATCH v4 16/16] rust: clippy: disable `addr_of[_mut]!` macros Antonio Hickey
2025-03-16  9:50   ` Benno Lossin
2025-03-16 12:57   ` Tamir Duberstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox