<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/rust/kernel/block/mq/request.rs, branch v6.17</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.17</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.17'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-06-22T21:09:17Z</updated>
<entry>
<title>rust: enable `clippy::as_underscore` lint</title>
<updated>2025-06-22T21:09:17Z</updated>
<author>
<name>Tamir Duberstein</name>
<email>tamird@gmail.com</email>
</author>
<published>2025-06-15T20:55:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5e30550558b1eace5fa4af4e2257216fa8a7c90f'/>
<id>urn:sha1:5e30550558b1eace5fa4af4e2257216fa8a7c90f</id>
<content type='text'>
In Rust 1.63.0, Clippy introduced the `as_underscore` lint [1]:

&gt; The conversion might include lossy conversion or a dangerous cast that
&gt; might go undetected due to the type being inferred.
&gt;
&gt; The lint is allowed by default as using `_` is less wordy than always
&gt; specifying the type.

Always specifying the type is especially helpful in function call
contexts where the inferred type may change at a distance. Specifying
the type also allows Clippy to spot more cases of `useless_conversion`.

The primary downside is the need to specify the type in trivial getters.
There are 4 such functions: 3 have become slightly less ergonomic, 1 was
revealed to be a `useless_conversion`.

While this doesn't eliminate unchecked `as` conversions, it makes such
conversions easier to scrutinize.  It also has the slight benefit of
removing a degree of freedom on which to bikeshed. Thus apply the
changes and enable the lint -- no functional change intended.

Link: https://rust-lang.github.io/rust-clippy/master/index.html#as_underscore [1]
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Signed-off-by: Tamir Duberstein &lt;tamird@gmail.com&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Link: https://lore.kernel.org/r/20250615-ptr-as-ptr-v12-4-f43b024581e8@gmail.com
[ Changed `isize` to `c_long`. - Miguel ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: enable `clippy::ptr_cast_constness` lint</title>
<updated>2025-06-22T21:08:50Z</updated>
<author>
<name>Tamir Duberstein</name>
<email>tamird@gmail.com</email>
</author>
<published>2025-06-15T20:55:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d8c9e735f1f3e729268222a550de7a7f594c4210'/>
<id>urn:sha1:d8c9e735f1f3e729268222a550de7a7f594c4210</id>
<content type='text'>
In Rust 1.72.0, Clippy introduced the `ptr_cast_constness` lint [1]:

&gt; Though `as` casts between raw pointers are not terrible,
&gt; `pointer::cast_mut` and `pointer::cast_const` are safer because they
&gt; cannot accidentally cast the pointer to another type.

There are only 3 affected sites:
- `*mut T as *const U as *mut U` becomes `(*mut T).cast()`.
- `&amp;self as *const Self as *mut Self` becomes
  `core::ptr::from_ref(self).cast_mut()`.
- `*const T as *mut _` becommes `(*const T).cast_mut()`.

Apply these changes and enable the lint -- no functional change
intended.

Link: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_cast_constness [1]
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Signed-off-by: Tamir Duberstein &lt;tamird@gmail.com&gt;
Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Link: https://lore.kernel.org/r/20250615-ptr-as-ptr-v12-2-f43b024581e8@gmail.com
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: block: refactor to use `&amp;raw mut`</title>
<updated>2025-03-23T19:39:37Z</updated>
<author>
<name>Antonio Hickey</name>
<email>contact@antoniohickey.com</email>
</author>
<published>2025-03-20T02:07:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2a571248dfa9d1ebac9db4564472b3dec157c99f'/>
<id>urn:sha1:2a571248dfa9d1ebac9db4564472b3dec157c99f</id>
<content type='text'>
Replace all occurrences (one) of `addr_of_mut!(place)` with
`&amp;raw mut place`.

This will allow us to reduce macro complexity, and improve consistency
with existing reference syntax as `&amp;raw mut` is similar to `&amp;mut` making
it fit more naturally with other existing code.

Suggested-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Link: https://github.com/Rust-for-Linux/linux/issues/1148
Signed-off-by: Antonio Hickey &lt;contact@antoniohickey.com&gt;
Acked-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Link: https://lore.kernel.org/r/20250320020740.1631171-17-contact@antoniohickey.com
[ Reworded slightly. - Miguel ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: block: fix formatting of `kernel::block::mq::request` module</title>
<updated>2024-10-22T18:04:01Z</updated>
<author>
<name>Francesco Zardi</name>
<email>frazar00@gmail.com</email>
</author>
<published>2024-09-03T17:30:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=28e848386b92645f93b9f2fdba5882c3ca7fb3e2'/>
<id>urn:sha1:28e848386b92645f93b9f2fdba5882c3ca7fb3e2</id>
<content type='text'>
Fix several issues with rustdoc formatting for the
`kernel::block::mq::Request` module, in particular:

  - An ordered list not rendering correctly, fixed by using numbers
    prefixes instead of letters.

  - Code snippets formatted as regular text, fixed by wrapping the
    code with `back-ticks`.

  - References to types missing intra-doc links, fixed by wrapping the
    types with [square brackets].

Reported-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Closes: https://github.com/Rust-for-Linux/linux/issues/1108
Signed-off-by: Francesco Zardi &lt;frazar00@gmail.com&gt;
Acked-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Fixes: 3253aba3408a ("rust: block: introduce `kernel::block::mq` module")
Link: https://lore.kernel.org/r/20240903173027.16732-3-frazar00@gmail.com
[ Added an extra intra-doc link. Took the chance to add some periods
  for consistency. Reworded slightly. - Miguel ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: block: introduce `kernel::block::mq` module</title>
<updated>2024-06-14T13:45:04Z</updated>
<author>
<name>Andreas Hindborg</name>
<email>a.hindborg@samsung.com</email>
</author>
<published>2024-06-11T11:45:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3253aba3408aa4eb2e4e09365eede3e63ef7536b'/>
<id>urn:sha1:3253aba3408aa4eb2e4e09365eede3e63ef7536b</id>
<content type='text'>
Add initial abstractions for working with blk-mq.

This patch is a maintained, refactored subset of code originally published
by Wedson Almeida Filho &lt;wedsonaf@gmail.com&gt; [1].

[1] https://github.com/wedsonaf/linux/tree/f2cfd2fe0e2ca4e90994f96afe268bbd4382a891/rust/kernel/blk/mq.rs

Cc: Wedson Almeida Filho &lt;wedsonaf@gmail.com&gt;
Signed-off-by: Andreas Hindborg &lt;a.hindborg@samsung.com&gt;
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Link: https://lore.kernel.org/r/20240611114551.228679-2-nmi@metaspace.dk
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
</feed>
