From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/msm: Fix iommu_map_sgtable() return value check and avoid WARN Date: Thu, 23 Apr 2026 08:57:24 +1000 Message-ID: In-Reply-To: <20260421-iommu_map_sgtable-return-v1-3-fb484c07d2a1@nvidia.com> References: <20260421-iommu_map_sgtable-return-v1-0-fb484c07d2a1@nvidia.com> <20260421-iommu_map_sgtable-return-v1-3-fb484c07d2a1@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 **Status: Good** This patch makes two changes: fixes the type from `size_t` to `ssize_t`, and replaces the `WARN_ON(!ret)` with a proper error return: ```c - size_t ret; + ssize_t ret; ... ret = iommu_map_sgtable(iommu->domain, iova, sgt, prot); - WARN_ON(!ret); + if (ret < 0) + return ret; return (ret == len) ? 0 : -EINVAL; ``` The function `msm_iommu_map` returns `int`, and `ret` is `ssize_t`. On the error path, `return ret` narrows `ssize_t` to `int`, which is safe for negative errnos. On the success path, the existing `(ret == len) ? 0 : -EINVAL` check is preserved, correctly detecting partial mappings. The removal of `WARN_ON` is an improvement -- a WARN splat in dmesg for a mapping failure that the caller can handle is too noisy. Returning the error code lets the caller decide how to handle it. No issues. --- Generated by Claude Code Patch Reviewer