From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: rust: add warn_on_err macro Date: Thu, 23 Apr 2026 07:34:42 +1000 Message-ID: In-Reply-To: <20260422-nova-unload-v3-1-1d2c81bd3ced@nvidia.com> References: <20260422-nova-unload-v3-0-1d2c81bd3ced@nvidia.com> <20260422-nova-unload-v3-1-1d2c81bd3ced@nvidia.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Status: Looks good, minor nit** The macro is simple and correct: ```rust macro_rules! warn_on_err { ($res:expr) =3D> {{ let res =3D $res; let _ =3D $crate::warn_on!(res.is_err()); res }}; } ``` The binding of `$res` to a local `let res` correctly ensures single evaluat= ion of the expression. The `let _ =3D` on the `warn_on!` call suppresses th= e unused return value. The doc comment `/// Report a warning if `res` is an= error and return `res` unmodified.` is clear. One minor note: this macro has no type constraint visible in its signature = =E2=80=94 it works on anything with `.is_err()`, which is fine for `Result`= but could theoretically be called on custom types. That's an acceptable tr= adeoff for a kernel utility macro. No issues. --- Generated by Claude Code Patch Reviewer