From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: samples: rust: add Rust serial device bus sample device driver
Date: Tue, 28 Apr 2026 14:14:45 +1000 [thread overview]
Message-ID: <review-patch4-20260427-rust_serdev-v6-4-173798d5e1a3@posteo.de> (raw)
In-Reply-To: <20260427-rust_serdev-v6-4-173798d5e1a3@posteo.de>
Patch Review
The sample is clean and demonstrates the key API surface well.
**One issue with the sample probe:**
```rust
fn probe(
sdev: &serdev::Device<Core>,
_info: Option<&Self::IdInfo>,
) -> impl PinInit<Self, Error> {
...
if sdev.set_baudrate(...).is_err() {
return Err(EINVAL);
}
```
The `set_baudrate` method is on `Device<Bound>`, but `sdev` is `&Device<Core>`. This works via the deref coercion chain, which is correct but could be surprising to readers. A brief comment in the abstraction's module-level docs explaining the device context hierarchy and auto-deref would help (though this is a broader Rust-for-Linux documentation issue, not specific to this patch).
**The receive callback echoes data back:**
```rust
fn receive(sdev: &serdev::Device<Bound>, _this: Pin<&Self>, data: &[u8]) -> usize {
let _ = sdev.write_all(data, serdev::Timeout::Max);
data.len()
}
```
This is fine for a sample. The `let _ =` discards the write result, which is acceptable for demonstration purposes. Note that this always returns `data.len()` (claiming all data was consumed) regardless of whether `write_all` succeeded, which is the right behavior for a simple echo.
**The `SampleDriver` stores an `ARef<serdev::Device>` but only uses it in `Drop`** for a debug message. This is fine as a sample demonstrating how to keep a reference to the device.
No blocking issues with this patch.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-04-28 4:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 18:05 [PATCH v6 0/4] rust: add basic serial device bus abstractions Markus Probst via B4 Relay
2026-04-27 18:05 ` [PATCH v6 1/4] rust: devres: return reference in `devres::register` Markus Probst via B4 Relay
2026-04-28 4:14 ` Claude review: " Claude Code Review Bot
2026-04-27 18:05 ` [PATCH v6 2/4] serdev: add rust private data to serdev_device Markus Probst via B4 Relay
2026-04-28 4:14 ` Claude review: " Claude Code Review Bot
2026-04-27 18:05 ` [PATCH v6 3/4] rust: add basic serial device bus abstractions Markus Probst via B4 Relay
2026-04-28 4:14 ` Claude review: " Claude Code Review Bot
2026-04-27 18:05 ` [PATCH v6 4/4] samples: rust: add Rust serial device bus sample device driver Markus Probst via B4 Relay
2026-04-28 4:14 ` Claude Code Review Bot [this message]
2026-04-28 4:14 ` Claude review: rust: add basic serial device bus abstractions Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-04-29 18:21 [PATCH v7 0/4] " Markus Probst via B4 Relay
2026-04-29 18:21 ` [PATCH v7 4/4] samples: rust: add Rust serial device bus sample device driver Markus Probst via B4 Relay
2026-05-05 1:18 ` Claude review: " Claude Code Review Bot
2026-04-20 20:07 [PATCH v5 0/4] rust: add basic serial device bus abstractions Markus Probst
2026-04-20 20:07 ` [PATCH v5 4/4] samples: rust: add Rust serial device bus sample device driver Markus Probst
2026-04-22 23:21 ` Claude review: " Claude Code Review Bot
2026-04-11 15:10 [PATCH v4 0/4] rust: add basic serial device bus abstractions Markus Probst via B4 Relay
2026-04-11 15:10 ` [PATCH v4 4/4] samples: rust: add Rust serial device bus sample device driver Markus Probst via B4 Relay
2026-04-11 22:55 ` Claude review: " Claude Code Review Bot
2026-03-13 18:12 [PATCH v3 0/4] rust: add basic serial device bus abstractions Markus Probst
2026-03-13 18:12 ` [PATCH v3 4/4] samples: rust: add Rust serial device bus sample device driver Markus Probst
2026-03-16 2:17 ` Claude review: " Claude Code Review Bot
2026-03-06 19:35 [PATCH v2 0/4] rust: add basic serial device bus abstractions Markus Probst
2026-03-06 19:35 ` [PATCH v2 4/4] samples: rust: add Rust serial device bus sample device driver Markus Probst
2026-03-08 22:21 ` Claude review: " Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-patch4-20260427-rust_serdev-v6-4-173798d5e1a3@posteo.de \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox