From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: samples: rust: add Rust serial device bus sample device driver Date: Thu, 04 Jun 2026 15:18:44 +1000 Message-ID: In-Reply-To: <20260530-rust_serdev-v10-4-65d1d5db876c@posteo.de> References: <20260530-rust_serdev-v10-0-65d1d5db876c@posteo.de> <20260530-rust_serdev-v10-4-65d1d5db876c@posteo.de> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review The sample is clean and demonstrates the abstraction well. ```rust + fn receive<'bound>( + sdev: &'bound serdev::Device, + _this: Pin<&Self>, + data: &[u8], + ) -> usize { + let _ = sdev.write_all(data, serdev::Timeout::Max); + data.len() + } ``` The echo-back in `receive` silently discards write errors with `let _ =`. For a sample this is acceptable, but it might be worth a brief comment or `dev_warn!` for educational purposes. The `set_baudrate` error handling: ```rust + if sdev + .set_baudrate(...) + .is_err() + { + return Err(EINVAL); + } ``` This discards the actual baudrate returned in the `Err` variant. A more idiomatic approach would be to use `map_err` or log the actual baudrate. --- Generated by Claude Code Patch Reviewer