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: sync: completion: add wait_for_completion_timeout() Date: Tue, 05 May 2026 09:10:01 +1000 Message-ID: In-Reply-To: <20260501205825.73614-2-joelagnelf@nvidia.com> References: <20260501205825.73614-1-joelagnelf@nvidia.com> <20260501205825.73614-2-joelagnelf@nvidia.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review Clean and straightforward. Wraps the C `wait_for_completion_timeout()` function. ```rust pub fn wait_for_completion_timeout(&self, timeout: Jiffies) -> bool { // SAFETY: `self.as_raw()` is a pointer to a valid `struct completion`. unsafe { bindings::wait_for_completion_timeout(self.as_raw(), timeout) != 0 } } ``` **Minor:** The `// ` trailing comment on line 171 of the import block looks like a rustfmt artifact: ```rust types::Opaque, // ``` This appears throughout the series and seems to be an intentional rustfmt workaround to force one-import-per-line. Harmless but unusual. **Question:** The C function `wait_for_completion_timeout()` returns `unsigned long` - the remaining jiffies if completed, 0 if timed out. Collapsing this to `bool` discards the remaining-jiffies information. For this series that's fine, but the Rust binding might want to return `Option` (or similar) to expose the full API. This could be a follow-up. --- Generated by Claude Code Patch Reviewer