public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
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: Mon, 09 Mar 2026 08:21:40 +1000	[thread overview]
Message-ID: <review-patch4-20260306-rust_serdev-v2-4-e9b23b42b255@posteo.de> (raw)
In-Reply-To: <20260306-rust_serdev-v2-4-e9b23b42b255@posteo.de>

Patch Review

The sample is clean and demonstrates the abstraction well. A few notes:

**`set_baudrate` error handling is odd due to the API design:**

```rust
if sdev
    .set_baudrate(
        dev.fwnode()
            .and_then(|fwnode| fwnode.property_read(c"baudrate").optional())
            .unwrap_or(115200),
    )
    .is_err()
{
    return Err(EINVAL);
}
```

This discards the actual baudrate returned in the error. If `set_baudrate` returned `u32` instead of `Result<(), u32>`, this would be simpler and more informative.

**Echo server with `Timeout::Max` would hang:** Due to the `Timeout::Max` bug (returning 0), `write_all` in receive would return immediately or with ETIMEDOUT rather than actually waiting. This makes the sample non-functional in practice.

**The sample stores an `ARef<serdev::Device>` but never uses it** (except in Drop for a debug message). This is fine for a sample but worth noting.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-03-08 22:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 1/4] rust: devres: return reference in `devres::register` Markus Probst
2026-03-08 22:21   ` Claude review: " Claude Code Review Bot
2026-03-06 19:35 ` [PATCH v2 2/4] serdev: add private data to serdev_device Markus Probst
2026-03-06 19:49   ` Randy Dunlap
2026-03-06 20:14     ` Markus Probst
2026-03-08 22:21     ` Claude review: " Claude Code Review Bot
2026-03-06 20:29   ` Danilo Krummrich
2026-03-06 19:35 ` [PATCH v2 3/4] rust: add basic serial device bus abstractions Markus Probst
2026-03-06 20:36   ` Markus Probst
2026-03-06 20:40   ` Danilo Krummrich
2026-03-06 20:46     ` Markus Probst
2026-03-08 22:21     ` Claude review: " Claude Code Review Bot
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 Code Review Bot [this message]
2026-03-08 22:21 ` Claude review: rust: add basic serial device bus abstractions Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-03-13 18:12 [PATCH v3 0/4] " 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

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-20260306-rust_serdev-v2-4-e9b23b42b255@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