From: Claude Code Review Bot <claude-review@example.com>
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 [thread overview]
Message-ID: <review-patch3-20260421-iommu_map_sgtable-return-v1-3-fb484c07d2a1@nvidia.com> (raw)
In-Reply-To: <20260421-iommu_map_sgtable-return-v1-3-fb484c07d2a1@nvidia.com>
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
next prev parent reply other threads:[~2026-04-22 22:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-21 4:02 [PATCH 0/4] Fix checking of iommu_map_sgtable return value Mikko Perttunen
2026-04-21 4:02 ` [PATCH 1/4] gpu: host1x: Fix iommu_map_sgtable() return value check Mikko Perttunen
2026-04-22 22:57 ` Claude review: " Claude Code Review Bot
2026-04-21 4:02 ` [PATCH 2/4] drm/tegra: " Mikko Perttunen
2026-04-22 22:57 ` Claude review: " Claude Code Review Bot
2026-04-21 4:02 ` [PATCH 3/4] drm/msm: Fix iommu_map_sgtable() return value check and avoid WARN Mikko Perttunen
2026-04-22 22:57 ` Claude Code Review Bot [this message]
2026-04-21 4:02 ` [PATCH 4/4] media: nvidia: tegra-vde: Fix iommu_map_sgtable() return value check Mikko Perttunen
2026-04-22 22:57 ` Claude review: " Claude Code Review Bot
2026-04-22 22:57 ` Claude review: Fix checking of iommu_map_sgtable return value Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-patch3-20260421-iommu_map_sgtable-return-v1-3-fb484c07d2a1@nvidia.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox