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: drm: Wrap ioctl dispatch in UnbindGuard Date: Thu, 07 May 2026 12:45:09 +1000 Message-ID: In-Reply-To: <20260506221027.858481-5-dakr@kernel.org> References: <20260506221027.858481-1-dakr@kernel.org> <20260506221027.858481-5-dakr@kernel.org> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review The ioctl macro change: ```rust let dev = unsafe { $crate::drm::device::Device::from_raw(raw_dev) }; let _guard = match $crate::drm::device::unbind_guard(dev) { Some(g) => g, None => return $crate::error::code::ENODEV.to_errno(), }; ``` **Free-function wrapper**: The `unbind_guard` free function is a reasonable workaround for macro type inference limitations. It's marked `#[doc(hidden)]` appropriately. **ENODEV return**: Returning `ENODEV` when the device has been unplugged is the standard behavior for unplugged DRM devices. Correct. **Guard naming**: The guard is named `_guard` (with underscore prefix) because in this patch it's not used for anything other than keeping the critical section open. This changes in patch 5 where it becomes `guard`. Clean incremental development. No issues. --- Generated by Claude Code Patch Reviewer