From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: fbdev: goldfishfb: Request memory region
Date: Thu, 23 Apr 2026 09:34:41 +1000 [thread overview]
Message-ID: <review-patch3-20260420134424.77494-4-amit.barzilai22@gmail.com> (raw)
In-Reply-To: <20260420134424.77494-4-amit.barzilai22@gmail.com>
Patch Review
**Status: Good, with one observation**
Converts from bare `ioremap()` to `devm_ioremap_resource()`, and correctly removes the manual `iounmap()` calls from both the error unwind path and `goldfish_fb_remove()`.
```c
fb->reg_base = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(fb->reg_base)) {
ret = PTR_ERR(fb->reg_base);
goto err_no_io_base;
}
```
**Observation on mapping size:** The original code maps exactly `PAGE_SIZE` bytes:
```c
fb->reg_base = ioremap(r->start, PAGE_SIZE);
```
The new `devm_ioremap_resource()` maps `resource_size(r)` bytes. The actual register space only extends to offset `0x20` (36 bytes), so both PAGE_SIZE and the platform-defined resource size are more than sufficient. Mapping exactly what the resource describes is the right thing to do, so this is a correct change — but it's worth the reviewer being aware that the mapped size is now determined by the platform resource rather than hardcoded.
**Cleanup correctness:** The `iounmap()` removal is safe. The `kfree(fb)` calls in both the error path and `goldfish_fb_remove()` are retained, which is correct — freeing the struct that holds the `reg_base` pointer doesn't conflict with the devm-managed mapping lifetime (the mapping is tied to the device, not the struct).
No issues.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-04-22 23:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 13:44 [PATCH 0/3] fbdev: Request memory regions in platform drivers Amit Barzilai
2026-04-20 13:44 ` [PATCH 1/3] fbdev: cobalt_lcdfb: Request memory region Amit Barzilai
2026-04-22 14:50 ` Helge Deller
2026-04-22 23:34 ` Claude review: " Claude Code Review Bot
2026-04-20 13:44 ` [PATCH 2/3] fbdev: clps711x-fb: Request memory region for MMIO Amit Barzilai
2026-04-22 23:34 ` Claude review: " Claude Code Review Bot
2026-04-20 13:44 ` [PATCH 3/3] fbdev: goldfishfb: Request memory region Amit Barzilai
2026-04-22 14:43 ` Helge Deller
2026-04-22 23:34 ` Claude Code Review Bot [this message]
2026-04-22 23:34 ` Claude review: fbdev: Request memory regions in platform drivers 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-20260420134424.77494-4-amit.barzilai22@gmail.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