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:57:28 +1000 Message-ID: In-Reply-To: <20260530-rust_serdev-v8-4-2a95f1da22a7@posteo.de> References: <20260530-rust_serdev-v8-0-2a95f1da22a7@posteo.de> <20260530-rust_serdev-v8-4-2a95f1da22a7@posteo.de> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review The sample is a simple echo driver =E2=80=94 it reads a baudrate from devic= e tree (defaulting to 115200), configures the port, and echoes back receive= d data. ```rust + fn receive<'bound>( + sdev: &'bound serdev::Device, + _this: Pin<&Self>, + data: &[u8], + ) -> usize { + let _ =3D sdev.write_all(data, serdev::Timeout::Max); + data.len() + } ``` The `let _ =3D ...` explicitly discards the write result, which is acceptab= le for a sample. The function always returns `data.len()` claiming all data= was consumed regardless of write success =E2=80=94 fine for demonstration = purposes. **Nit:** The `set_baudrate` error handling: ```rust + if sdev + .set_baudrate( + dev.fwnode() + .and_then(|fwnode| fwnode.property_read(c"baudrate").o= ptional()) + .unwrap_or(115200), + ) + .is_err() + { + return Err(EINVAL); ``` The `Err(u32)` from `set_baudrate` (containing the actual baudrate that was= set) is discarded. A `dev_warn!` logging the mismatch would be helpful for= debugging, but not required for a sample. The `// ` trailing comments on some import lines are unusual formatting art= ifacts (likely from rustfmt vertical formatting). Not a functional issue. --- --- Generated by Claude Code Patch Reviewer